Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
13 changes: 11 additions & 2 deletions source/adios2/toolkit/profiling/iochrono/IOChrono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,17 @@ std::string JSONProfiler::GetRankProfilingJSON(
rankLog += ", \"transport_" + std::to_string(t) + "\":{";
rankLog += "\"type\":\"" + transportsTypes[t] + "\"";

size_t wBytes = transportsProfilers[t]->m_Bytes.at("write");
rankLog += ", \"wbytes\":" + std::to_string(wBytes);
if (transportsProfilers[t]->m_Bytes.find("write") != transportsProfilers[t]->m_Bytes.end())
{
size_t wBytes = transportsProfilers[t]->m_Bytes.at("write");
rankLog += ", \"wbytes\":" + std::to_string(wBytes);
}
else if (transportsProfilers[t]->m_Bytes.find("read") !=
transportsProfilers[t]->m_Bytes.end())
{
size_t rBytes = transportsProfilers[t]->m_Bytes.at("read");
rankLog += ", \"rbytes\":" + std::to_string(rBytes);
}

for (const auto &transportTimerPair : transportsProfilers[t]->m_Timers)
{
Expand Down