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

Workaround for independent writes to Iterations in parallel, better detection of BP5 which in turn uncovers more instances of the first issue #1619

Merged
merged 12 commits into from
Jun 11, 2024

Conversation

franzpoeschel
Copy link
Contributor

@franzpoeschel franzpoeschel commented May 8, 2024

This somewhat fixes #1616 until we add a better solution. With this PR: seriesFlush() will always flush the containing Iteration if called from within an Iteration (and will ignore missing dirty annotations).

At the same time, I added a better detection for BP5-specific features. Since this means that adios2::Engine::PerformDataWrite() is used automatically more often, this uncovers further parallel flushing bugs. So, these two items are treated together in this PR.

In a follow-up PR later on, as a more breaking change, we would also flush all open iterations in MPI-parallel contexts on series.flush(), but for this we will first need functionality to reopen iterations after close #1592.

TODO:

  • documentation
  • testing

test/ParallelIOTest.cpp Fixed Show fixed Hide fixed
@franzpoeschel franzpoeschel force-pushed the fix-iteration-flush branch 3 times, most recently from 237b394 to 8bbc170 Compare June 6, 2024 13:08
@franzpoeschel franzpoeschel changed the title Workaround for independent writes to Iterations in parallel Workaround for independent writes to Iterations in parallel, better detection of BP5 which in turn uncovers more instances of the first issue Jun 6, 2024
@@ -946,10 +946,16 @@ void hipace_like_write(std::string const &file_ending)
int const last_step = 100;
int const my_first_step = i_mpi_rank * int(local_Nz);
int const all_last_step = last_step + (i_mpi_size - 1) * int(local_Nz);

bool participate_in_barrier = true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ax3l Can you please check if this bug also affects Hipace? Currently, the sequence of barriers and flushes dont match from rank to rank. This was uncovered only now, since flushing is effectively not collective in many situations, but this test now uses adios2::Engine::PerformDataWrite() of BP5 which is a bit stricter there.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, great catch!

For HiPACE++, we changed the time stepping logic the other year, so that every MPI rank just writes to exactly one iteration. Thus, it cannot have this bug (anymore).

"adios2.engine.preferred_flush_target = \"buffer\"");
int size, rank;
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);

Check notice

Code scanning / CodeQL

Commented-out code Note test

This comment appears to contain commented-out code.
@franzpoeschel franzpoeschel force-pushed the fix-iteration-flush branch 2 times, most recently from 9dd2a14 to 72a465c Compare June 6, 2024 15:54
@ax3l ax3l merged commit 5d9fb34 into openPMD:dev Jun 11, 2024
31 checks passed
franzpoeschel added a commit to franzpoeschel/openPMD-api that referenced this pull request Jun 28, 2024
franzpoeschel added a commit that referenced this pull request Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parallel flushing cannot rely on dirty checks
2 participants