Search code examples
slurm

In slurm.conf when you set Feature for a node, then SLURM_JOB_CONSTRAINTS becomes the corresponding env variable?


in slurm.conf I have

NodeName=node1 Gres=gpu:a100:2 CPUs=60 ... Feature=hpcki

I'm starting with my prolog script. So by default the variable SLURM_JOB_CONSTRAINTS is "hpcki"? That's what it means when slurm says: "SLURM_JOB_CONSTRAINTS Features required to run the job. Available in Prolog, PrologSlurmctld, Epilog and EpilogSlurmctld."

Or what is SLURM_JOB_CONSTRAINTS Thanks


Solution

  • The SLURM_JOB_CONSTRAINTS variable is set by Slurm in the environment of the prolog/epilog scripts of the job based on the value of the parameter --constraints of that job (that parameter can be set from the command line, in the submission script, or from the SBATCH_CONSTRAINT input environment variable set by the user).

    That variable is there to let the prolog/epilog script know of the characteristics of the job so that you can take action if needed.

    As for the Feature=hpcki part of the definition of the node in the configuration file, it is there to allow users to set --constraint=hpcki to submit their job specifically to that node or any other that shares the same feature. That parameter is not mandatory, and if none is specify, the features of the nodes are simply ignored in the allocation of the nodes to the jobs.