coding, howto

Howto Get MPICH2 run on a Linux Debian Lenny Machine

When trying to get MPICH2 working on two Debian Lenny machine, I ran into a problem. Actually, /etc/hosts was misconfigured. It was necessary to turn    myMachine.myDomain    myMachine

which caused heavy problems when trying to connect from a slave node to the master node using

mpd –host [masterhost] –p [masterport] &

on the slave into    myMachine.myDomain    myMachine

which was the actual IP address given to that machine by my DHCP server. I had to repeat this for all nodes using the appropriate IP of the node.

I figured out this problem by reading chapter “Troubleshooting MPDs -> Debugging host/network configuration” of the mpich2-installationguide.pdf – which is worth reading anyway. I learned that running into trouble in such a situation, the command


or even

mpdcheck -l

is a great tool, since it determines potential host of network configuration problems. There is plenty of debugging information in that manual, so you should always give it a try before searching the internet.

So here is what I did in order to build MPICH2 from scratch:

  1. First, I configured ssh in such a manner, that I was able to logon to any host without using I password. In order to achieve this condition, I created a secret key using ssh-keygen and copied the public key to all slaves. I did not use an empty passphrase, but I started ssh-agent in order to enable quite logon
  2. I got the source from the MPICH2 project homepage and unzip/tar-ed to some temporary directory
  3. cd there and build it using ./configure –prefix=/opt/mpich2 . (However, I preferred building MPICH2 using the Intel Compilers, thus, I set environmental variables CC and CXX: export CXX=icpc && export CC=icc . This step is, of course, not necessary if you build MPICH2 using GNU Compilers)
  4. make && sudo make install
  5. Next, I copied the whole /opt/mpich2 directory to the slave nodes calling scp -r /opt/mpich2 sascha@myslavenode
  6. The PATH and the LD_LIBRARY_PATH must contain the paths to /opt/mpich2/bin and /opt/mpich2/lib
  7. 4. and 5. was  carried out for all nodes, i.e. all nodes had the mpich2 directory physically on their HDs and the paths were set as of 5.
  8. Next, ~/mpd.conf needs to be created. This file contains a list of hosts to be connected to (for example, refer to my mpd.conf file)
  9. On the master, I executed mpdboot -n 2 -f ~/mpd.hosts which establishes connection between 2 hosts for 6 processors (see mpd.conf)
  10. I used mpdringtest 10000 and mpdtrace -l and mpiexec -n 6 hostname respectively in order to validate the connection
  11. Finally, I ran mpdallexit on one machine in order to kill the whole ring

Voila! I’ve got my cluster up and running now 🙂


2 thoughts on “Howto Get MPICH2 run on a Linux Debian Lenny Machine

  1. Pingback: Howto Get MPICH2 run on a Linux Debian Lenny Machine | - Your one stop for news about Debian

  2. Francesco Pietra says:

    Could you please imagine where I was mistaken in compiling on a shared memory lenny machine. GNU compilers

    $ ./configure -prefix=/opt/mpich2

    was OK, while

    # make && make install

    gave errors;

    AR cr ../../../lib/libmpich.a create_f90_int.o create_f90_real.o create_f90_complex.o typef90cmplxf.o typef90realf.o typef90intf.o create_f90_util.o
    RANLIB libmpich.a
    date > .libstamp0
    F90 mpi.f90
    make[3]: ifort: Command not found
    make[3]: *** [mpi.o] Error 127
    make[3]: Leaving directory `/home/francesco/tmp/mpich2-1.2.1p1/src/binding/f90′
    make[2]: *** [all-redirect] Error 1
    make[2]: Leaving directory `/home/francesco/tmp/mpich2-1.2.1p1/src/binding’
    make[1]: *** [all-redirect] Error 2
    make[1]: Leaving directory `/home/francesco/tmp/mpich2-1.2.1p1/src’
    make: *** [all-redirect] Error 2

    Actually I have the Fortran compilers;

    francesco@tya64:~$ which ifort

    francesco@tya64:~$ which gfortran

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s