Skip to content

Commit

Permalink
openPMD: Collective Open & Group Based
Browse files Browse the repository at this point in the history
Re-introduce writing to one file to avoid syncs.

Write in parallel into one file, which we open collectively.
This has the nice side-effect, that later iteration flushes
can be performed as non-collective writes.
  • Loading branch information
ax3l committed Dec 18, 2020
1 parent 72087ba commit 1db74be
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Hipace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -900,8 +900,7 @@ Hipace::InitDiagnostics ()
HIPACE_PROFILE("Hipace::InitDiagnostics()");

#ifdef HIPACE_USE_OPENPMD
std::string filename = "diags/openPMD/openpmd_%06T.h5"; // bp or h5
// std::string filename = "diags/openPMD/openpmd.h5"; // writing to single file did not work
std::string filename = "diags/openPMD/openpmd.h5"; // bp or h5
# ifdef AMREX_USE_MPI
m_outputSeries = std::make_unique< io::Series >(
filename, io::Access::CREATE, amrex::ParallelDescriptor::Communicator());
Expand All @@ -910,9 +909,9 @@ Hipace::InitDiagnostics ()
filename, io::Access::CREATE);
# endif

// // open files early and collectively, so later flush calls are non-collective
// m_outputSeries->setIterationEncoding( io::IterationEncoding::groupBased );
// m_outputSeries->flush();
// open files early and collectively, so later flush calls are non-collective
m_outputSeries->setIterationEncoding( io::IterationEncoding::groupBased );
m_outputSeries->flush();

// TODO: meta-data: author, mesh path, extensions, software
#endif
Expand Down

0 comments on commit 1db74be

Please sign in to comment.