Job Scheduling with Slurm
Slurm is the scheduler that shares Sagehen fairly among everyone’s work. You describe what your job needs; Slurm finds the resources, runs it, and tells you when it’s done.
How it works
1. Describe your job
A short script says how many cores, how much memory, and how long your job needs, then runs your program.
2. Submit it
One command (sbatch) hands the script to Slurm, which queues it and starts it as soon as resources free up. Log out; it keeps running.
3. Collect results
Output lands in files in your directory, and Slurm can email you when the job finishes. Jobs can run up to 30 days.
Your first job script
Save as myjob.sh, then submit with sbatch myjob.sh.
#!/bin/bash #SBATCH --job-name=my-analysis #SBATCH --partition=amd #SBATCH --cpus-per-task=8 #SBATCH --mem=32G #SBATCH --time=24:00:00 #SBATCH --mail-type=END module load python python analyze.py
Useful commands
squeue shows the queue and your running jobs, scancel stops a job, and sinfo shows what’s available.
Partitions
Use amd for CPU work and gpu for GPU jobs, adding --gres=gpu:1 to request a GPU.
Prefer not to script?
The OnDemand portal submits many kinds of jobs from your browser with a form instead of a script.
Remember: anything your job writes to /scratch is deleted when the job completes. Make copying results back to your lab storage the last line of every job script. Details on Storage and Research Data.
Learn it in an afternoon
Our SLURM Job Scheduling workshop takes you from zero to submitting real jobs, and the full guide lives in our documentation.
Last reviewed: August 2026