29  Slurm integration

Run Wake CFD as a cluster batch job

Wake CFD CLI passes case input to an executable, so under Slurm it runs as a batch job like any MPI program. The job script, mesh, input files, and output paths must be accessible from compute nodes. On a typical cluster, the submission directory is on shared storage and can be used directly.

29.1 Basic job script

The example below is a minimal template for a 3D case using four MPI ranks. Adjust partition, time limit, account, and module names for your cluster policy.

#!/bin/bash
#SBATCH --job-name=wake-wing
#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --time=02:00:00
#SBATCH --output=logs/%x-%j.out
#SBATCH --error=logs/%x-%j.err

set -euo pipefail

cd "$SLURM_SUBMIT_DIR"
mkdir -p logs results

# Load cluster MPI and compiler modules if needed.
# module load mpi

srun ./wake_3d_mixed.exe case.jsonc

Save the file as wake.slurm, then submit it.

sbatch wake.slurm
squeue --me

29.2 Working directory

Meshes, case.jsonc, base input files referenced by $extends, and restart files must all be readable at the same paths on compute nodes. Writing output to the submission directory or a shared results path lets you post-process it directly from a login node. For clusters using node-local scratch, add steps to copy input at job start and return results to shared storage before it ends.

29.3 Next steps

  • For executable and input-file basics, see Running Wake CFD.
  • Add GPU, MPI-launcher, and CPU-binding settings to the job script after reviewing cluster policy and the supported scope of the Wake CFD distribution.
  • Automate parameter sweeps by combining Slurm job arrays with the Python API.