MPI HOWTO for ECE 693 and ECE 873


In order to do the lab assignments on your own machine, it is neccesary to install an MPI library on your own machine. These instructions define how to install MPICH2 on your local Linux machine so that you can run MPI programs locally, where you can easily develop and debug your assignments before running them on the cluster. Do not use the cluster for development, it annoys the other users and is very difficult to do if no one has showed you the techniques.

Installing MPICH2

  1. Download MPICH2 - the source tarball is available from: http://www-unix.mcs.anl.gov/mpi/mpich2/index.htm
  2. Un-tar MPICH2 - You will need to untar the source code in order to build and install it. I perform the actions this way:

    bradles@speed:1% mkdir sandbox
    bradles@speed:2% cd sandbox
    bradles@speed:3% tar xvfz mpich2-1.0.1.tar.gz
    bradles@speed:4% cd mpich2-1.0.1


  3. Configure MPICH2 - Before building MPICH you will need to configure it for your system. I specify a prefix, which describes the installation directory. The other flags are required to use MPICH2 for development on your machine. The following command must all be typed on one line.

    bradles@speed:5% ./configure --prefix=/parl/bradles/software/mpich2 --disable-f77 --with-pm=gforker --enable-romio --with-file-system=ufs+nfs

  4. Build MPICH2 - Type make.
  5. Install - Type make install.

Running an MPI program

  1. Add MPI to your PATH - export PATH=/parl/bradles/software/mpich2/bin:$PATH
  2. Download an MPI program - For example: cpi.c
  3. Compile the program - mpicc cpi.c -o cpi
  4. Execute the program - mpiexec -n 2 ./cpi

MPI Resources

MPI Standard

MPI Functions