Selecting Compiler Alternatives for MPI Programs

The choice of compiler will effect application performance, as will the optimization flags used during compilation. The ParaStation MPI environment has simplified the selection of compilers by dispensing with the normal MPI environment variables used in MPICH distributions.

It is important to link applications codes with MPI libraries and other ancillary libraries (such as MKL math libraries) compiled with the same compiler as that used for the main application. This ensures compatibility of shared objects and exposes the user to runtime libraries with the best set of optimization parameters for that particular compiler. ParaStation MPI achieves this requirement using wrapper scripts designed for use with each compiler.

Compiler & Linker Wrapper scripts

The following wrapper scripts are available in ParaStation MPI releases:

Table 4.1. Compiler wrappers for building MPI codes

Wrapper path Compiler Type
${MPI_HOME}/bin/mpiccC compiler
${MPI_HOME}/bin/mpicxxC++ compiler
${MPI_HOME}/bin/mpif77FORTRAN 77 compiler
${MPI_HOME}/bin/mpif90FORTRAN 90 compiler

With ${MPI_HOME}:

Table 4.2. MPI home directories for different compilers

${MPI_HOME} Compiler suite commands
/opt/parastation/mpi2 GNU Compiler gcc, g++, gfortran
/opt/parastation/mpi2-intel IntelŪ Compiler Suite icc, icpc, ifort
/opt/parastation/mpi2-pgi PGI: Portland Group pgcc, pgCC, pgf77, pgf90


Users will generally compile their application code using make and select the appropriate wrapper script in a Makefile as follows:

#
# Makefile
#      

MPI_HOME="/opt/parastation/mpi2"

code: code.c
	$(MPI_HOME)/bin/mpicc -o code code.c
      

Users who wish to compile applications on the command line should add the directory containing the wrapper script of the selected compiler to their PATH. Use of command which mpicc will verify the PATH environment is correctly set (for the C compiler in this case). [2]



[2] Administrators should consider Environment Management Software for this (e.g. Modules: http://modules.sourceforge.net/)