Jean Zay: Compilation of an MPI parallel code in Fortran, C/C++

The MPI environment to use on Jean Zay is the Intel environment.

The various MPI Intel environment versions available on Jean Zay can be activated through the module command. You must also activate the Intel compilers before compiling.

Loading example:

$ module avail intel-mpi
------------------------- /gpfslocalsup/pub/module-rh/modulefiles  -------------------------
intel-mpi/16.0.4 intel-mpi/18.0.1 intel-mpi/18.0.5 intel-mpi/19.0.2 intel-mpi/19.0.4
$ module load intel-compilers/19.0.4 intel-mpi/19.0.4


The compilation and linking of an MPI program is done by using the mpiifort scripts for a Fortran code, mpiicc for a C code or mpiicpc or a C++ code:

$ mpiifort source.f90
$ mpiicc source.c
$ mpiicpc source.C

The mpiifort compilation command (respectively mpiicc and mpiicpc) refers to the Intel ifort compiler (respectively icc and icpc). They all automatically include the paths of the Fortran mpif.h module and the libraries needed for MPI.


  • The execution of an MPI program have to be done in batch (via srun command or Slurm job) to avoid frontend node crash.