PGI Guide for MPICH2

This guide is intended to help build the MPICH2 libraries using the PGI 2011 compilers.

Version Information

This guide was created for the 1.3.1 release of the MPICH2 libraries. This information is for both x64 processors running 64-bit Linux or x86 processors running 32-bit Linux.

Library Notes

MPICH2 is freely available. The MPICH2 webpage is at

From the webpage

"MPICH2 is a high-performance and widely portable implementation of the Message Passing Interface (MPI) standard (both MPI-1 and MPI-2)

The goals of MPICH2 are:

  1. to provide an MPI implementation that efficiently supports different computation and communications platforms including commodity clusters (desktop systems, shared-memory systems. multicore architectures), high-speed networks (10 Gigabit Ethernet, Infiniband, Myrinet, Quadrics) and proprietary high-end computing systems (Blue Gene, Cray).
  2. to enable cutting-edge research into MPI through an easy-to-extend modular framework for other derived implementations."

Obtaining the Source Code

mpich2-1.3.1.tar.gz source code can be downloaded from



Building and Installing MPICH2

  1. Untar the MPICH2 package:

       tar -xvzf mpich2-1.3.1.tar.gz
       cd mpich2-1.3.1
  2. Set the environment for the code:

       env CC=pgcc FC=pgfortran F77=pgfortran CXX=pgcpp CFLAGS=-fast FCFLAGS=-fast FFLAGS=-fast \
       CXXFLAGS=-fast ./configure --prefix=/opt/pgi/linux86-64/2011/mpi/mpich2 >& configure.log
  3. Build the code:

       make >& make.log   
  4. Install the code:

       sudo su
       make install
       make install-examples

    After you have successfully installed the MPICH2 library you will need to create a "mpd.hosts" file with the list of your cluster's host names. For more information about mpd.hosts, please refer to MPICH2 manual (doc/installguide/install.pdf).

    Running MPICH2

    To test your MPICH2 installation, first make sure that the MPICH2 install's bin directory is in your PATH environment variable. Then run mpdboot to start up mpd daemon. Next run mpdtrace to print out a list of hosts. Now, run program in examples directory

       mpirun -np 2 /opt/pgi/linux86-64/2011/mpi/mpich2/examples/cpi

    Using PGDBG with MPICH2

    The PGI graphical MPI-parallel debugger, PGDBG, is a powerful tool for assisting in the challenging task of debugging an MPI application. PGDBG is designed to work with MPICH2 and allows you precise control over all your MPI processes. More information about PGDBG can be found at PGDBG product page. MPICH2 is not currently configured to support PGDBG. To use PGDBG with MPICH2, you must install MPICH2 from PGI CDK® package. PGI CDK has modified MPICH2 scripts to support PGDBG. To run with PGDBG, using following command:

       mpiexec -pgi -np 3 myapp.out

    Note: You must have a PGI CDK license in order to use PGDBG with MPICH2. For more information about obtaining a PGI CDK license, please contact PGI Sales.

    Known Issues and Limitations

    No known issues.

Click me