Slurm Directive Examples

Slurm Directive Examples#

Below are some examples of SLURM directives that can be used in your batch scripts in order to meet certain job requirements.

To run a 32-core job for 24 hours on a single Alpine CPU node:#
  #SBATCH --partition=amilan
  #SBATCH --nodes=1
  #SBATCH --ntasks=32
  #SBATCH --time=24:00:00

Full Example Job Script#

Run a 1-hour job on 4 cores on an Alpine CPU node with the normal qos that runs a python script using a custom conda environment.

#!/bin/bash

#SBATCH --partition=amilan
#SBATCH --job-name=example-job
#SBATCH --output=example-job.%j.out
#SBATCH --time=01:00:00
#SBATCH --qos=normal
#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --mail-type=ALL
#SBATCH --mail-user=youridentikey@colorado.edu

module purge
module load anaconda
conda activate custom-env

python myscript.py

Alpine is jointly funded by the University of Colorado Boulder, the University of Colorado Anschutz, Colorado State University, and the National Science Foundation (award 2201538).