Installing MPICH
From Debian Clusters
This is part one of a multi-part tutorial on installing and configuring MPICH2. The full tutorial includes
- Installing MPICH
- MPICH: Pick Your Paradigm
- MPICH with Torque Functionality
- OR MPICH without Torque Functionality
I'll be installing MPICH2 from source. If you're unfamiliar with installing from source, the Source Installation Paradigm is a (gentler) introduction to it than this page.
Contents |
Getting the Source
Getting the source is the first place to start when installing MPICH. Unfortunately, the apt-get package for MPICH isn't up-to-date, so while apt-get install mpich-bin will work, it will install an older version.
You'll want to keep your scientific software in one place on the NFS mount. My mount is kept at /shared, and I'm keeping all my sources in /shared/source. The first thing I did is to cd /shared/source. After doing that, grab the source code (often called the "tarball") from the MPICH2 home page. Choose the one under "All (Source)". After you've found the full link to the tar file, you can do
wget http://www-unix.mcs.anl.gov/mpi/mpich/downloads/mpich2-1.0.5p4.tar.gz
(making sure that the one you're wgetting is the most recent). After it's finished, untar it with
tar xvf mpich2*.tar.gz
Configuration
First, in order to install MPICH, you'll need to have Python installed. Do this with
apt-get install python2.5
Then, make sure you're in the folder that was created with the tar xvf (such as /shared/source/mpich2-1.0.5p4 for me) in these next few steps.
MPICH has many, many configuration options. For a full list of them, do ./configure -help (or, on a machine that you can't scroll on, do ./configure -help | more to pipe the output to the program called more so that it doesn't all scroll past you at once). These are all choices that can help configure MPICH for your system, including areas like which optional parts of MPICH to install and where on your drive MPICH should install itself.
One of the more important options is -prefix=<option>. prefix is where you specify the prefix for all the directories MPICH will create. In other words, this is the directory where MPICH will install. If you're installing it onto your shared NFS partition, like I am, you'll want to put
--prefix=/shared/
Other important options include which bindings MPICH should support, meaning which programming languages. (Make sure you've installed the compilers before installing MPICH. It won't work unless you do! MPI supports C, C++, and Fortran. These are specified with
--enable-cxx--enable-f77--enable-f90
cxx stands for C/C++. f77 is the Fortran 77 compiler, and f90 is the Fortran 90 compiler.
If you'll be running MPI on machines that have more than one processor or core, you'll also want support for threading. Threading takes advantaged of the shared memory. Enable threads with the following two additions.
--enable-threads=multiple--with-thread-package=posix
Finally, if you or your users will want to using debug programs at some point, you need to enable debugging support now, with
--enable-debuginfo
All of these options need to be given when running ./configure. The full line, if you're using threads, looks like this:
./configure --prefix=/shared/ --enable-cxx --enable-f70 --enable-f90 --enable-threads=multiple --enable-debuginfo
When you run this, ./configure will check your system and get make set up to install correctly. You'll want to scan back up through the output when it's completed to look for any errors. You also want to make sure that running the above command finishes with "Configuration completed."
Make
At this point, you're ready to run make from the same directory (the /mpich2-1.0.5p4 or whatever your version is one). (See the Source Installation Paradigm page for help with make errors.)
If it doesn't finish with errors, hooray! The phrase "Make completed" should also be one of the last lines.
Installing
Installing should be as easy as
make install
Again, if it doesn't finish with errors, you should be in business. (In this case, lack of feedback is a good thing.) make install also finishes with a very important message:
/shared/sbin/mpeuinstall may be used to remove the installation
This will come in handy if you want to reconfigure or update MPICH in the future and need to remove the old version.
Sanity Check
After installing MPICH, it's important to do a sanity check and make sure the install really worked and everything was put in its proper place. First, do an ls in the /bin subdirectory of the directory you told MPICH to install into (indicated with the -prefix= option given to ./configure). In my case, this is
ls /shared/bin
You should have a lot of executables starting with mpd. If you don't, the installation didn't finish successfully, so go back and retrace your steps. You'll also want to run which mpd as root and as a user to make sure the directory where the MPICH commands are located are in the proper place. You should see something like /shared/bin/mpd returned; if you see nothing, see Bash Profile Modifications: PATH Additions.
If everything is go, continue on to MPICH: Pick Your Paradigm.

