1.Dowload mpich.tar.gz
http://www-unix.mcs.anl.gov/mpi/mpich/downloads/mpich.tar.gz
2.Install mpich
#cd ~
#tar zxvf mpich.tar.gz
#cd mpich-1.2.7
#./configure -prefix=/usr/local/mpich
#make
#make install
3.Set the Env
open ~/.bashrc
Add the following at the end of bashrc.
export LINUX_MPIHOME=/usr/local/mpich
export PATH=$PATH:$LINUX_MPIHOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LINUX_MPIHOME/lib
export MANPATH=$MANPATH:$LINUX_MPIHOME/man
4.Set the SSH authtication
After the previous steps, mpich is working. But it required your password
to run the program everytiom.
Configure the SSH authtication will resolve the trouble.
#ssh-keygen -t dsa
#cp cp ~/.ssh/id-dsa.pub ~/.ssh/authorized_keys2
#chmod go-rwx ~/.ssh/authorized_keys2
#ssh-agent $SHELL
#ssh-add
If you are multi-nodes environment, do this on your nodes once.
Collect all the nodes' authorized_keys2 together in a folder and
give the folder to every nodes.
#ssh shallow
I do mpich on one sigle computer, so try multi-nodes yourself.
5.Test your install
cd /root/mpich-1.2.7/example/basic
mpicc -o cpi cpi.c
mpirun -np 4 cpi
6.Result
pi is approximately 3.1415926544231239, Error is 0.0000000008333307
wall clock time = 0.001951
Process 2 of 4 on xx
Process 1 of 4 on xx
Process 3 of 4 on xx
Enjoy it!~
Royhwa
2005-10-20
(There is something wrong with the feedback.)To Cathy:
Try 4.Set the SSH authtication
I suggest to install MPICH2 which is easier to use and more powerful.
Here it is: http://www-unix.mcs.anl.gov/mpi/mpich2/