From 186fcec5054c93446e476b61b1d6b28196fc97fe Mon Sep 17 00:00:00 2001 From: Chen Wang Date: Mon, 1 Jul 2024 11:04:25 -0700 Subject: [PATCH] bug fix for issue #808 Signed-off-by: Chen Wang --- examples/src/testutil.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/src/testutil.h b/examples/src/testutil.h index c593b4e03..e7c48e11d 100644 --- a/examples/src/testutil.h +++ b/examples/src/testutil.h @@ -1260,12 +1260,17 @@ int test_remove_file(test_cfg* cfg, const char* filepath) /* stat file and simply return if it already doesn't exist */ rc = stat(filepath, &sb); + // We want every rank get the result from stat() + // above. The barrier makes sure rank 0 won't just + // go ahead delete the file before others call stat() + test_barrier(cfg); if (rc) { test_print_verbose_once(cfg, "DEBUG: stat(%s): file already doesn't exist", filepath); return 0; } + if (cfg->use_mpiio) { if (cfg->rank == 0 || cfg->io_pattern == IO_PATTERN_NN) { MPI_CHECK(cfg, (MPI_File_delete(filepath, MPI_INFO_NULL)));