MVAPICH2 is an implementation of MPI (v2.x) for Infiniband.


Category: MPI


Availability: Open access for all users



WARNING: The only SLURM-compliant version of MVAPICH2 available on UB CCR is 2-2.0a. This corresponds to the following modules, which are built for specific combinations of compiler and infiniband hardware (note that modules designated as "IB" are for use with Mellanox IB cards):


mvapich2/gcc-4.4.6/2-2.0a-IB

mvapich2/gcc-4.4.6/2-2.0a-QLogic

mvapich2/intel-13.1/2-2.0a-IB

mvapich2/intel-13.1/2-2.0a-QLogic


Compiler "wrappers" around the compiler suite (mpif90, mpicc, mpicxx).



Usage Notes

Show the software versions: module avail mvapich2

Loading the module will set the path and any necessary variables: module load mvapich2/version




Compiling SLURM-compatible MVAPICH2 Code

An MVAPICH2 example that works in the SLURM environment is located here: /util/mvapich2/example


Compiling code for use with MVAPICH2 requires inclusion of the pmi library. The following sample code for compiling code that uses MVAPICH2 is written in bash:


module load mvapich2/gcc-4.4.6/2-2.0a-IB

mpicc -c cpi.c

mpicc -o cpi cpi.o -lpmi



Job Startup

MVAPICH2 is integrated with SLURM and MPI tasks should be launched using the srun command.


The following sample code for launching the tasks is written in bash:


srun -n$SLURM_NPROCS --mpi=none ./a.out