Skip to content

Commit 1d1f932

Browse files
garlickmergify[bot]
authored andcommitted
flux-start: allow taskmap argument
Problem: flux-start --test-pmi-clique has limited capability. If the option argument isn't one of the keywords, parse it as a taskmap. Adjust one test's expected error string.
1 parent cd21ba3 commit 1d1f932

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/cmd/flux-start.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static struct optparse_option opts[] = {
150150
{ .group = 2,
151151
.name = "test-pmi-clique",
152152
.has_arg = 1,
153-
.arginfo = "single|per-broker|none",
153+
.arginfo = "single|per-broker|none|TASKMAP",
154154
.usage = "Set PMI_process_mapping mode (default=single)", },
155155
{ .flags = OPTPARSE_OPT_HIDDEN,
156156
.name = "killer-timeout", .has_arg = 1, .arginfo = "FSD",
@@ -741,7 +741,7 @@ void pmi_server_initialize (int flags)
741741
.debug_trace = pmi_debug_trace,
742742
};
743743
int appnum = 0;
744-
744+
flux_error_t error;
745745

746746
if (!(ctx.pmi.kvs = zhash_new ())
747747
|| !(map = taskmap_create ()))
@@ -755,8 +755,14 @@ void pmi_server_initialize (int flags)
755755
if (taskmap_append (map, 0, ctx.test_size, 1) < 0)
756756
log_err_exit ("error encoding PMI_process_mapping");
757757
}
758-
else if (!streq (mode, "none"))
759-
log_msg_exit ("unsupported test-pmi-clique mode: %s", mode);
758+
else if (streq (mode, "none")) {
759+
; // do nothing
760+
}
761+
else {
762+
taskmap_destroy (map);
763+
if (!(map = taskmap_decode (mode, &error)))
764+
log_msg_exit ("test-pmi-clique: %s", error.text);
765+
}
760766

761767
if (taskmap_nnodes (map) > 0) {
762768
char *s;

t/t0001-basic.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,7 @@ test_expect_success 'flux-start --test-pmi-clique=none works' "
293293
test_expect_success 'flux-start --test-pmi-clique=badmode fails' "
294294
test_must_fail flux start ${ARGS} --test-size=1 \
295295
--test-pmi-clique=badmode \
296-
true 2>badmode.err &&
297-
grep unsupported badmode.err
296+
true
298297
"
299298
test_expect_success 'flux-start embedded server works from initial program' "
300299
flux start -v ${ARGS} -s1 flux python ${startctl} status \

0 commit comments

Comments
 (0)