Skip to content

Commit 0f15faa

Browse files
committed
Backport test
1 parent c6ed621 commit 0f15faa

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

test/ParallelIOTest.cpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2202,3 +2202,44 @@ TEST_CASE("adios2_flush_via_step")
22022202
#endif
22032203

22042204
#endif // openPMD_HAVE_ADIOS2 && openPMD_HAVE_MPI
2205+
2206+
#if openPMD_HAVE_MPI
2207+
auto bug_1655_bp5_writer_hangup(std::string const &ext) -> void
2208+
{
2209+
int mpi_size;
2210+
int mpi_rank;
2211+
2212+
MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
2213+
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
2214+
2215+
auto const value = float(mpi_size * 100 + mpi_rank);
2216+
std::vector<float> local_data(10 * 300, value);
2217+
2218+
std::string filename = "../samples/ptl_%T." + ext;
2219+
2220+
Series series = Series(filename, Access::CREATE, MPI_COMM_WORLD);
2221+
2222+
Datatype datatype = determineDatatype<float>();
2223+
2224+
auto myptl = series.writeIterations()[1].particles["ion"];
2225+
Extent global_ptl = {10ul * mpi_size * 300};
2226+
Dataset dataset_ptl = Dataset(datatype, global_ptl, "{}");
2227+
myptl["charge"].resetDataset(dataset_ptl);
2228+
2229+
series.flush();
2230+
2231+
if (mpi_rank == 0) // only rank 0 adds data
2232+
myptl["charge"].storeChunk(local_data, {0}, {3000});
2233+
2234+
series.flush(); // hangs here
2235+
series.close();
2236+
}
2237+
2238+
TEST_CASE("bug_1655_bp5_writer_hangup", "[parallel]")
2239+
{
2240+
for (auto const &ext : testedFileExtensions())
2241+
{
2242+
bug_1655_bp5_writer_hangup(ext);
2243+
}
2244+
}
2245+
#endif

0 commit comments

Comments
 (0)