Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeBuffersForPlotfile: Barrier #2608

Merged
Merged
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
6 changes: 6 additions & 0 deletions Source/Diagnostics/BTDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,12 @@ void BTDiagnostics::TMP_ClearSpeciesDataForBTD ()

void BTDiagnostics::MergeBuffersForPlotfile (int i_snapshot)
{
// Make sure all MPI ranks wrote their files and closed it
// Note: additionally, since a Barrier does not guarantee a FS sync
// on a parallel FS, we might need to add timeouts and retries
// to the open calls below when running at scale.
amrex::ParallelDescriptor::Barrier();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RevathiJambunathan are we guaranteeing that all MPI ranks reach this point? :)
Otherwise we could call a barrier on a sub-communicator, if needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the I/O for BTD is done within amrex:ParallelContext::IOProcessorSub() for the cases when we have only some processors dedicated to I/O

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is also amrex::ParallelContext::BarrierSub() for that.

Copy link
Member Author

@ax3l ax3l Nov 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cool!
So that means the current PR proposal should work (sync all that potentially wrote a plotfile).

Btw, is there a specific reason for the barrier at the end of BTDiagnostics::MergeBuffersForPlotfile?


auto & warpx = WarpX::GetInstance();
const amrex::Vector<int> iteration = warpx.getistep();
if (amrex::ParallelContext::IOProcessorSub()) {
Expand Down