script.sh (for parallel MPI program)

#!/bin/bash
#SBATCH --job-name=SommeVecVecPAR
#SBATCH -o ./%x.%j.%N.out           # output file
#SBATCH -e ./%x.%j.%N.err           # errors file
#
#SBATCH -p E5
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --cpus-per-task=1
#SBATCH --time=0-00:10:00           # day-hours:minutes:seconds
#
echo "The job ${SLURM_JOB_ID} is running on these nodes:"
echo ${SLURM_NODELIST}
echo
#
cd $SLURM_SUBMIT_DIR    # go to the work / submission directory
#
module purge
module use /applis/PSMN/debian11/E5/modules/all
module load OpenMPI/4.1.1-GCC-10.3.0
#
mpirun -np $SLURM_NTASKS ./SommeVecVecPAR.exe