MPICH2 is one of parallel programming that it’s usually used in a cluster. Sometimes, we might ask how to install it with a single host because of studying purpose in order to easily get familiar with MPICH2 via your notebook or PC. Hence, I would like to introduce you how to install MPICH2 on the OS of Ubuntu running on a single host.

 

Prerequisite

  1. Install the C compiler by using Terminal and type as following:
    sudo apt-get install build-essential
     
    followed by your administrator password

  2. Link: HOW to INSTALL C Compiler on ubuntu OS

  3. Install Python 2.7
    sudo apt-get install python2.7
    followed by your administrator password
  4. libssl-dev package for SMPD by using Synaptic Package Manager. Then, search and install it.
  5. (Optional) Fortran by using Synaptic Package Manager. Then, search and install the followings:
    • libcnf-dev
    • gfortran-multilib
    • gfortan-4.4-multilib

Instruction for MPICH2 Installation

  1. Download mpich2 from this. The downloaded file has extension file named .tar.gz
  2. Extract the tar xfz of mpich2 by using Terminal and typing the command
    tar xfz <the zip name>  


    Then, go to that directory by cd

    cd <the filed extracted from the zip name>

    or using GUI of Ubuntu to extract
     

    Then, enter the following command:

    ./configure –prefix=/usr/local –enable-cxx –enable-debuginfo –with-device=ch3:nemesis –with-pm=smpd –disable-f77 –disable-fc
     

    Description :

    • –prefix is equal to the folder location that you want to install the MPICH2
    • –with-pm is an option to choose what a process manager you want to use for MPI and I choose smpd and it works! However, there are additional PMs such as mpd,hydra and gforker but i don’t know how to configure to be usable for MPICH2
    • –with-device = a communication device in which “nemesis” is the best

    Note: 4th step of the prerequisite procedure –> if it’s not completed, you must include –disable-f77 and –disable-fc on the command

  3. Type
    • sudo make
      followed by your administrator password
    • sudo make install
      followed by your administrator password
  4. Restart is required
  5. Then Compile
     
    mpicc -o <execute filename> <compiled filename>

     
  6. Before run, you have to make smpd start by
    smpd -s
     

    Note: 

    • For the first time, it will ask the “pharse”, so you can enter any number. Then it would be kept on the file named .smpd at your home directory. Then, it’ll ask would you like to save this phrase in ‘home/your/.smpd’ so you press y then enter.
       
    • It may be necessary for using several computers to compute the same job via smpd as their process manager if the other computers have the same pharse as the master is
    • It’s required Internet Access, so it is a must to open internet connection
  7. Then run by
    mpiexec -np <execute filename> <compiled filename>  

    or

    mpirun -np <number of process> <executed filename>

More information: http://www.mcs.anl.gov/research/projects/mpich2/index.php

All in all, you can finally run MPICH2 on your notebook or PC without requiring a complex cluster. Life is easier with MPICH2.

Add to FacebookAdd to DiggAdd to Del.icio.usAdd to StumbleuponAdd to RedditAdd to BlinklistAdd to TwitterAdd to TechnoratiAdd to Yahoo BuzzAdd to Newsvine