Skip to content

Commit f9bbff2

Browse files
authored
Merge pull request #4549 from grondo/issue#4547
flux-mini: improve an error message and documentation for per-resource options
2 parents ff48653 + 3bb21c0 commit f9bbff2

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

doc/man1/flux-mini.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,17 @@ listed above:
116116
**--tasks-per-node=N**
117117
Set the number of tasks per node to run.
118118

119-
**--tasks-per-core=N**
120-
Force a number of tasks per core.
121-
122119
**--gpus-per-node=N**
123120
With -N, --nodes, request a specific number of GPUs per node.
124121

122+
**--tasks-per-core=N**
123+
Force a number of tasks per core. Note that this will run *N* tasks per
124+
*allocated* core. If nodes are exclusively scheduled by configuration or
125+
use of the ``--exclusive`` flag, then this option could result in many
126+
more tasks than expected. The default for this option is effectively 1,
127+
so it is useful only for oversubscribing tasks to cores for testing
128+
purposes. You probably don't want to use this option.
129+
125130
Batch job options
126131
-----------------
127132

src/bindings/python/flux/job/Jobspec.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ def per_resource(
746746
# With nnodes, nslots is slots/node (total_slots=slots*nodes)
747747
nslots = 1
748748
slot_size = 1
749+
else:
750+
raise ValueError("must specify node or core count with per_resource")
749751

750752
children = [cls._create_resource("core", slot_size)]
751753
if gpus_per_node:

t/t2700-mini-cmd.t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,12 @@ cat <<EOF >per-resource-failure.txt
358358
\
359359
--nodes=1 --tasks-per-core=1 --cores-per-task=1 \
360360
==Per-resource options.*per-task options
361+
\
362+
--tasks-per-core=1 \
363+
==must specify node or core count with per_resource
364+
\
365+
--tasks-per-node=1 \
366+
==must specify node or core count with per_resource
361367
EOF
362368

363369
while read line; do

0 commit comments

Comments
 (0)