Files
werewulf/mpi/heat-long.sbatch
ilker f29e8785ef Add a long-running MPI benchmark
mpi-ring finishes in about two seconds, so there is nothing to observe in
squeue, no meaningful sacct record and no load on the nodes.

heat_mpi solves 2D steady-state heat diffusion by Jacobi iteration over a
grid split into horizontal strips, one per rank. Every iteration performs a
five-point stencil, a halo exchange with the neighbouring ranks via
MPI_Sendrecv, and an MPI_Allreduce for the global residual - so it exercises
compute and both point-to-point and collective communication rather than just
starting up and exiting.

It runs to a wall-clock budget (-m minutes) instead of a fixed iteration
count, which is what makes it useful for watching the scheduler. Stopping is
collective: rank 0 decides and broadcasts, so every rank leaves on the same
iteration. The residual falls monotonically, which doubles as a check that the
halo exchange is correct.

Measured on this cluster: 6144 grid, 8 ranks over 4 nodes, ~12 GFLOP/s with
all nodes at ~95% CPU and ~72 MiB per rank.

heat-long.sbatch defaults to 20 minutes and takes GRID, MINUTES and REPORT
through --export.
2026-08-31 10:35:56 +02:00

40 lines
1.1 KiB
Bash

#!/bin/bash
# Long-running MPI job: 2D heat diffusion, whole cluster, ~20 minutes.
#
# Unlike mpi-ring.sbatch (which finishes in about two seconds) this gives you
# something to watch: squeue while it runs, sacct/sreport afterwards, and real
# load on the nodes.
#
# sbatch heat-long.sbatch # ~20 min on 4 nodes / 8 ranks
# sbatch --export=MINUTES=60 heat-long.sbatch
#
#SBATCH --job-name=heat-long
#SBATCH --partition=normal
#SBATCH --nodes=4
#SBATCH --ntasks-per-node=2
#SBATCH --time=02:00:00
#SBATCH --output=/home/hpcuser/heat-long-%j.out
# gnu14 + openmpi5 come from the "ohpc" default module set, but load them
# explicitly so the job does not depend on the login environment.
module purge
module load gnu14 openmpi5
GRID=${GRID:-6144}
MINUTES=${MINUTES:-20}
REPORT=${REPORT:-500}
echo "=== Slurm ==="
echo "Job : $SLURM_JOB_ID"
echo "Nodes : $SLURM_JOB_NODELIST"
echo "Tasks : $SLURM_NTASKS"
echo "Grid : ${GRID} x ${GRID}"
echo "Budget : ${MINUTES} min"
echo "Started : $(date -Is)"
echo
srun --mpi=pmix /home/hpcuser/heat_mpi -n "${GRID}" -m "${MINUTES}" -r "${REPORT}"
echo
echo "Finished : $(date -Is)"