START HERE if you're new to SLURM at ACCRE!
These examples use current ACCRE configuration and best practices. See https://help.accre.vanderbilt.edu/index.php?title=SLURM for more information.
If you're following along with ACCRE's SLURM training:
# 1. Clone this repo (if you haven't already)
git clone https://github.com/accre/slurm.git
cd slurm/basic-examples/
# 2. Find your account name
slurm_resources
# 3. Edit the interactive debug script
nano 00_interactive_debug.slurm
# Change "your_account_name_int" to your actual account (e.g., mygroup_int)
# 4. Submit your first job!
sbatch 00_interactive_debug.slurm
# 5. Check job status
squeue --meThese use the debug QoS - jobs start immediately! Use these for training and quick tests.
File: 00_interactive_debug.slurm
Uses interactive partition + debug_int QoS.
# Edit to add your account name with _int suffix
sbatch 00_interactive_debug.slurmOr run interactively:
srun --pty --partition=interactive --qos=debug_int \
--account=your_account_int --cpus-per-task=2 --mem=2G --time=0:30:00 bashFile: 00_gpu_debug.slurm
Uses interactive_gpu partition + debug_iacc QoS.
# Edit to add your account name with _iacc suffix
sbatch 00_gpu_debug.slurmOr run interactively:
srun --pty --partition=interactive_gpu --qos=debug_iacc \
--account=your_account_iacc --cpus-per-task=2 --mem=2G \
--gres=gpu:1 --time=0:30:00 bashThese use the batch partitions - jobs are scheduled based on fair-share.
File: 01_basic_batch.slurm
Simple CPU job for production work.
sbatch 01_basic_batch.slurmUse this for: Data processing, statistical analysis, most Python/R workloads
File: 02_basic_gpu.slurm
GPU-accelerated job for production work.
sbatch 02_basic_gpu.slurmUse this for: Machine learning training, molecular dynamics, CUDA applications
Important: Must specify GPU type! Use slurm_resources to see available GPUs.
File: 03_job_array.slurm
Run many similar jobs with one script.
sbatch 03_job_array.slurmUse this for: Parameter sweeps, processing multiple files, ensemble runs
Different partitions require different account suffixes:
| Partition | Account Suffix | QoS (for debug) | Example |
|---|---|---|---|
batch |
(none) | N/A | --account=mygroup |
interactive |
_int |
debug_int |
--account=mygroup_int |
batch_gpu |
_acc |
N/A | --account=mygroup_acc |
interactive_gpu |
_iacc |
debug_iacc |
--account=mygroup_iacc |
Find your accounts with: slurm_resources
hello_world.py- Basic test script, shows SLURM environmentmatrix_multiply.py- CPU benchmarkgpu_check.py- GPU availability checker (requires PyTorch/TensorFlow)array_task_example.py- Job array demo with parameter variation
ALL scripts using modules MUST include setup_accre_software_stack first:
setup_accre_software_stack
module load gcc/12.3 python/3.11.5Without setup_accre_software_stack, modules will NOT work!
- Default time: 30 minutes
- Max time: 14 days
- Default memory: 1 GB/core
- Max memory: 20 GB/core (jobs requesting more get extra cores automatically)
Important: At ACCRE, 1 CPU = 1 PHYSICAL CORE (not threads!)
- Documentation: https://help.accre.vanderbilt.edu
- Email: help@accre.vanderbilt.edu
- Slack: ACCRE Forum
Last Updated: January 2026