[slurm-users] Can I define and use custom env vars in slurm.conf?

Brian Andrus toomuchit at gmail.com
Mon Apr 4 20:15:39 UTC 2022

I think you are looking at nodesets:

 From the slurm.conf man:

     The nodeset configuration allows you to define a name for a 
specific set of nodes which can be used to simplify the partition 
configuration section, especially for heterogenous or condo-style 
systems. Each nodeset may be defined by an explicit list of nodes, 
and/or by filtering the nodes by a particular configured feature. If 
both Feature= and Nodes= are used the nodeset shall be the union of the 
two subsets. Note that the nodesets are only used to simplify the 
partition definitions at present, and are not usable outside of the 
partition configuration.
     All nodes with this single feature will be included as part of this 
     List of nodes in this set.
     Unique name for a set of nodes. Must not overlap with any NodeName 

Brian Andrus

On 4/4/2022 1:08 PM, David Henkemeyer wrote:
> If I have a large number of heterogeneously named nodes in my cluster, 
> and several partitions that include the same large subset of those 
> nodes, I would love to be able to define an env var, and reference 
> that in each partition specification.  For instance, say we have the 
> following:
> PartitionName=hipri 
>  Nodes=node1,node2,node3,foo1,foo2,bar1,bar3,linux1,linux2,ganymede1,jupiter1,mars1 Default=YES 
> MaxTime=INFINITE State=UP PriorityJobFactor=10000
> PartitionName=lopri 
>  Nodes=node1,node2,node3,foo1,foo2,bar1,bar3,linux1,linux2,ganymede1,jupiter1,mars1 
> MaxTime=INFINITE State=UP
> PartitionName=interactive 
> Nodes=node1,node2,node3,foo1,foo2,bar1,bar3,linux1,linux2,ganymede1,jupiter1,mars1 
> MaxTime=INFINITE State=UP PriorityJobFactor=20000
> PartitionName=perf Nodes=perf_node1,perf_node2,snoopy,linus,sally 
> MaxTime=INFINITE State=UP PriorityJobFactor=20000
> <etc>
> I would love to be able to say something like:
> NODEPOOL1=node1,node2,node3,foo1,foo2,bar1,bar3,linux1,linux2,ganymede1,jupiter1,mars1
> PERFNODES=perf_node1,perf_node2,snoopy,linus,sally
> PartitionName=hipri  Nodes=$NODEPOOL1 MaxTime=INFINITE 
> Default=YESState=UP PriorityJobFactor=10000
> PartitionName=lopri  Nodes=$NODEPOOL1 MaxTime=INFINITE State=UP
> PartitionName=interactive Nodes=$NODEPOOL1 MaxTime=INFINITE 
> State=UP PriorityJobFactor=20000
> PartitionName=perf Nodes=$PERFNODES MaxTime=INFINITE 
> State=UP PriorityJobFactor=20000
> Is this possible?
> Thanks,
> David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20220404/dbd8e1af/attachment.htm>

More information about the slurm-users mailing list