Loughborough University
Leicestershire, UK
LE11 3TU
+44 (0)1509 222222
Loughborough University

IT Services : High Performance Computing

Compiling MPI Programs


Overview

When building MPI programs it is generally best to use the MPI compiler wrappers provided by the MPI installation rather than using the compilers directly. The MPI wrappers take care of including the correct libraries and setting appropriate environment variables, in order to make it easier for you to build MPI programs.

  • For C use mpicc.

  • For C++ use mpicxx or mpiCC

  • For Fortran use mpif90.

  • When using Intel MPI there are also some additional wrappers which use particular compilers:

    • For Intel C (icc) use mpiicc

    • For Intel C++ (icpc) use mpiicpc

    • For Intel Fortran (ifort) use mpiifort

    • For gcc use mpigcc

    • For g++ use mpigxx

Available MPI Libraries

On hydra we support two MPI libraries; these are "bullxmpi" and Intel MPI. The "bullxmpi" library is a build of the Open MPI library.

See www.open-mpi.org

We generally advise that you use the Intel Compilers and the "bullxmpi" MPI library unless you have specific requirements for other compilers or MPI libraries.

Loading the MPI Modules

The following sections show how to load valid combinations of compilers and MPI libraries:

bullxmpi with the Intel Compilers

module load intel_compilers

module load bullxmpi

bullxmpi with gcc/gfortran

module load gcc/4.8.2 (or 4.9.1). Note that 4.4.7 is loaded by default without requiring a module load.

module load bullxmpi

intel_mpi with the Intel Compilers

module load intel_compiler intel_mpi

intel_mpi with gcc/gfortran

module load gcc/4.8.2 (or 4.9.1 - 4.4.7 is loaded by default without needed a module load command)

module load intel_mpi

openmpi with gcc/gfortran

module load gcc/4.8.2 (or 4.9.1 - 4.4.7 is loaded by default without needed a module load command)

module load openmpi