Skip to main content

salloc

Overview

salloc is the command in Slurm for dynamically allocating resources and keeping a session:

  • First reserves resources and keeps the allocation
  • Then runs the specified command (or drops into an interactive shell if none is specified)
  • Automatically releases resources when the command/session ends

Common Options

Resource allocation options for salloc are largely the same as sbatch. See the sbatch options section in the documentation; for more options, use the salloc --help command.

Examples

Allocate 48 cores across three machines, reserve 716800M (700G) memory per machine, and run the my_job.sh script.

salloc -n 48 -N 3 --mem 716800 my_job.sh

In the my_job.sh script, nested srun is supported. For applications that require a GUI or pseudo-terminal, you can run them with srun inside my_job.sh. Or you can run salloc [args] srun [args] application directly.