diff --git a/ompi/runtime/ompi_mpi_finalize.c b/ompi/runtime/ompi_mpi_finalize.c index 4b2e4531bd..0ec835a51e 100644 --- a/ompi/runtime/ompi_mpi_finalize.c +++ b/ompi/runtime/ompi_mpi_finalize.c @@ -94,6 +94,9 @@ int ompi_mpi_finalize(void) opal_list_item_t *item; struct timeval ompistart, ompistop; ompi_rte_collective_t *coll; + ompi_proc_t** procs; + size_t nprocs; + /* Be a bit social if an erroneous program calls MPI_FINALIZE in two different threads, otherwise we may deadlock in @@ -150,6 +153,18 @@ int ompi_mpi_finalize(void) MPI lifetime, to get better latency when not using TCP */ opal_progress_event_users_increment(); + + if (NULL == (procs = ompi_proc_world(&nprocs))) { + return OMPI_ERROR; + } + + if (OMPI_SUCCESS != (ret = MCA_PML_CALL(del_procs(procs, nprocs)))) { + free(procs); + return ret; + } + free(procs); + + /* check to see if we want timing information */ if (ompi_enable_timing != 0 && 0 == OMPI_PROC_MY_NAME->vpid) { gettimeofday(&ompistart, NULL);