diff --git a/src/scr.c b/src/scr.c index d04c2de8..214425af 100644 --- a/src/scr.c +++ b/src/scr.c @@ -3123,6 +3123,12 @@ int SCR_Need_checkpoint(int* flag) /* rank 0 broadcasts the decision */ MPI_Bcast(flag, 1, MPI_INT, 0, scr_comm_world); + /* if we have an async flush ongoing, take this chance to check whether it's completed */ + if (scr_flush_async_in_progress()) { + /* got an outstanding async flush, let's check it */ + scr_flush_async_progall(scr_cindex); + } + return SCR_SUCCESS; } @@ -3756,6 +3762,12 @@ int SCR_Should_exit(int* flag) *flag = 1; } + /* if we have an async flush ongoing, take this chance to check whether it's completed */ + if (scr_flush_async_in_progress()) { + /* got an outstanding async flush, let's check it */ + scr_flush_async_progall(scr_cindex); + } + return SCR_SUCCESS; }