Skip to content

Commit 43937a5

Browse files
authored
Merge pull request #2241 from rhc54/cmr2.x/badapp
Properly report failure to launch when someone mis-types the name of the application
2 parents 5dd19e4 + dab96cc commit 43937a5

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

orte/mca/state/orted/state_orted.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Copyright (c) 2011-2012 Los Alamos National Security, LLC.
33
* All rights reserved.
4-
* Copyright (c) 2014 Intel, Inc. All rights reserved.
4+
* Copyright (c) 2014-2016 Intel, Inc. All rights reserved.
55
* $COPYRIGHT$
66
*
77
* Additional copyrights may follow
@@ -129,7 +129,7 @@ static int init(void)
129129
}
130130
}
131131
if (5 < opal_output_get_verbosity(orte_state_base_framework.framework_output)) {
132-
orte_state_base_print_proc_state_machine();
132+
orte_state_base_print_proc_state_machine();
133133
}
134134
return ORTE_SUCCESS;
135135
}
@@ -199,11 +199,20 @@ static void track_jobs(int fd, short argc, void *cbdata)
199199
OBJ_RELEASE(alert);
200200
goto cleanup;
201201
}
202-
/* pack the RUNNING state */
203-
if (ORTE_SUCCESS != (rc = opal_dss.pack(alert, &running, 1, ORTE_PROC_STATE))) {
204-
ORTE_ERROR_LOG(rc);
205-
OBJ_RELEASE(alert);
206-
goto cleanup;
202+
/* if this proc failed to start, then send that info */
203+
if (ORTE_PROC_STATE_UNTERMINATED < child->state) {
204+
if (ORTE_SUCCESS != (rc = opal_dss.pack(alert, &child->state, 1, ORTE_PROC_STATE))) {
205+
ORTE_ERROR_LOG(rc);
206+
OBJ_RELEASE(alert);
207+
goto cleanup;
208+
}
209+
} else {
210+
/* pack the RUNNING state to avoid any race conditions */
211+
if (ORTE_SUCCESS != (rc = opal_dss.pack(alert, &running, 1, ORTE_PROC_STATE))) {
212+
ORTE_ERROR_LOG(rc);
213+
OBJ_RELEASE(alert);
214+
goto cleanup;
215+
}
207216
}
208217
/* pack its exit code */
209218
if (ORTE_SUCCESS != (rc = opal_dss.pack(alert, &child->exit_code, 1, ORTE_EXIT_CODE))) {

0 commit comments

Comments
 (0)