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

Commit 4de4cfe

Browse files
bosilcaRalph Castain
authored andcommitted
Don't overwrite the function argument.
In a MPMD setup the app in the jdata can be NULL, so make sure we don't leave the main argument to an inconsistent value. (cherry picked from commit open-mpi/ompi@50b3775)
1 parent a7e27ef commit 4de4cfe

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

orte/mca/schizo/ompi/schizo_ompi.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ static int setup_fork(orte_job_t *jdata,
281281
char **envcpy, **nps, **firstranks;
282282
char *npstring, *firstrankstring;
283283
char *num_app_ctx;
284+
orte_app_context_t* tmp_app;
284285

285286
/* see if the mapper thinks we are oversubscribed */
286287
oversubscribed = false;
@@ -471,11 +472,11 @@ static int setup_fork(orte_job_t *jdata,
471472
nps = NULL;
472473
firstranks = NULL;
473474
for (i=0; i < jdata->apps->size; i++) {
474-
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
475+
if (NULL == (tmp_app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
475476
continue;
476477
}
477-
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(app->num_procs));
478-
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(app->first_rank));
478+
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(tmp_app->num_procs));
479+
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(tmp_app->first_rank));
479480
}
480481
npstring = opal_argv_join(nps, ' ');
481482
firstrankstring = opal_argv_join(firstranks, ' ');

0 commit comments

Comments
 (0)