@@ -53,8 +53,10 @@ BP5Writer::BP5Writer(IO &io, const std::string &name, const Mode mode, helper::C
53
53
std::string BP5Writer::GetCacheKey (aggregator::MPIAggregator *aggregator)
54
54
{
55
55
std::stringstream ss;
56
- ss << aggregator->m_SubStreamIndex << " -" << aggregator->m_AggregatorRank << " -"
57
- << aggregator->m_Rank << " -" << aggregator->m_IsAggregator ;
56
+ ss << " ssidx:" << aggregator->m_SubStreamIndex << " -" ;
57
+ // << "aggrank:" << aggregator->m_AggregatorRank << "-"
58
+ // << "order:" << aggregator->m_Rank << "-"
59
+ // << "isagg:" << aggregator->m_IsAggregator << "-";
58
60
return ss.str ();
59
61
}
60
62
@@ -1342,13 +1344,13 @@ void BP5Writer::InitTransports()
1342
1344
1343
1345
std::string cacheKey = GetCacheKey (m_Aggregator);
1344
1346
auto search = m_AggregatorSpecifics.find (cacheKey);
1345
- // bool cacheHit = false;
1347
+ bool cacheHit = false ;
1346
1348
1347
1349
if (search != m_AggregatorSpecifics.end ())
1348
1350
{
1349
1351
std::cout << " Rank " << m_Comm.Rank () << " cache hit for aggregator key " << cacheKey
1350
1352
<< std::endl;
1351
- // cacheHit = true;
1353
+ cacheHit = true ;
1352
1354
}
1353
1355
else
1354
1356
{
@@ -1439,13 +1441,22 @@ void BP5Writer::InitTransports()
1439
1441
// end up in mpi deadlock (communication among all ranks is expected on the
1440
1442
// DataWritingComm. So commenting out for now to allow getting a little
1441
1443
// further.
1442
- // if (!cacheHit)
1443
- // {
1444
- std::cout << " Rank " << m_Comm.Rank () << " - L" << std::endl;
1445
- aggData.m_FileDataManager .OpenFiles (aggData.m_SubStreamNames , m_OpenMode,
1446
- m_IO.m_TransportsParameters , useProfiler,
1447
- *DataWritingComm);
1448
- // }
1444
+ if (!cacheHit)
1445
+ {
1446
+ std::cout << " Rank " << m_Comm.Rank () << " - L" << std::endl;
1447
+ if (m_Parameters.AggregationType == (int )AggregationType::DataSizeBased)
1448
+ {
1449
+ aggData.m_FileDataManager .OpenFiles (aggData.m_SubStreamNames , m_OpenMode,
1450
+ m_IO.m_TransportsParameters , useProfiler,
1451
+ *DataWritingComm);
1452
+ }
1453
+ else
1454
+ {
1455
+ aggData.m_FileDataManager .OpenFiles (aggData.m_SubStreamNames , m_OpenMode,
1456
+ m_IO.m_TransportsParameters , useProfiler,
1457
+ *DataWritingComm);
1458
+ }
1459
+ }
1449
1460
}
1450
1461
std::cout << " Rank " << m_Comm.Rank () << " - M" << std::endl;
1451
1462
if (m_IAmDraining)
@@ -1463,7 +1474,7 @@ void BP5Writer::InitTransports()
1463
1474
}
1464
1475
}
1465
1476
std::cout << " Rank " << m_Comm.Rank () << " - N" << std::endl;
1466
- if (m_Comm.Rank () == 0 )
1477
+ if (m_Comm.Rank () == 0 && m_WriterStep == 0 )
1467
1478
{
1468
1479
std::cout << " Rank " << m_Comm.Rank () << " - O" << std::endl;
1469
1480
// force turn off directio to metadata files
0 commit comments