Skip to content
Snippets Groups Projects
Commit a0c6528c authored by Morris Jette's avatar Morris Jette
Browse files

BGQ runjob env setup fix

This corrects logic added in commit
738913fa
for BGQ systems only
parent 6b6b9a56
No related branches found
No related tags found
No related merge requests found
...@@ -260,6 +260,7 @@ extern int fini(void) ...@@ -260,6 +260,7 @@ extern int fini(void)
extern int launch_p_setup_srun_opt(char **rest) extern int launch_p_setup_srun_opt(char **rest)
{ {
int i;
int command_pos = 0; int command_pos = 0;
uint32_t taskid = NO_VAL; uint32_t taskid = NO_VAL;
...@@ -311,28 +312,21 @@ extern int launch_p_setup_srun_opt(char **rest) ...@@ -311,28 +312,21 @@ extern int launch_p_setup_srun_opt(char **rest)
} }
if (opt.export_env) { if (opt.export_env) {
if (!strcasecmp(opt.export_env, "NONE")) { for (i = 0; opt.export_env[i]; i++) {
/* represents the difference between --env-all if (opt.export_env[i] == ',')
* and --exp-env */ command_pos++;
command_pos += 2;
} else {
error("--export= only accepts NONE as "
"an option, ignoring '%s'.",
opt.export_env);
xfree(opt.export_env);
} }
command_pos += 5; /* baseline overhead */
} }
opt.argc += command_pos;
} }
/* We need to do +2 here just incase multi-prog is needed (we /* We need to do +2 here just incase multi-prog is needed (we
add an extra argv on so just make space for it). * add an extra argv on so just make space for it). */
*/ opt.argv = (char **) xmalloc((opt.argc + command_pos + 2) *
opt.argv = (char **) xmalloc((opt.argc + 2) * sizeof(char *)); sizeof(char *));
if (!opt.test_only) { if (!opt.test_only) {
int i = 0; i = 0;
/* First arg has to be something when sending it to the /* First arg has to be something when sending it to the
runjob api. This can be anything, we put runjob runjob api. This can be anything, we put runjob
here so --launch-cmd looks nice :), but it doesn't matter. here so --launch-cmd looks nice :), but it doesn't matter.
...@@ -432,13 +426,8 @@ extern int launch_p_setup_srun_opt(char **rest) ...@@ -432,13 +426,8 @@ extern int launch_p_setup_srun_opt(char **rest)
* job, which in this case is exactly what it is. So, very * job, which in this case is exactly what it is. So, very
* sweet. */ * sweet. */
opt.argv[i++] = xstrdup(":"); opt.argv[i++] = xstrdup(":");
command_pos = i;
/* Sanity check to make sure we set it up correctly. */ opt.argc += command_pos;
if (i != command_pos) {
fatal ("command_pos is set to %d but we are going to "
"put it at %d, please update src/srun/opt.c",
command_pos, i);
}
/* Set default job name to the executable name rather than /* Set default job name to the executable name rather than
* "runjob" */ * "runjob" */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment