slurm
Submits job scripts to Simple Linux Utility for Resource Management.
Uses the sbatch
command. SLURM directives can be provided in the flow.cylc
file:
[platforms]
[[slurm_platform]]
job runner = slurm
[runtime]
[[my_task]]
platform = slurm_platform
execution time limit = PT1H
[[[directives]]]
--nodes = 5
--account = QXZ5W2
Note
Cylc requires long form directives (e.g.
--begin
not-b
).Cylc requires an
=
even if the directive does not have a value (e.g.--hold=
not--hold
).If a directive does not have a value you may use the short form (e.g.
-H=
). But the directive must still be suffixed with an=
.
These are written to the top of the job script like this:
#!/bin/bash
#SBATCH --nodes=5
#SBATCH --time=60:00
#SBATCH --account=QXZ5W2
If execution time limit
is specified, it is used to generate the
--time
directive. Do not specify the --time
directive explicitly if
execution time limit
is specified. Otherwise, the execution time
limit known by the workflow may be out of sync with what is submitted to the
job runner.
Cylc supports heterogeneous Slurm jobs via special numbered directive prefixes that distinguish repeated directives from one another:
[runtime]
# run two heterogenous job components:
script = srun sleep 10 : sleep 30
[[my_task]]
execution time limit = PT1H
platform = slurm_platform
[[[directives]]]
--account = QXZ5W2
hetjob_0_--mem = 1G # first prefix must be "0"
hetjob_0_--nodes = 3
hetjob_1_--mem = 2G
hetjob_1_--nodes = 6
The resulting formatted directives are:
#!/bin/bash
#SBATCH --time=60:00
#SBATCH --account=QXZ5W2
#SBATCH --mem=1G
#SBATCH --nodes=3
#SBATCH hetjob
#SBATCH --mem=2G
#SBATCH --nodes=6
Note
For older Slurm versions with packjob instead of hetjob, use
global.cylc[platforms][<platform name>]job runner=slurm_packjob
and directive prefixes packjob_0_
etc.