diff --git a/ompi/communicator/comm.c b/ompi/communicator/comm.c index 15200a0006..4069f9631d 100644 --- a/ompi/communicator/comm.c +++ b/ompi/communicator/comm.c @@ -1540,6 +1540,11 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm, rc = ompi_proc_unpack(rbuf, rsize, &rprocs, true, NULL, NULL); OBJ_RELEASE(rbuf); + /* set the locality of the remote procs */ + for (i=0; i < rsize; i++) { + ompi_proc_set_locality(rprocs[i]); + } + /* And now add the information into the database */ /* Store the remote processes into the opal_db */ if (OMPI_SUCCESS != (rc = MCA_PML_CALL(add_procs(rprocs, rsize)))) { @@ -1547,11 +1552,6 @@ ompi_proc_t **ompi_comm_get_rprocs ( ompi_communicator_t *local_comm, goto err_exit; } - /* set the locality of the remote procs */ - for (i=0; i < rsize; i++) { - ompi_proc_set_locality(rprocs[i]); - } - err_exit: /* rprocs isn't freed unless we have an error, since it is used in the communicator */ diff --git a/ompi/mca/dpm/orte/dpm_orte.c b/ompi/mca/dpm/orte/dpm_orte.c index 98705792f2..834dca6dca 100644 --- a/ompi/mca/dpm/orte/dpm_orte.c +++ b/ompi/mca/dpm/orte/dpm_orte.c @@ -540,6 +540,11 @@ static int connect_accept(ompi_communicator_t *comm, int root, "%s dpm:orte:connect_accept adding procs", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); + /* set the locality of the new procs */ + for (j=0; j < new_proc_len; j++) { + ompi_proc_set_locality(new_proc_list[j]); + } + if (OMPI_SUCCESS != (rc = MCA_PML_CALL(add_procs(new_proc_list, new_proc_len)))) { ORTE_ERROR_LOG(rc); goto exit; @@ -549,10 +554,6 @@ static int connect_accept(ompi_communicator_t *comm, int root, "%s dpm:orte:connect_accept new procs added", ORTE_NAME_PRINT(ORTE_PROC_MY_NAME))); - /* set the locality of the new procs */ - for (j=0; j < new_proc_len; j++) { - ompi_proc_set_locality(new_proc_list[j]); - } } OBJ_RELEASE(nrbuf);