SLURM Reference Manual for HP XC System Software

SRUN Run-Mode Options
For a strategic comparison (with examples) of the ve different ways to use SRUN, see "SRUN Roles
and Modes," above. (page 17) This section explains the mutually exclusive SRUN options that enable its
different run modes. Each option has a one-character (UNIX) and a longer (Linux) alternative syntax.
-b (--batch) runs a script (whose name appears at the end of the SRUN execute line, not as an
argument to -b) in batch mode. You cannot use -b with -A or -a.
RESULT.
SRUN copies the script, submits the request to run (with your specied resource
allocation) to the local SLURM-managed job queue, and ends. When resources become
available and no higher priority job is pending, SLURM runs the script on the rst
node allocated to the job, with STDIN redirected from /dev/null and STDOUT and
STDERR redirected to a le called jobname.out in the current working directory
(unless you request a different name or a more elaborate set of output les by using
-J or -o). In other words, -b executes the script through a queue, unhooked from
terminal interaction, but not under LCRM control.
SCRIPT REQUIREMENTS.
(1) You must use the script's absolute pathname or a pathname relative to the current
working directory (SRUN ignores your search path).
(2) SRUN interprets the script using your default shell unless the le begins with the
character pair #! followed by the absolute pathname of a valid shell.
(3) The script must contain MPI commands or other (simple) SRUN commands to
initiate parallel tasks. On BlueGene/L only, the script must invoke MPIRUN rather
than simple SRUN to execute parallel tasks (this may affect script portability).
(4) Script lines prexed with #SLURM insert SRUN options into the script (e.g.,
#SLURM --propagate); command line options override those within the script.
-A (uppercase, --allocate)
allocates compute resources (as specied by other SRUN options) and starts ("spawns")
a subshell that has access to those allocated resources. No remote tasks are started.
You cannot use -A with -b or -a. If you combine -A with the special-purpose option
--no-shell, then SRUN allocates the resources but exits instead of spawning a shell.
SCRIPTED USE.
If you specify a script at the end of SRUN's execute line (not as an argument to -A),
the spawned shell executes that script using the allocated resouces (interactively,
without a queue). See the -b option for script requirements.
UNSCRIPTED USE.
If you specify no script, you can then execute other instances of SRUN interactively,
within the spawned subshell, to run multiple parallel jobs on the resources that you
allocated to the subshell. The resources (nodes, etc.) will only be freed for other jobs
when you terminate the subshell.
SLURM Reference Manual - 20