Skip to main content

7.7) MPI (Message Passing Interface)


MPI (Message Passing Interface) is the standard for distributed memory programming. It is the standard for for message passing for both C and Fortran. It is supported on virtually all HPC platforms. Code written using MPI is highly portable and will run on shared memory as well as distributed memory architectures.

Compiling MPI Code On ARC2

There are several versions of MPI installed on ARC2, and are compiler dependent. Currently, the default is OpenMPI 1.6.5 in combination with the Intel compilers. On ARC2, switching a module, whether it is a compiler or MPI module, will result in the correct versions of the corresponding modules being loaded. For example, switching from the Intel to GNU compilers, via module switch intel gnu, the system will automatically switch to the correct version of the default OpenMPI module in the background.

When compiling MPI code use can be made of wrapper scripts that will automatically include the appropriate MPI header and libraries. These take the form:

  • mpif90 for Fortran 90
  • mpif77 for Fortran 77
  • mpicc for C
  • mpiCC for C++