- OS: Redhat Enterprise Linux 5.4
- MPI: MPICH2 1.4.1p1
- configure IP address for all nodes in the cluster, ref http://www.cnblogs.com/snigoal/archive/2011/11/07/2238939.html
- configure SSH login without password, ref http://www.cnblogs.com/snigoal/archive/2011/11/07/2238976.html
- decompress
[root@A cluster]# tar zvxf mpich2-1.4.1p1.tar.gz
[root@A cluster]# cd mpich2-1.4.1p1
- make installation directoy as /home/software/mpich2-1.4.1p1
[root@A cluster]# mkdir /home/mpich2-1.4.1p1
- configure, build and install
[root@A cluster]# ./configure --prefix=/home/software/mpich2-1.4.1p1 --with-pm=hydra:mpd --with-cc=gcc --with-fc=gfortran --enable-cxx --enable-fc
[root@A cluster]# make
[root@A cluster]# make install
Configuration (on the first node)
- add mpi bin directory into enviroment variables and make mpi using ssh to communicate
[root@A cluster]# vi ~/.bash_profile
- add content below
export PATH=$PATH:/home/software/mpich2-1.4.1p1/bin
export MPI_USEP4SSPORT=yes
export MPI_P4SSPORT=22
export P4_RSHCOMMAND=ssh
- take effect
[root@A cluster]# source ~/.bash_profile
- configure process managere - hydra
- ref: http://blog.chinaunix.net/space.php?uid=25573859&do=blog&id=190455, http://wiki.mcs.anl.gov/mpich2/index.php/Using_the_Hydra_Process_Manager
[root@A cluster]# mkdir /home/software/mpich2-1.4.1p1/hydra
[root@A cluster]# vi /home/software/mpich2-1.4.1p1/hydra/hosts
- add available hosts like below in [hosts]
# [hostname]:[core count]
A:8
B:12
- configure directory the hosts file
[root@A cluster]# vi ~/.bashrc
- add directory in [.bashrc]
export HYDRA_HOST_FILE=/home/software/mpich2-1.4.1p1/hydra/hosts
- take effect
[root@A cluster]# source ~/.bashrc
Testing
- using the default program - cpi - in [examples]
[root@A ~]# mpiexec -np 4 $mpich2-1.4.1p1/examples/cpi
Configuration (on the following nodes)
- copy relevant file from the first node