Job scripts and practical tips for running ALF on HPC systems. Example scripts are provided in Scripts_and_Parameters_files/.
General Advice¶
ALF does not profit from hyper-threading. Set
--ntasks-per-core=1or equivalent.MPI parallelizes over bins. Each MPI rank runs an independent Markov chain. Use as many MPI ranks as bins (
NBin), not more.OpenMP is enabled by default for GNU and Intel builds. Set
OMP_NUM_THREADS(or--cpus-per-taskin SLURM) to control threads per rank.Thread pinning matters. Intel MPI benefits from pinning settings (see examples below). For OpenMPI, use
--bind-to core.Restarts: Use
out_to_in.shto renameconfout_*→confin_*before resubmitting. ALF detectsconfin_*and continues from the saved configuration.Tempering runs use
out_to_in_temper.shwhich loops overTemp_*/subdirectories.
Cluster-Specific Recipes¶
Fritz (NHR@FAU)¶
#!/bin/bash -l
#SBATCH --partition=<PARTITION>
#SBATCH --nodes=<Nnodes>
#SBATCH --ntasks-per-node=<NtaskPnode>
#SBATCH --cpus-per-task=<Nthreads>
#SBATCH --time=24:00:00
#SBATCH --export=NONE
unset SLURM_EXPORT_ENV
module load intel intelmpi mkl
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export KMP_AFFINITY=granularity=fine,compact
export I_MPI_PIN_CELL=core
export I_MPI_PIN_DOMAIN=auto:cache
export I_MPI_PIN_ORDER=scatter
bash ./out_to_in.sh
srun ./ALF.outConfigure with: source configure.sh FRITZ MPI HDF5
JURECA (JSC)¶
#!/bin/bash -x
#SBATCH --partition=batch
#SBATCH --nodes=<Nnodes>
#SBATCH --ntasks-per-node=<NtaskPnode>
#SBATCH --cpus-per-task=<Nthreads>
#SBATCH --time=24:00:00
module load Intel IntelMPI imkl
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export KMP_AFFINITY=granularity=fine,compact
export I_MPI_PIN_CELL=core
export I_MPI_PIN_DOMAIN=auto:cache3
export I_MPI_PIN_ORDER=scatter
./out_to_in.sh >/dev/null 2>&1
srun ./ALF.out24 cores per node. Useful thread counts: 1, 2, 4, 6, 12.
Configure with: source configure.sh JUWELS MPI HDF5 (loads modules automatically).
SuperMUC-NG (LRZ)¶
#!/bin/bash
#SBATCH --partition=general
#SBATCH --nodes=<Nnodes>
#SBATCH --ntasks-per-node=<NtaskPnode>
#SBATCH --ntasks-per-core=1
#SBATCH --cpus-per-task=<Nthreads>
#SBATCH --time=24:00:00
#SBATCH --account=<projectID>
module load slurm_setup
module load hdf5/1.10.7-intel21
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export KMP_AFFINITY=granularity=fine,compact
export I_MPI_PIN_CELL=core
export I_MPI_PIN_DOMAIN=auto:cache3
export I_MPI_PIN_ORDER=scatter
unset FORT_BLOCKSIZE
bash ./out_to_in.sh
mpiexec -n $SLURM_NTASKS ./ALF.out48 cores per node. Useful thread counts: 1, 2, 4, 6, 12, 24.
Configure with: source configure.sh SuperMUC-NG MPI (loads modules and HDF5 automatically).
Batch Job Chains¶
ALF provides Start_chain.c for submitting parameter scans. It reads a Sims file where each row defines a set of parameter substitutions, then for each row:
Creates a run directory
Copies
parametersandseedsfromStart/Substitutes placeholder variables in
parametersand the job scriptSubmits with
sbatch
This is useful for systematic scans over coupling constants, temperatures, or lattice sizes.
Adapting for Your Cluster¶
To adapt the provided scripts:
Copy the closest existing job file from
Scripts_and_Parameters_files/Update the
module loadlines for your environmentSet the correct partition, account, and time limits
Adjust
--ntasks-per-nodeand--cpus-per-taskfor your hardwareIf using Intel MPI, keep the pinning variables. For OpenMPI, use
--bind-to core --map-by slot
If your cluster is not yet listed in configure.sh, you have two options:
Quick start: Use one of the generic compiler entries (
GNUorIntel) and load modules manually before sourcingconfigure.sh.Permanent setup: Add a custom
MACHINEblock toconfigure.sh. Search for an existing machine (e.g.,FRITZ) and duplicate its block, then adjust the module loads, compiler paths, and library flags for your environment. This way you can simply runsource configure.sh MYCLUSTER MPI HDF5and the correct environment is set up automatically.