Prerequisite
- Install the C compiler by using Terminal and type as following:
sudo apt-get install build-essential
followed by your administrator password - Install Python 2.7
sudo apt-get install python2.7
followed by your administrator password - libssl-dev package for SMPD by using Synaptic Package Manager. Then, search and install it.
- (Optional) Fortran by using Synaptic Package Manager. Then, search and install the followings:
- libcnf-dev
- gfortran-multilib
- gfortan-4.4-multilib
Link: HOW to INSTALL C Compiler on ubuntu OS
Instruction for MPICH2 Installation
- Download mpich2 from this. The downloaded file has extension file named .tar.gz
- Extract the tar xfz of mpich2 by using Terminal and typing the command
tar xfz <the zip name>
Then, go to that directory by cdcd <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
- Type
- Restart is required
- Then Compile
mpicc -o <execute filename> <compiled filename>
- 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
- 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.
- 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.