Skip to content

Commit 35c2c10

Browse files
authored
Merge pull request #5730 from grondo/issue#5723
shell: generate fatal error if `block` taskmap scheme has an argument
2 parents 5fe073b + 9161029 commit 35c2c10

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-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,

t/t2616-job-shell-taskmap.t

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ test_expect_success 'taskmap is unchanged with --taskmap=block' '
8484
| jq -e ".context.taskmap.map == [[0,4,4,1]]" &&
8585
test_check_taskmap $id
8686
'
87+
test_expect_success 'shell dies with --taskmap=block:oops' '
88+
test_must_fail_or_be_terminated flux run -N4 --tasks-per-node=4 \
89+
--taskmap=block:oops ./map.sh
90+
'
8791
test_expect_success 'taskmap is correct for --tasks-per-node=2' '
8892
id=$(flux submit -N4 --tasks-per-node=2 ./map.sh) &&
8993
flux job wait-event -p guest.exec.eventlog -f json $id shell.start &&

0 commit comments

Comments
 (0)