Skip to content

Commit da132f7

Browse files
author
rhc54
committed
Merge pull request #1577 from rhc54/topic/finalize
Somehow, the logic for finalize got lost, so restore it here. If pmix…
2 parents 4a5fdd5 + 7373111 commit da132f7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ompi/runtime/ompi_mpi_finalize.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,19 @@
9090
extern bool ompi_enable_timing;
9191
extern bool ompi_enable_timing_ext;
9292

93+
static void fence_cbfunc(int status, void *cbdata)
94+
{
95+
volatile bool *active = (volatile bool*)cbdata;
96+
*active = false;
97+
}
98+
9399
int ompi_mpi_finalize(void)
94100
{
95101
int ret = MPI_SUCCESS;
96102
opal_list_item_t *item;
97103
ompi_proc_t** procs;
98104
size_t nprocs;
105+
volatile bool active;
99106
OPAL_TIMING_DECLARE(tm);
100107
OPAL_TIMING_INIT_EXT(&tm, OPAL_TIMING_GET_TIME_OF_DAY);
101108

@@ -239,7 +246,14 @@ int ompi_mpi_finalize(void)
239246
del_procs behavior around May of 2014 (see
240247
https://svn.open-mpi.org/trac/ompi/ticket/4669#comment:4 for
241248
more details). */
242-
opal_pmix.fence(NULL, 0);
249+
if (NULL != opal_pmix.fence_nb) {
250+
active = true;
251+
opal_pmix.fence_nb(NULL, 0, fence_cbfunc, (void*)&active);
252+
OMPI_WAIT_FOR_COMPLETION(active);
253+
} else {
254+
MPI_Barrier(MPI_COMM_WORLD);
255+
opal_pmix.fence(NULL, 0);
256+
}
243257

244258
/* check for timing request - get stop time and report elapsed
245259
time if so */

0 commit comments

Comments
 (0)