Skip to content

Commit b0ff2a1

Browse files
committed
Merge pull request open-mpi#617 from ggouaillardet/topic/v2.x/ompi_proc_complete_init
ompi_proc_complete_init: always reset u16ptr
2 parents bea2623 + b2c4737 commit b0ff2a1

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

ompi/proc/proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ int ompi_proc_complete_init(void)
142142
uint16_t u16, *u16ptr;
143143

144144
OPAL_THREAD_LOCK(&ompi_proc_lock);
145-
u16ptr = &u16;
146145

147146
OPAL_LIST_FOREACH(proc, &ompi_proc_list, ompi_proc_t) {
148147
if (OMPI_CAST_RTE_NAME(&proc->super.proc_name)->vpid != OMPI_PROC_MY_NAME->vpid) {
149148
/* get the locality information - all RTEs are required
150149
* to provide this information at startup */
150+
u16ptr = &u16;
151151
OPAL_MODEX_RECV_VALUE_OPTIONAL(ret, OPAL_PMIX_LOCALITY, &proc->super.proc_name, &u16ptr, OPAL_UINT16);
152152
if (OPAL_SUCCESS != ret) {
153153
proc->super.proc_flags = OPAL_PROC_NON_LOCAL;

opal/mca/pmix/pmix.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,7 @@ extern int opal_pmix_base_exchange(opal_value_t *info,
139139
_info->type = OPAL_BOOL; \
140140
_info->data.flag = true; \
141141
opal_list_append(&(_ilist), &(_info)->super); \
142-
if (OPAL_SUCCESS != ((r) = opal_pmix.get((p), (s), &(_ilist), &(_kv)))) { \
143-
*(d) = NULL; \
144-
} else { \
142+
if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), &(_ilist), &(_kv)))) { \
145143
(r) = opal_value_unload(_kv, (void**)(d), (t)); \
146144
OBJ_RELEASE(_kv); \
147145
} \
@@ -168,9 +166,7 @@ extern int opal_pmix_base_exchange(opal_value_t *info,
168166
OPAL_NAME_PRINT(OPAL_PROC_MY_NAME), \
169167
__FILE__, __LINE__, \
170168
OPAL_NAME_PRINT(*(p)), (s))); \
171-
if (OPAL_SUCCESS != ((r) = opal_pmix.get((p), (s), NULL, &(_kv)))) { \
172-
*(d) = NULL; \
173-
} else { \
169+
if (OPAL_SUCCESS == ((r) = opal_pmix.get((p), (s), NULL, &(_kv)))) { \
174170
(r) = opal_value_unload(_kv, (void**)(d), (t)); \
175171
OBJ_RELEASE(_kv); \
176172
} \
@@ -203,9 +199,6 @@ extern int opal_pmix_base_exchange(opal_value_t *info,
203199
*(sz) = _kv->data.bo.size; \
204200
_kv->data.bo.bytes = NULL; /* protect the data */ \
205201
OBJ_RELEASE(_kv); \
206-
} else { \
207-
*(d) = NULL; \
208-
*(sz) = 0; \
209202
} \
210203
} while(0);
211204

0 commit comments

Comments
 (0)