#!/bin/bash #SBATCH --job-name=omp # name of the job #SBATCH --nodes=1 # number of nodes #SBATCH --ntasks=1 # number of tasks (a single process here) #SBATCH --cpus-per-task=20 # number of OpenMP threads # /!\ Caution, "multithread" in Slurm vocabulary refers to hyperthreading. #SBATCH --hint=nomultithread # reserve physical (not logical) cores #SBATCH --time=00:01:00 # maximum execution time requested (HH:MM:SS) #SBATCH --output=omp%j.out # name of output file #SBATCH --error=omp%j.out # name of error file (here, in common with output) # cleans out the modules loaded in interactive and inherited by default module purge # loads modules module load ... # echo of launched commands set -x # number of OpenMP threads export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK # Binding export OMP_PLACES=cores # code execution ./omp_exe