Skip to content

Commit 86940f4

Browse files
committed
This change fixes the misleading error message from mpiexec wtih missing #! interpreter (#4528). I added a conditional to check whether the file exists, which determines whether to ouput the default error string (missing file) or a new string (bad interpreter).
Signed-off-by: Maxwell Coil <[email protected]>
1 parent 7e07346 commit 86940f4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

orte/mca/odls/default/odls_default_module.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,10 +454,17 @@ static int do_child(orte_odls_spawn_caddy_t *cd, int write_fd)
454454

455455
/* Exec the new executable */
456456
execve(cd->cmd, cd->argv, cd->env);
457+
struct stat stats;
457458
getcwd(dir, sizeof(dir));
458-
send_error_show_help(write_fd, 1,
459+
if(0 == stat(cd->app->app, &stats)) {
460+
send_error_show_help(write_fd, 1, "help-orte-odls-default.txt",
461+
"execve error", orte_process_info.nodename, dir,
462+
cd->app->app, "Bad interpreter");
463+
} else {
464+
send_error_show_help(write_fd, 1,
459465
"help-orte-odls-default.txt", "execve error",
460466
orte_process_info.nodename, dir, cd->app->app, strerror(errno));
467+
}
461468
/* Does not return */
462469
}
463470

0 commit comments

Comments
 (0)