...
Hybrid (MPI+OpenMP)
...
Code Block | ||
---|---|---|
| ||
#!/bin/bash
#SBATCH --time 0:10:00
#SBATCH -p mpp
#SBATCH -N 2
#SBATCH --tasks-per-node 8
#SBATCH --cpus-per-task 16
#SBATCH --job-name=hybrid
#SBATCH --output=out_%x.%j
# disable hyperthreading
#SBATCH --hint=nomultithread
module purge
module load xthi/1.0-intel-oneapi-mpi2021.6.0-oneapi2022.1.0 intel-oneapi-mpi
# module load xthi/1.0-openmpi4.1.3-gcc8.5.0 openmpi/4.1.3
ulimit -s unlimited
# OpenMP and srun, both need to know the number of CPUs per task
export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK
export SRUN_CPUS_PER_TASK=$SLURM_CPUS_PER_TASK
srun xthi | sort -g -k 4 |