Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

Commit dab2c1a

Browse files
committed
ompi/dpm: retrieves OPAL_PMIX_ARCH in heterogeneous mode
also remove code duplication by using ompi_proc_complete_init_single() Thanks Siegmar Gross for reporting this issue, and Ralph for the guidance. (cherry picked from commit open-mpi/ompi@308bbcb)
1 parent ef6e79e commit dab2c1a

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

ompi/dpm/dpm.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
378378
opal_list_append(&ilist, &cd->super);
379379
}
380380
/* either way, add to the remote list */
381-
cd = OBJ_NEW(ompi_dpm_proct_caddy_t);
381+
cd = OBJ_NEW(ompi_dpm_proct_caddy_t);
382382
cd->p = proc;
383383
opal_list_append(&rlist, &cd->super);
384384
}
@@ -403,24 +403,19 @@ int ompi_dpm_connect_accept(ompi_communicator_t *comm, int root,
403403
i = 0;
404404
OPAL_LIST_FOREACH(cd, &ilist, ompi_dpm_proct_caddy_t) {
405405
opal_value_t *kv;
406-
new_proc_list[i] = cd->p;
407-
/* set the locality */
408-
new_proc_list[i]->super.proc_flags = OPAL_PROC_NON_LOCAL;
409-
/* have to save it for later */
406+
proc = cd->p;
407+
new_proc_list[i] = proc ;
408+
/* ompi_proc_complete_init_single() initializes and optionally retrieves
409+
* OPAL_PMIX_LOCALITY and OPAL_PMIX_HOSTNAME. since we can live without
410+
* them, we are just fine */
411+
ompi_proc_complete_init_single(proc);
412+
/* save the locality for later */
410413
kv = OBJ_NEW(opal_value_t);
411414
kv->key = strdup(OPAL_PMIX_LOCALITY);
412415
kv->type = OPAL_UINT16;
413-
kv->data.uint16 = OPAL_PROC_NON_LOCAL;
414-
opal_pmix.store_local(&cd->p->super.proc_name, kv);
416+
kv->data.uint16 = proc->super.proc_flags;
417+
opal_pmix.store_local(&proc->super.proc_name, kv);
415418
OBJ_RELEASE(kv); // maintain accounting
416-
/* we can retrieve the hostname at no cost because it
417-
* was provided at connect */
418-
OPAL_MODEX_RECV_VALUE(rc, OPAL_PMIX_HOSTNAME, &new_proc_list[i]->super.proc_name,
419-
(char**)&(new_proc_list[i]->super.proc_hostname), OPAL_STRING);
420-
if (OPAL_SUCCESS != rc) {
421-
/* we can live without it */
422-
new_proc_list[i]->super.proc_hostname = NULL;
423-
}
424419
++i;
425420
}
426421
/* call add_procs on the new ones */

0 commit comments

Comments
 (0)