Skip to main content
⚠ INFORMATION
This page was translated by an AI (LLM) with a cursory human check and is awaiting full review.

Compiling parallel MPI code (Fortran, C/C++)

The MPI libraries available on Jean Zay are the Intel MPI and Open MPI libraries.

The Open MPI libraries are compiled with and without MPI CUDA-aware support. For MPI CUDA-aware compilation, please refer to the MPI CUDA-aware and GPUDirect page.

The different versions of the MPI libraries available on Jean Zay can be viewed using the module command.

note

Remember to also activate the compilers (Intel or NVIDIA/PGI) before starting the compilation.

Loading examples

  • Intel MPI:
$ module avail intel-mpi
----------------- /lustre/fshomisc/sup/hpe/pub/module-rh/modulefiles -----------------
intel-mpi/5.1.3(16.0.4) intel-mpi/2019.2(19.0.2) intel-mpi/2019.6 intel-mpi/2019.9
intel-mpi/2018.1(18.0.1) intel-mpi/2019.4(19.0.4) intel-mpi/2019.7 intel-mpi/2021.9
intel-mpi/2018.5(18.0.5) intel-mpi/2019.5(19.0.5) intel-mpi/2019.8

$ module load intel-compilers/19.0.4 intel-mpi/19.0.4
  • Open MPI (without MPI CUDA-aware, you will need to select a module without the -cuda extension):
$ module avail openmpi
----- /lustre/fshomisc/sup/hpe/pub/modules-idris-env4/modulefiles/linux-rhel9-skylake_avx512 -----
openmpi/3.1.4 openmpi/4.0.1-cuda openmpi/4.0.5 openmpi/4.1.1-cuda openmpi/4.1.6-cuda
openmpi/3.1.4-cuda openmpi/4.0.2 openmpi/4.0.5-cuda openmpi/4.1.4-cuda openmpi/4.1.8
openmpi/3.1.5 openmpi/4.0.2-cuda openmpi/4.1.0 openmpi/4.1.5 openmpi/4.1.8-cuda
openmpi/3.1.6 openmpi/4.0.4 openmpi/4.1.0-cuda openmpi/4.1.5-cuda
openmpi/3.1.6-cuda openmpi/4.0.4-cuda openmpi/4.1.1 openmpi/4.1.6

$ module load pgi/20.4 openmpi/4.0.4

Compilation

Compilation and linking of an MPI program are done using the MPI wrappers of the compiler associated with the chosen library:

  • Intel MPI:
mpiifort source.f90
mpiicc source.c
mpiicpc source.C
  • Open MPI:
mpifort source.f90
mpicc source.c
mpic++ source.C
info

The execution of an MPI program must be done in batch (via the srun command or a Slurm job) to avoid saturating the login node.

Your opinion matters!

To give your feedback, report an error, or suggest an improvement, click here:

quick anonymous questionnaire

This questionnaire is temporary and will take less than a minute, so take the opportunity!