Common Slurm Commands
Quick reference for the most common Slurm commands on the TAU HPC cluster.
Submitting Jobs
| Command |
Description |
sbatch job.sh |
Submit a batch job script |
srun --pty bash |
Start an interactive session |
sbatch --depend=afterok:JOBID job.sh |
Submit job after another completes |
Monitoring Jobs
| Command |
Description |
squeue -u username |
Your running and pending jobs |
squeue |
All jobs on the cluster |
scontrol show job JOBID |
Full details of a job |
sacct -j JOBID --format=JobID,JobName,State,MaxRSS,Elapsed |
Job accounting and memory usage |
sattach JOBID |
Attach to a running job's output |
Managing Jobs
| Command |
Description |
scancel JOBID |
Cancel a specific job |
scancel -u username |
Cancel all your jobs |
| Command |
Description |
sinfo |
Partition and node status |
scontrol show partition PARTITION |
Partition details and limits |
check_my_partitions |
Your available partitions and accounts |
features |
Available node constraints/features |
Environment Modules
| Command |
Description |
module avail |
List all available modules |
module avail NAME |
Search for a specific module |
module spider NAME |
Detailed module info including dependencies |
module load NAME |
Load a module |
module list |
List loaded modules |
module unload NAME |
Unload a module |
module purge |
Unload all modules |
Common SBATCH Directives
| Directive |
Description |
#SBATCH --job-name=NAME |
Job name |
#SBATCH --account=ACCOUNT |
Account name |
#SBATCH --partition=PARTITION |
Partition/queue |
#SBATCH --qos=QOS |
Quality of Service |
#SBATCH --time=HH:MM:SS |
Max run time |
#SBATCH --ntasks=N |
Number of tasks |
#SBATCH --nodes=N |
Number of nodes |
#SBATCH --cpus-per-task=N |
CPU cores per task |
#SBATCH --mem-per-cpu=NG |
Memory per CPU |
#SBATCH --mem=NG |
Total memory |
#SBATCH --gres=gpu:N |
Number of GPUs |
#SBATCH --constraint=FEATURE |
Node constraint/feature |
#SBATCH --array=1-N |
Job array |
#SBATCH --output=FILE_%j.out |
Output file (%j = job ID) |
#SBATCH --error=FILE_%j.err |
Error file |
#SBATCH --mail-user=EMAIL |
Notification email |
#SBATCH --mail-type=END,FAIL |
When to notify |