Skip to content

Commit 124f0c0

Browse files
committed
pml/ucx: Fix usage of mca_pml_base_pml_check_selected()
Pass the correct ompi_proc_t and array length to mca_pml_base_pml_check_selected() during dynamic modex. Signed-off-by: Yossi Itigin <[email protected]>
1 parent 96759e8 commit 124f0c0

File tree

1 file changed

+9
-29
lines changed

1 file changed

+9
-29
lines changed

ompi/mca/pml/ucx/pml_ucx.c

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -393,22 +393,6 @@ static ucp_ep_h mca_pml_ucx_add_proc_common(ompi_proc_t *proc)
393393
return ep;
394394
}
395395

396-
static ucp_ep_h mca_pml_ucx_add_proc(ompi_communicator_t *comm, int dst)
397-
{
398-
ompi_proc_t *proc0 = ompi_comm_peer_lookup(comm, 0);
399-
ompi_proc_t *proc_peer = ompi_comm_peer_lookup(comm, dst);
400-
int ret;
401-
402-
/* Note, mca_pml_base_pml_check_selected, doesn't use 3rd argument */
403-
if (OMPI_SUCCESS != (ret = mca_pml_base_pml_check_selected("ucx",
404-
&proc0,
405-
dst))) {
406-
return NULL;
407-
}
408-
409-
return mca_pml_ucx_add_proc_common(proc_peer);
410-
}
411-
412396
int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
413397
{
414398
ompi_proc_t *proc;
@@ -436,26 +420,22 @@ int mca_pml_ucx_add_procs(struct ompi_proc_t **procs, size_t nprocs)
436420

437421
static inline ucp_ep_h mca_pml_ucx_get_ep(ompi_communicator_t *comm, int rank)
438422
{
423+
ompi_proc_t *proc_peer = ompi_comm_peer_lookup(comm, rank);
439424
ucp_ep_h ep;
440425

441-
ep = ompi_comm_peer_lookup(comm, rank)->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_PML];
442-
if (OPAL_LIKELY(ep != NULL)) {
426+
ep = proc_peer->proc_endpoints[OMPI_PROC_ENDPOINT_TAG_PML];
427+
if (OPAL_LIKELY(NULL != ep)) {
443428
return ep;
444429
}
445430

446-
ep = mca_pml_ucx_add_proc(comm, rank);
447-
if (OPAL_LIKELY(ep != NULL)) {
448-
return ep;
449-
}
450-
451-
if (rank >= ompi_comm_size(comm)) {
452-
PML_UCX_ERROR("Rank number (%d) is larger than communicator size (%d)",
453-
rank, ompi_comm_size(comm));
454-
} else {
455-
PML_UCX_ERROR("Failed to resolve UCX endpoint for rank %d", rank);
431+
/* Note, mca_pml_base_pml_check_selected, doesn't use 3rd argument */
432+
if (OMPI_SUCCESS != mca_pml_base_pml_check_selected("ucx",
433+
&proc_peer,
434+
1)) {
435+
return NULL;
456436
}
457437

458-
return NULL;
438+
return mca_pml_ucx_add_proc_common(proc_peer);
459439
}
460440

461441
int mca_pml_ucx_del_procs(struct ompi_proc_t **procs, size_t nprocs)

0 commit comments

Comments
 (0)