stepup.queue.api¶
StepUp Queue API functions to build workflows.
sbatch(workdir, *, ext='.sh', rc=None, inp=(), env=(), out=(), vol=(), optional=False, pool=None, block=False)
¶
Submit a SLURM job script.
The following filename conventions are used in the given working directory:
slurmjob{ext}
is the job script to be submitted.slurmjob.log
is StepUp Queue’s log file keeping track of the job’s status.slurmjob.out
is the job’s output file (written by SLURM).slurmjob.err
is the job’s error file (written by SLURM).slurmjob.ret
is the job’s return code (written by a wrapper script).
Hence, you can only have one job script per working directory, and it is strongly recommended to use meaningful directory names. Within the directory, try to use as much as possible exactly the same file names for all jobs.
When the step is executed, it will submit the job or skip this if it was done before. If submitted, the step will wait until the job is finished. If already finished, the step will essentially be a no-op.
See step()
documentation in StepUp Core for all optional arguments.
and the return value.
Parameters:
-
ext
(str
, default:'.sh'
) –The filename extension of the jobscript. The full name is
f"slurmjob{ext}"
. Extensions.log
,.out
,.err
and.ret
are not allowed. -
rc
(str | None
, default:None
) –A resource configuration to be executed before calling sbatch. This will be executed in the same shell, right before the sbatch command. For example, you can run
module swap cluster/something
or prepare other resources. If multiple instructions are needed, put them in a file, e.g.rc.sh
and pass it here assource rc.sh
. In this case, you usually also want to includerc.sh
in theinp
list.