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

Commit ef6e79e

Browse files
committed
ompi_proc_complete_init_single: make the subroutine public
and accept a proc from a different job (cherry picked from commit open-mpi/opmi@a4aa4c95715ea7ec7922b7c3f3550aebd1dad3d0)
1 parent 88d8a8d commit ef6e79e

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

ompi/proc/proc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,14 +129,15 @@ static int ompi_proc_allocate (ompi_jobid_t jobid, ompi_vpid_t vpid, ompi_proc_t
129129
* retrieving the hostname (if below the modex cutoff), determining the
130130
* remote architecture, and calculating the locality of the process.
131131
*/
132-
static int ompi_proc_complete_init_single (ompi_proc_t *proc)
132+
int ompi_proc_complete_init_single (ompi_proc_t *proc)
133133
{
134134
uint16_t u16, *u16ptr;
135135
int ret;
136136

137137
u16ptr = &u16;
138138

139-
if (OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid == OMPI_PROC_MY_NAME->vpid) {
139+
if ((OMPI_CAST_RTE_NAME(&proc->super.proc_name)->jobid == OMPI_PROC_MY_NAME->jobid) &&
140+
(OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid == OMPI_PROC_MY_NAME->vpid)) {
140141
/* nothing else to do */
141142
return OMPI_SUCCESS;
142143
}

ompi/proc/proc.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,18 @@ OMPI_DECLSPEC int ompi_proc_init(void);
122122
*/
123123
OMPI_DECLSPEC int ompi_proc_complete_init(void);
124124

125+
/**
126+
* Complete filling up the proc information (arch, name and locality) for
127+
* a given proc. This function is to be called only after the modex exchange
128+
* has been completed.
129+
*
130+
* @param[in] proc the proc whose information will be filled up
131+
*
132+
* @retval OMPI_SUCCESS All information correctly set.
133+
* @retval OMPI_ERROR Some info could not be initialized.
134+
*/
135+
OMPI_DECLSPEC int ompi_proc_complete_init_single(ompi_proc_t* proc);
136+
125137
/**
126138
* Finalize the OMPI Process subsystem
127139
*

0 commit comments

Comments
 (0)