Quick Reference
Last updated on 2026-08-27 | Edit this page
Quick Reference Card: SLURM Commands on Sagehen HPC
This is a handy cheat sheet for common SLURM commands. Print it out or bookmark it!
Connection and Setup
Cluster Information
Submitting Jobs
BASH
# Interactive job (bash shell on compute node)
srun -c 4 --mem=16G -t 00:30:00 -p amd --pty bash -l
# Interactive job with GPU
srun --gres=gpu:a100:1 -c 8 --mem=64G -t 02:00:00 -p gpu --pty bash -l
# Submit batch script
sbatch myscript.sh
# Submit with inline parameters
sbatch --cpus-per-task=8 --mem=32G myscript.sh
Monitoring Jobs
BASH
# View your running/pending jobs
squeue -u $USER
# View specific job
squeue -j 12345
# View jobs in amd partition
squeue -p amd
# Watch queue updates every 2 seconds
watch -n 2 squeue -u $USER
# Show more detail (CPU, memory, time limit)
squeue -u $USER --format=jobid,name,cpus,mem,timelimit,state
Job Management
Job History and Analysis
BASH
# View completed jobs (last several)
sacct -u $USER
# View specific job details
sacct -j 12345
# View job efficiency (resource usage)
seff 12345
# Show memory usage
seff 12345 | grep Memory
# View all jobs since yesterday
sacct -u $USER --starttime=2026-03-04
# Export to CSV
sacct -u $USER --format=jobid,jobname,state,elapsed --delimiter=,
Common SLURM Directives (for batch scripts)
BASH
#!/bin/bash -l
#SBATCH --job-name=myjob # Job name
#SBATCH --partition=amd # amd, gpu, or short
#SBATCH --cpus-per-task=4 # CPU cores
#SBATCH --mem=16G # RAM (per node)
#SBATCH --time=01:30:00 # Max time (HH:MM:SS)
#SBATCH --nodes=1 # Number of nodes
#SBATCH --output=job_%j.out # Output file (%j=job ID)
#SBATCH --error=job_%j.err # Error file
#SBATCH --gres=gpu:a100:1 # GPUs (type:count)
#SBATCH --mail-user=you@pomona.edu # Email address
#SBATCH --mail-type=END # Email on END, FAIL, BEGIN, ALL
#SBATCH --qos=normal # Quality of service
#SBATCH --array=1-10 # Job array (10 jobs)
Resource Request Examples
BASH
# Small quick job (1 core, 1 hour)
-c 1 --mem=4G -t 01:00:00 -p short
# Medium CPU job (8 cores, 4 hours)
-c 8 --mem=32G -t 04:00:00 -p amd
# Large CPU job (32 cores, 24 hours)
-c 32 --mem=256G -t 24:00:00 -p amd
# Single GPU job
--gres=gpu:a100:1 -c 8 --mem=64G -t 12:00:00 -p gpu
# Multi-GPU job
--gres=gpu:2 -c 16 --mem=128G -t 12:00:00 -p gpu
Environment Variables in Jobs
Inside a batch script or interactive session, these are automatically set:
BASH
$SLURM_JOB_ID # Job ID number
$SLURM_JOB_NAME # Job name
$SLURM_ARRAY_TASK_ID # Task ID (for job arrays)
$SLURM_CPUS_PER_TASK # Number of CPUs allocated
$SLURM_MEM # RAM allocated (MB)
$SLURM_JOB_USER # Your username
$SLURM_TMPDIR # Scratch directory path
Example usage:
Partition Quick Reference
amd: see `sinfo -p amd` for current configuration; 30-day max job time
gpu: 10 GPUs across multiple nodes (4× A100, 4× L40S, 2× RTX PRO 6000), 30-day limit (see Workshop 16 for full hardware breakdown)
short: see `sinfo -p short` for current configuration; shorter max walltime (good for quick test/debug jobs and rapid prototyping)
Storage Paths
BASH
/rhome/$USER # Home directory; /rhome and /bigdata share a single 1 TB lab quota on BeeGFS (check usage with quota_check.sh)
/bigdata/lab/<labname> # Lab shared storage; shared 1 TB quota with /rhome
/scratch/$USER/$JOBID # Fast job scratch (auto-deleted when job completes)
/tmpfs/$USER/$JOBID # RAM-based temp (auto-deleted when job completes)
Module Commands
Monitoring While Running
Common Time Formats
Quick Diagnostics
BASH
# Why is my job pending?
squeue -j 12345 -O jobid,reason
# How much time did my job use?
seff 12345 | grep "Wall-clock"
# Did my job run out of memory?
seff 12345 | grep Memory
# When did my job finish?
sacct -j 12345 --format=end
# How many cores is my group using?
squeue -t RUNNING | awk '{cores+=$7} END {print cores}'
Common Errors and Quick Fixes
| Error | Cause | Fix |
|---|---|---|
| “Job submit/cancel time limit exceeded” | Group quota exceeded | Wait for jobs to finish |
| “sbatch: error: job_script: No such file or directory” | Script doesn’t exist | Check file path and name |
| “Killed” in output | Out of memory | Increase --mem=, reduce batch size |
| ExitCode 138 (TIMEOUT) | Time limit exceeded | Increase -t flag |
| “CUDA error” | GPU not requested | Add --gres=gpu:1
|
| Pending for hours | No resources available | Reduce resource request or try later |
Escape Hatch: Check Everything
Getting Help
Batch Script Template
BASH
#!/bin/bash -l
#SBATCH --job-name=myanalysis
#SBATCH --partition=amd
#SBATCH --cpus-per-task=4
#SBATCH --mem=16G
#SBATCH --time=02:00:00
#SBATCH --output=job_%j.out
#SBATCH --mail-user=you@pomona.edu
#SBATCH --mail-type=END,FAIL
# Load environment
module load miniconda3
# Your code here
python analysis.py
Save as job.sh and submit with:
sbatch job.sh
Last Updated: March 2026 For more details: See the full workshop episodes