1
1

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.
Этот коммит содержится в:
George Bosilca 2016-05-19 10:35:23 -04:00
родитель fd93d236b1
Коммит 50b37758d4

Просмотреть файл

@ -733,6 +733,7 @@ static int setup_fork(orte_job_t *jdata,
char *npstring, *firstrankstring;
char *num_app_ctx;
bool takeus = false;
orte_app_context_t* tmp_app;
opal_output_verbose(1, orte_schizo_base_framework.framework_output,
"%s schizo:ompi: setup_fork",
@ -941,11 +942,11 @@ static int setup_fork(orte_job_t *jdata,
nps = NULL;
firstranks = NULL;
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;
}
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(app->num_procs));
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(app->first_rank));
opal_argv_append_nosize(&nps, ORTE_VPID_PRINT(tmp_app->num_procs));
opal_argv_append_nosize(&firstranks, ORTE_VPID_PRINT(tmp_app->first_rank));
}
npstring = opal_argv_join(nps, ' ');
firstrankstring = opal_argv_join(firstranks, ' ');