Skip to content

Commit d1dbb2f

Browse files
committed
flux-shell: abort if taskmap=block is used with a value
Problem: If --taskmap=block:foo is used, the job shell silently ignores the value 'foo'. This could lead to a job running with the wrong taskmap if the user intended some other taskmap scheme. It would be better to abort and notify the user something's wrong. Check if a value is specified with `--taskmap=block` and abort the shell if so.
1 parent 5fe073b commit d1dbb2f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/shell/shell.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1337,9 +1337,17 @@ static int shell_taskmap (flux_shell_t *shell)
13371337
shell_log_error ("failed to parse taskmap shell option");
13381338
return -1;
13391339
}
1340-
if (rc == 0
1341-
|| streq (scheme, "block"))
1340+
if (rc == 0)
13421341
return 0;
1342+
if (streq (scheme, "block")) {
1343+
/* A value is not allowed for the block taskmap scheme:
1344+
*/
1345+
if (strlen (value) > 0)
1346+
shell_die (1,
1347+
"block taskmap does not accept a value (got %s)",
1348+
value);
1349+
return 0;
1350+
}
13431351

13441352
shell_trace ("remapping tasks with scheme=%s value=%s",
13451353
scheme,

0 commit comments

Comments
 (0)