This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
SLURM Job Script Generator
Goal
Generate a correct, copy-pasteable SLURM job script (.sbatch) for running a simulation, and surface common configuration mistakes (bad walltime format, conflicting memory flags, oversubscription hints).
Requirements
Python 3.8+
No external dependencies (Python standard library only)
Works on Linux, macOS, and Windows (script generation only)
Inputs to Gather
Input
Description
Example
Job name
Short identifier for the job
phasefield-strong-scaling
Walltime
SLURM time limit
00:30:00
Partition
Cluster partition/queue (if required)
compute
Account
Project/account (if required)
matsim
Nodes
Number of nodes to allocate
2
MPI tasks
Total tasks, or tasks per node
128 or 64 per node
Threads
CPUs per task (OpenMP threads)
2
Memory
--mem or --mem-per-cpu (cluster policy dependent)
32G
GPUs
GPUs per node (optional)
4
Working directory
Where the run should execute
$SLURM_SUBMIT_DIR
Modules
Environment modules to load (optional)
gcc/12, openmpi/4.1
Run command
The command to launch under SLURM
./simulate --config cfg.json
Decision Guidance
MPI vs MPI+OpenMP layout
Does the code use OpenMP / threading?
├── NO → Use MPI-only: cpus-per-task=1
└── YES → Use hybrid: set cpus-per-task = threads per MPI rank
and export OMP_NUM_THREADS = cpus-per-task
Rule of thumb: if you see diminishing strong-scaling efficiency at high MPI ranks, try fewer ranks with more threads per rank (and measure).
Memory flag selection
Use either--mem (per node) or--mem-per-cpu (per CPU), not both.
Follow your cluster’s documentation; some sites enforce one style.
SLURM --mem units are integer MB by default, or an integer with suffix K/M/G/T (and --mem=0 commonly means “all memory on node”).