#!/bin/bash
#SBATCH --job-name=aps_mpi       # name of job
#SBATCH --ntasks=4               # total number of MPI processes
#SBATCH --ntasks-per-node=4      # number of MPI processes per node
# /!\ Caution, "multithread" in Slurm vocabulary refers to hyperthreading.
#SBATCH --hint=nomultithread     # reserves physical and not logical cores
# Uncomment the line below to use exclusive mode and enable full access
# to the hardware counters (cf. the good practices for code profiling)
##SBATCH --exclusive -C prof
#SBATCH --time=00:30:00          # maximum execution time requested (HH:MM:SS)
#SBATCH --output=%x_%j.out       # name of output file
#SBATCH --error=%x_%j.out        # name of error file (same as output file)

## Choice of an Intel environment with APS
module load intel/2019.4

##echo of commands
set -x

## Execution in the SCRATCH
cd $SCRATCH

## Sampling of the binary ./my_bin_exe
## The report files are generated automatically after the sampling.
srun aps --collection-mode=mpi ./my_bin_exe