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
-
Download MPICH2 - the source tarball is available from:
http://www-unix.mcs.anl.gov/mpi/mpich2/index.htm
-
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
-
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
-
Build MPICH2 - Type make.
-
Install - Type make install.
Running an MPI program
-
Add MPI to your PATH - export
PATH=/parl/bradles/software/mpich2/bin:$PATH
-
Download an MPI program - For example:
cpi.c
-
Compile the program - mpicc cpi.c -o cpi
-
Execute the program - mpiexec -n 2 ./cpi
MPI Resources
MPI Standard
MPI Functions