Skip to main content

srun

Overview

srun is the command in Slurm for interactive submission of parallel jobs: it returns to the terminal only after the task completes.

Use cases:

  • Applications that require a GUI
  • Programs that require terminal interaction (such as bash, dc_shell, pt_shell)

Common Options

Common srun options are similar to sbatch. See the sbatch documentation; for more options use the srun --help command.

Examples

Interactive terminal task

$ srun -c 8 --mem 10240 --pty pt_shell

Effect: Allocate 8 CPU cores and 10GB memory and run pt_shell in interactive mode

Basic parallel task

srun -p compute -c 2 hostname

Effect: Allocate 2 CPU cores in the compute partition to run the hostname command