Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
guj committed Jun 18, 2024
1 parent 4adeb05 commit e76b716
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions source/adios2/engine/bp5/BP5Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ std::pair<double, double> BP5Reader::ReadData(adios2::transportman::TransportMan
FileManager.CloseFiles((int)m->first);
}
FileManager.OpenFileID(subFileName, SubfileNum, Mode::Read, m_IO.m_TransportsParameters[0],
/*{{"transport", "File"}},*/ false);
/*{{"transport", "File"}},*/ true);
if (!m_WriterIsActive)
{
Params transportParameters;
Expand Down Expand Up @@ -621,7 +621,7 @@ size_t BP5Reader::OpenWithTimeout(transportman::TransportMan &tm,
try
{
errno = 0;
const bool profile = false; // m_BP4Deserializer.m_Profiler.m_IsActive;
const bool profile = true; // m_BP4Deserializer.m_Profiler.m_IsActive;
tm.OpenFiles(fileNames, adios2::Mode::Read, m_IO.m_TransportsParameters, profile);
flag = 0; // found file
break;
Expand Down Expand Up @@ -1333,8 +1333,32 @@ void BP5Reader::DoClose(const int transportIndex)

void BP5Reader::FlushProfiler()
{
auto transportTypes = m_DataFileManager.GetTransportsTypes();
auto transportProfilers = m_DataFileManager.GetTransportsProfilers();

auto lf_AddMe =
[&](transportman::TransportMan& tm) -> void {
auto tmpT = tm.GetTransportsTypes();
auto tmpP = tm.GetTransportsProfilers();

if (tmpT.size() > 0) {
transportTypes.insert(transportTypes.end(), tmpT.begin(), tmpT.end());
transportProfilers.insert(transportProfilers.end(), tmpP.begin(), tmpP.end());
}
};

lf_AddMe(m_MDFileManager);
lf_AddMe(m_MDIndexFileManager);
lf_AddMe(m_FileMetaMetadataManager);

for (unsigned int i = 0; i < m_Threads; ++i)
{
lf_AddMe(fileManagers[i]);
}

const std::string LineJSON(m_JSONProfiler.GetRankProfilingJSON(transportTypes, transportProfilers) +
",\n");

auto LineJSON = m_JSONProfiler.GetRankProfilingJSON({}, {});
const std::vector<char> profilingJSON(m_JSONProfiler.AggregateProfilingJSON(LineJSON));

if (m_RankMPI == 0)
Expand Down

0 comments on commit e76b716

Please sign in to comment.