Ticket 12344

Summary: information request: select multiple nodes from different groups
Product: Slurm Reporter: Michael Hebenstreit <michael.hebenstreit>
Component: User CommandsAssignee: Dominik Bartkiewicz <bart>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 20.11.7   
Hardware: Linux   
OS: Linux   
See Also: https://bugs.schedmd.com/show_bug.cgi?id=8019
Site: Intel CRT Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Michael Hebenstreit 2021-08-24 08:18:12 MDT
imagine I have groups of nodes with different constraints

node1 constraint1
node2 constraint1
node3 constraint1
node4 constraint1
node5 constraint1

node6 constraint2
node7 constraint2
node8 constraint2
node9 constraint2
node0 constraint2

I want to get either 2 nodes from constraint1 or 2 nodes from constraint2 - but not any mixture of constraint1/constraint2. I tried:

$ srun --pty --exclusive  -N 2 -C "[constraint1*2|constraint2*2]" -t 20 -p adminq /bin/bash

but that lead to the error: 
srun: error: Unable to allocate resources: Requested node configuration is not available
Comment 1 Dominik Bartkiewicz 2021-08-25 03:40:06 MDT
Hi

Same as in bug 12295, this is not a valid constraint expression, and such job should be rejected.

It would be best if you used "Matching OR" syntax eg.:
$ srun --pty --exclusive  -N 2 -C "[constraint1|constraint2]" -t 20 -p adminq /bin/bash

srun man:
...
              Matching OR
                     If  only  one  of a set of possible options should be used for all allocated
                     nodes, then use the OR operator and enclose the options within square brack‐
                     ets.  For example, --constraint="[rack1|rack2|rack3|rack4]" might be used to
                     specify that all nodes must be allocated on a single rack  of  the  cluster,
                     but any of those four racks can be used.

...

Dominik
Comment 2 Michael Hebenstreit 2021-08-25 08:45:26 MDT
thanks, that seems to work, you can close the issue