Skip to content

Writing a SLURM Script

Example SLURM Script

#!/bin/bash
#SBATCH -N 1 (1)
#SBATCH -n 8 (2)
#SBATCH --mem=8g (3)
#SBATCH -J "Example Job" (4)
#SBATCH -p short (5)
#SBATCH -t 12:00:00 (6)
#SBATCH --gres=gpu:2 (7)
#SBATCH -C A100|V100 (8)

module load python # (9)!

python my_script_name.py # (10)!
  1. Request 1 node for the job
  2. Request 8 CPU cores
  3. Request 8 GiB of memory
  4. Use Example Job as the job title
  5. Use the short partition
  6. Set the maximum time for the job to run. If the job has not completed after this timeout, the job will be killed.
  7. Request 2 GPUs
  8. Limit GPUs to the A100 or V100 types.
  9. Load the latest stable version of the python module. For more information, see Software.
  10. Run your script here.