#!/bin/bash
#SBATCH --job-name=myjob               # Job name
#SBATCH --nodes=1                      # Number of nodes
#SBATCH --ntasks=1                     # Total number of tasks
#SBATCH --cpus-per-task=16             # Must match omp_set_num_threads() (max 36)
#SBATCH --hint=nomultithread           # One thread per physical core
#SBATCH --output=output.log            # Output file
#SBATCH --error=error.log              # Error log file

cd                                         # give the path to the submission directory. e.g., cd <your home directory>/OpenMP
export OMP_PLACES=cores                    # Each place is one physical core
export OMP_PROC_BIND=close                 # Pin each thread to its own core
./test-openmp                              # Run the OpenMP executable