diff --git a/orte/mca/odls/base/odls_base_default_fns.c b/orte/mca/odls/base/odls_base_default_fns.c index bcc5feed63..102966c28e 100644 --- a/orte/mca/odls/base/odls_base_default_fns.c +++ b/orte/mca/odls/base/odls_base_default_fns.c @@ -1023,13 +1023,9 @@ int orte_odls_base_default_launch_local(orte_jobid_t job, item != opal_list_get_end(&orte_local_children); item = opal_list_get_next(item)) { child = (orte_odls_child_t*)item; - if (OPAL_EQUAL == opal_dss.compare(&job, &(child->name->jobid), ORTE_JOBID)) { - if (i == child->app_idx) { - child->exit_code = rc; - } else { - child->state = ORTE_PROC_STATE_UNDEF; - child->exit_code = 0; - } + if (OPAL_EQUAL == opal_dss.compare(&job, &(child->name->jobid), ORTE_JOBID) && + i == child->app_idx) { + child->exit_code = rc; } } /* okay, now tell the HNP we couldn't do it */ @@ -1096,7 +1092,17 @@ int orte_odls_base_default_launch_local(orte_jobid_t job, if (NULL != mpiexec_pathenv) { opal_argv_free(argvptr); } - child->exit_code = rc; + /* cycle through children to find those for this jobid */ + for (item = opal_list_get_first(&orte_local_children); + item != opal_list_get_end(&orte_local_children); + item = opal_list_get_next(item)) { + child = (orte_odls_child_t*)item; + if (OPAL_EQUAL == opal_dss.compare(&job, &(child->name->jobid), ORTE_JOBID) && + i == child->app_idx) { + child->exit_code = rc; + } + } + /* okay, now tell the HNP we couldn't do it */ goto CLEANUP; } if (NULL != mpiexec_pathenv) {