OpenMP and MPI

Exemple de script OpemMP + MPI

#!/bin/bash
#
# In this job an hybrid MPI-OpenMP program is started.
# This job will run on 48 cores: 12 MPI processes, 
# each process with 4 OpenMP threads making a total of 48 threads.
#
#SBATCH -n 12 -c 4
#
# Placement of threads as close as possible together
#SBATCH --distribution=block:block
#
# Job will take at most 1 hour, 10 minutes and 20 seconds wallclock time
#
#SBATCH -t 1:10:20

# Here the shell script starts. 
# go to the working directory:

cd $HOME/workdir

# and call the hybrid MPI-OpenMP program

mpirun ./mpi-openmp-program