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.
Этот коммит содержится в:
родитель
fd93d236b1
Коммит
50b37758d4
@ -733,6 +733,7 @@ static int setup_fork(orte_job_t *jdata,
|
|||||||
char *npstring, *firstrankstring;
|
char *npstring, *firstrankstring;
|
||||||
char *num_app_ctx;
|
char *num_app_ctx;
|
||||||
bool takeus = false;
|
bool takeus = false;
|
||||||
|
orte_app_context_t* tmp_app;
|
||||||
|
|
||||||
opal_output_verbose(1, orte_schizo_base_framework.framework_output,
|
opal_output_verbose(1, orte_schizo_base_framework.framework_output,
|
||||||
"%s schizo:ompi: setup_fork",
|
"%s schizo:ompi: setup_fork",
|
||||||
@ -941,11 +942,11 @@ static int setup_fork(orte_job_t *jdata,
|
|||||||
nps = NULL;
|
nps = NULL;
|
||||||
firstranks = NULL;
|
firstranks = NULL;
|
||||||
for (i=0; i < jdata->apps->size; i++) {
|
for (i=0; i < jdata->apps->size; i++) {
|
||||||
if (NULL == (app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
if (NULL == (tmp_app = (orte_app_context_t*)opal_pointer_array_get_item(jdata->apps, i))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(app->num_procs));
|
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(tmp_app->num_procs));
|
||||||
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(app->first_rank));
|
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(tmp_app->first_rank));
|
||||||
}
|
}
|
||||||
npstring = opal_argv_join(nps, ' ');
|
npstring = opal_argv_join(nps, ' ');
|
||||||
firstrankstring = opal_argv_join(firstranks, ' ');
|
firstrankstring = opal_argv_join(firstranks, ' ');
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user