Skip to content

Commit ed81a13

Browse files
authored
Merge pull request #5248 from hoopoepg/topic/pml-ucx-hang-on-finalize-v3.1
PML/UCX: fixed hang on MPI_Finalize - v3.1.x
2 parents ce4ad2d + 2bf0097 commit ed81a13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ int mca_pml_ucx_del_procs(struct ompi_proc_t **procs, size_t nprocs)
394394
void *dreq, **dreqs;
395395
ucp_ep_h ep;
396396
size_t i;
397+
ucs_status_t ret;
397398

398399
max_reqs = ompi_pml_ucx.num_disconnect;
399400
if (max_reqs > nprocs) {
@@ -435,6 +436,14 @@ int mca_pml_ucx_del_procs(struct ompi_proc_t **procs, size_t nprocs)
435436

436437
mca_pml_ucx_waitall(dreqs, &num_reqs);
437438
free(dreqs);
439+
/* flush worker to allow all pending operations to complete.
440+
* ignore error (we can do nothing here), just try to
441+
* finalize gracefully */
442+
ret = ucp_worker_flush(ompi_pml_ucx.ucp_worker);
443+
if (UCS_OK != ret) {
444+
PML_UCX_ERROR("ucp_worker_flush failed: %s",
445+
ucs_status_string(ret));
446+
}
438447

439448
opal_pmix.fence(NULL, 0);
440449

0 commit comments

Comments
 (0)