Skip to content

Commit ce49cd8

Browse files
committed
flux-mini: group allocation options in --help output
Problem: The resource allocation options in flux-mini run,submit are mixed in with other command options. Split the resource allocation options into "common" and per-task sections. This makes the resource allocation options easier to spot in the --help output, and allows for expansion of arguments in the future.
1 parent 0d036b0 commit ce49cd8

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/cmd/flux-mini.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -721,33 +721,39 @@ class SubmitBaseCmd(MiniCmd):
721721

722722
def __init__(self):
723723
super().__init__()
724-
self.parser.add_argument(
724+
group = self.parser.add_argument_group("Common resource options")
725+
group.add_argument(
725726
"-N", "--nodes", metavar="N", help="Number of nodes to allocate"
726727
)
727-
self.parser.add_argument(
728+
group.add_argument(
729+
"--exclusive",
730+
action="store_true",
731+
help="With -N, --nodes, allocate nodes exclusively",
732+
)
733+
group = self.parser.add_argument_group(
734+
"Per task options",
735+
"The following options allow per-task specification of resources, "
736+
+ "and should not be combined with per-resource options.",
737+
)
738+
group.add_argument(
728739
"-n",
729740
"--ntasks",
730741
metavar="N",
731742
help="Number of tasks to start",
732743
)
733-
self.parser.add_argument(
744+
group.add_argument(
734745
"-c",
735746
"--cores-per-task",
736747
metavar="N",
737748
default=1,
738749
help="Number of cores to allocate per task",
739750
)
740-
self.parser.add_argument(
751+
group.add_argument(
741752
"-g",
742753
"--gpus-per-task",
743754
metavar="N",
744755
help="Number of GPUs to allocate per task",
745756
)
746-
self.parser.add_argument(
747-
"--exclusive",
748-
action="store_true",
749-
help="With -N, --nodes, allocate nodes exclusively",
750-
)
751757
self.parser.add_argument(
752758
"-v",
753759
"--verbose",

0 commit comments

Comments
 (0)