Skip to content

Commit 1526fe8

Browse files
authored
Merge pull request #5257 from hoopoepg/topic/pml-ucx-hang-on-finalize-v3.0
PML/UCX: fixed hang on MPI_Finalize - v3.0
2 parents 3d96261 + 4613d53 commit 1526fe8

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
@@ -388,6 +388,7 @@ int mca_pml_ucx_del_procs(struct ompi_proc_t **procs, size_t nprocs)
388388
void *dreq, **dreqs;
389389
ucp_ep_h ep;
390390
size_t i;
391+
ucs_status_t ret;
391392

392393
max_reqs = ompi_pml_ucx.num_disconnect;
393394
if (max_reqs > nprocs) {
@@ -429,6 +430,14 @@ int mca_pml_ucx_del_procs(struct ompi_proc_t **procs, size_t nprocs)
429430

430431
mca_pml_ucx_waitall(dreqs, &num_reqs);
431432
free(dreqs);
433+
/* flush worker to allow all pending operations to complete.
434+
* ignore error (we can do nothing here), just try to
435+
* finalize gracefully */
436+
ret = ucp_worker_flush(ompi_pml_ucx.ucp_worker);
437+
if (UCS_OK != ret) {
438+
PML_UCX_ERROR("ucp_worker_flush failed: %s",
439+
ucs_status_string(ret));
440+
}
432441

433442
opal_pmix.fence(NULL, 0);
434443

0 commit comments

Comments
 (0)