Slurm SBATCH Directive Reference Sheet¶
Directive |
Purpose |
Typical values / examples |
Notes & tips |
|---|---|---|---|
|
Name the job |
|
Shows in |
|
Choose queue/partition |
|
Controls where the job can run; ask your cluster which partitions exist. |
|
Wall time limit |
|
Jobs are killed at limit; request slightly more than you expect. |
|
Number of nodes |
|
Multi-node jobs often need MPI; otherwise keep to 1. |
|
Total parallel tasks |
|
For MPI or multiple |
|
Threads per task |
|
For OpenMP/numba/BLAS-threaded codes. Set |
|
Tasks per node |
|
Helpful for multi-node placement control. |
|
Memory per node |
|
Mutually exclusive with |
|
Memory per CPU |
|
Multiplies by total CPUs allocated. Good when scaling tasks. |
|
STDOUT file |
|
|
|
STDERR file |
|
Keep separate from |
|
Set working dir |
|
Equivalent to |
|
Email on events |
|
Other options: |
|
Email recipient |
|
Must be a valid address; some clusters default to your account email. |
|
Charge account |
|
Required on centers with allocations. |
|
Quality of service |
|
Affects limits/priority if your site uses QoS. |
|
Job arrays |
|
|
|
Job dependencies |
|
Variants: |
|
Generic resources (GPUs) |
|
Cluster-specific (e.g., |
|
Node features |
|
Matches nodes with given features (labels vary by site). |
|
Exclusive node use |
|
You get the whole node(s); don’t combine with small |
|
SMT/NUMA hint |
|
May improve performance by disabling hyper-threads. |
|
Env var export |
|
|
|
Send signal before kill |
|
Send |
|
Requeue on preempt/fail |
|
Needs |
|
Output file mode |
|
|
|
One-liner job |
|
Handy for quick tests without a script file. |
|
Use reservation |
|
For scheduled training events or maintenance windows. |
|
Perf profiling |
|
Site-dependent; may emit stats to |
|
Lower priority |
|
Useful when queue-friendly is preferred over speed. |
|
Deferred start |
|
Reserves spot to start at/after given time. |
|
Submit held |
|
Release later with |
|
Flexible runtime |
|
Lets backfill with shorter slot if full time not available. |
|
Local scratch |
|
Requests node-local tmp space (if configured). |