Slurm Examples

Note: you need to sign into the Psychology cluster (neurocomp0) to run the following commands.

Note: we’ll add more examples and adjust fairness rules after we add more resources to the “new” cluster.

For SGE users, please have a quick look at SGE to SLURM conversion.

The following examples are for running interactive jobs.

1) Check cluster status


2) Check queue info


3) Run a job (for example, get the host name of the compute node when the job runs)

srun -N 1 -c 1 hostname

4) Cancel a job

scancel JobID

5) Attach to a job step (for debugging)

sattach JobID.StepID

6) Start an interactive section on the “cpu” partition without X / GUI

srun -N 1 -p cpu -c 8 --pty bash -i

7) Start an interactive section on the “cpu” partition with X / GUI (make sure your terminal is an X terminal, otherwise, you’ll get an error message: srun: error: No DISPLAY variable set, cannot setup x11 forwarding.)

srun -N 1 -c 8 -p cpu --x11 --pty bash -i