MPICH2 Installation on a Cluster based on Redhat Linux EL 5.4

Versions
  • OS: Redhat Enterprise Linux 5.4
  • MPI: MPICH2 1.4.1p1
prerequisite
Installation (into every computer in cluster)
  • 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

[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
原文地址:https://www.cnblogs.com/snigoal/p/2238253.html