Skip to content

Commit c9de252

Browse files
Try to get multiple time steps working
1 parent d5100f2 commit c9de252

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

source/adios2/engine/bp5/BP5Writer.cpp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ BP5Writer::BP5Writer(IO &io, const std::string &name, const Mode mode, helper::C
5353
std::string BP5Writer::GetCacheKey(aggregator::MPIAggregator *aggregator)
5454
{
5555
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 << "-";
5860
return ss.str();
5961
}
6062

@@ -1342,13 +1344,13 @@ void BP5Writer::InitTransports()
13421344

13431345
std::string cacheKey = GetCacheKey(m_Aggregator);
13441346
auto search = m_AggregatorSpecifics.find(cacheKey);
1345-
// bool cacheHit = false;
1347+
bool cacheHit = false;
13461348

13471349
if (search != m_AggregatorSpecifics.end())
13481350
{
13491351
std::cout << "Rank " << m_Comm.Rank() << " cache hit for aggregator key " << cacheKey
13501352
<< std::endl;
1351-
// cacheHit = true;
1353+
cacheHit = true;
13521354
}
13531355
else
13541356
{
@@ -1439,13 +1441,22 @@ void BP5Writer::InitTransports()
14391441
// end up in mpi deadlock (communication among all ranks is expected on the
14401442
// DataWritingComm. So commenting out for now to allow getting a little
14411443
// 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+
}
14491460
}
14501461
std::cout << "Rank " << m_Comm.Rank() << " - M" << std::endl;
14511462
if (m_IAmDraining)
@@ -1463,7 +1474,7 @@ void BP5Writer::InitTransports()
14631474
}
14641475
}
14651476
std::cout << "Rank " << m_Comm.Rank() << " - N" << std::endl;
1466-
if (m_Comm.Rank() == 0)
1477+
if (m_Comm.Rank() == 0 && m_WriterStep == 0)
14671478
{
14681479
std::cout << "Rank " << m_Comm.Rank() << " - O" << std::endl;
14691480
// force turn off directio to metadata files

0 commit comments

Comments
 (0)