@@ -339,12 +339,24 @@ int main(int argc, char** argv)
339339
340340 err = ncmpi_enddef (ncid ); CHECK_ERR
341341
342+ #ifdef STRONGER_CONSISTENCY
343+ ncmpi_sync (ncid );
344+ MPI_Barrier (MPI_COMM_WORLD );
345+ ncmpi_sync (ncid );
346+ #endif
347+
342348 /* clear the file contents using a blocking API, before commit the
343349 * nonblocking requests posted in define mode */
344350 if (!bb_enabled ) {
345351 nerrs += clear_file_contents (ncid , varid );
346352 }
347353
354+ #ifdef STRONGER_CONSISTENCY
355+ ncmpi_sync (ncid );
356+ MPI_Barrier (MPI_COMM_WORLD );
357+ ncmpi_sync (ncid );
358+ #endif
359+
348360 nerrs += check_num_pending_reqs (ncid , nreqs , __LINE__ );
349361 err = ncmpi_wait_all (ncid , nreqs , reqs , sts );
350362 CHECK_ERR
@@ -393,12 +405,24 @@ int main(int argc, char** argv)
393405 }
394406 err = ncmpi_enddef (ncid ); CHECK_ERR
395407
408+ #ifdef STRONGER_CONSISTENCY
409+ ncmpi_sync (ncid );
410+ MPI_Barrier (MPI_COMM_WORLD );
411+ ncmpi_sync (ncid );
412+ #endif
413+
396414 /* clear the file contents using a blocking API, before commit the
397415 * nonblocking requests posted in define mode */
398416 if (!bb_enabled ) {
399417 nerrs += clear_file_contents (ncid , varid );
400418 }
401419
420+ #ifdef STRONGER_CONSISTENCY
421+ ncmpi_sync (ncid );
422+ MPI_Barrier (MPI_COMM_WORLD );
423+ ncmpi_sync (ncid );
424+ #endif
425+
402426 nerrs += check_num_pending_reqs (ncid , nreqs , __LINE__ );
403427 err = ncmpi_wait_all (ncid , nreqs , reqs , sts );
404428 CHECK_ERR
@@ -457,12 +481,24 @@ int main(int argc, char** argv)
457481
458482 err = ncmpi_enddef (ncid ); CHECK_ERR
459483
484+ #ifdef STRONGER_CONSISTENCY
485+ ncmpi_sync (ncid );
486+ MPI_Barrier (MPI_COMM_WORLD );
487+ ncmpi_sync (ncid );
488+ #endif
489+
460490 /* clear the file contents using a blocking API, before commit the
461491 * nonblocking requests posted in define mode */
462492 if (!bb_enabled ) {
463493 nerrs += clear_file_contents (ncid , varid );
464494 }
465495
496+ #ifdef STRONGER_CONSISTENCY
497+ ncmpi_sync (ncid );
498+ MPI_Barrier (MPI_COMM_WORLD );
499+ ncmpi_sync (ncid );
500+ #endif
501+
466502 nerrs += check_num_pending_reqs (ncid , nreqs * 2 , __LINE__ );
467503 err = ncmpi_wait_all (ncid , nreqs , reqs , sts );
468504 CHECK_ERR
@@ -555,12 +591,24 @@ int main(int argc, char** argv)
555591
556592 err = ncmpi_enddef (ncid ); CHECK_ERR
557593
594+ #ifdef STRONGER_CONSISTENCY
595+ ncmpi_sync (ncid );
596+ MPI_Barrier (MPI_COMM_WORLD );
597+ ncmpi_sync (ncid );
598+ #endif
599+
558600 /* clear the file contents using a blocking API, before commit the
559601 * nonblocking requests posted in define mode */
560602 if (!bb_enabled ) {
561603 nerrs += clear_file_contents (ncid , varid );
562604 }
563605
606+ #ifdef STRONGER_CONSISTENCY
607+ ncmpi_sync (ncid );
608+ MPI_Barrier (MPI_COMM_WORLD );
609+ ncmpi_sync (ncid );
610+ #endif
611+
564612 nerrs += check_num_pending_reqs (ncid , nreqs * 3 , __LINE__ );
565613
566614 /* flush nonblocking write requests */
0 commit comments