diff --git a/src/common/proc_args.c b/src/common/proc_args.c index cbdd572a57f10985b654d9f39b3804cb1f097b61..450db18109a419dbc11f953d626a5c552b60e494 100644 --- a/src/common/proc_args.c +++ b/src/common/proc_args.c @@ -795,8 +795,19 @@ search_path(char *cwd, char *cmd, bool check_current_dir, int access_mode) ListIterator i = NULL; char *path, *fullpath = NULL; +#if defined HAVE_BG && !defined HAVE_BG_L_P + /* BGQ's runjob command required a fully qualified path */ + if ( (cmd[0] == '.' || cmd[0] == '/') && + (access(cmd, access_mode) == 0 ) ) { + if (cmd[0] == '.') + xstrfmtcat(fullpath, "%s/", cwd); + xstrcat(fullpath, cmd); + goto done; + } +#else if ((cmd[0] == '.') || (cmd[0] == '/')) return NULL; +#endif l = _create_path_list(); if (l == NULL) diff --git a/src/srun/libsrun/opt.c b/src/srun/libsrun/opt.c index 7e4b73057cafb3ff92617677aad3f7f743f03b4e..e5e261aa3e456d33485f87d76a57bc8da39e43c0 100644 --- a/src/srun/libsrun/opt.c +++ b/src/srun/libsrun/opt.c @@ -1780,7 +1780,23 @@ static void _opt_args(int argc, char **argv) } opt.argv[i] = NULL; /* End of argv's (for possible execv) */ +#if defined HAVE_BG && !defined HAVE_BG_L_P + /* BGQ's runjob command required a fully qualified path */ + if (!launch_g_handle_multi_prog_verify(command_pos) && + (opt.argc > command_pos)) { + char *fullpath; + + if ((fullpath = search_path(opt.cwd, + opt.argv[command_pos], + false, X_OK))) { + xfree(opt.argv[command_pos]); + opt.argv[command_pos] = fullpath; + } + } +#else (void) launch_g_handle_multi_prog_verify(command_pos); +#endif + #if 0 for (i=0; i<opt.argc; i++) info("%d is '%s'", i, opt.argv[i]);