Skip to content

Commit c44d052

Browse files
authored
Merge pull request #817 from wangvsa/concurrency-bug-fix
Concurrency bug fix for issue #808
2 parents 3ffd297 + 0f5765c commit c44d052

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/src/testutil.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,12 +1260,17 @@ int test_remove_file(test_cfg* cfg, const char* filepath)
12601260

12611261
/* stat file and simply return if it already doesn't exist */
12621262
rc = stat(filepath, &sb);
1263+
// We want every rank get the result from stat()
1264+
// above. The barrier makes sure rank 0 won't just
1265+
// go ahead delete the file before others call stat()
1266+
test_barrier(cfg);
12631267
if (rc) {
12641268
test_print_verbose_once(cfg,
12651269
"DEBUG: stat(%s): file already doesn't exist", filepath);
12661270
return 0;
12671271
}
12681272

1273+
12691274
if (cfg->use_mpiio) {
12701275
if (cfg->rank == 0 || cfg->io_pattern == IO_PATTERN_NN) {
12711276
MPI_CHECK(cfg, (MPI_File_delete(filepath, MPI_INFO_NULL)));

0 commit comments

Comments
 (0)