Slurm hints.
- You can run larger jobs using the sbatch utility.
- There are several queues (/partitions/ in slurm terminology). Use sinfo for options.
- Another useful command is squeue which tells what jobs are running on the machine.
Local utilities
A few slurm related scripts are available in /usr/local/bin
. These are simple wrappers for
slurm commands
- swho
- show who is using the system, how many CPUs, and who much memory (wrapper for squeue).
- sinter
run an interactive session. For example to run an interactive job with 20CPUS and 100G of memory
% sinter -c 20 --mem 100G
This is just a simple wrapper for srun
, the arguments are passed
directly to srun.
Using sbatch
The best way to run big jobs is using the batch system. That way you don't need to worry about getting disconnected, and you automatically collect the output.
The general scheme is to make a shell script with special #SBATCH
lines controlling the batch system.
- start
sbatch foo.sh
(a jobid is printed).- find my job
swho
(wrapper for squeue)- suppose you find "16097" in the JOBID column
- look
tail -f 16097.out
(this depends on the example scripts--output
line).- stop
scancel 16097
Example 1, polymake on 1 CPU
#!/bin/bash
#SBATCH -p long
#SBATCH --mem 8G
#SBATCH --cpus-per-task 1
#SBATCH --time 24:0:0
#SBATCH --output %j.out
polymake --script orbit.poly
Example 2, cplex on 32 CPUs
#!/bin/bash
#SBATCH -p long
#SBATCH --mem 32G
#SBATCH --cpus-per-task 32
#SBATCH --time 24:0:0
#SBATCH --output %j.out
cplex -c "read P1.lp" -c "opt"