顯示具有 MPICH 標籤的文章。 顯示所有文章
顯示具有 MPICH 標籤的文章。 顯示所有文章

2010/7/22

PC-clusters on Fedora 13 by using MPICH2

Recently, Due to some reason, I have to wake up my memory on setting pc-clusters on redhat long time age and then doing it again on Fedora 13.

PC-cluster:
NFS + NIS + (SSH or RSH) + intel compiler + MPICH2

1. update your system
* Set up your network to make it work well
* yum update OR yum upgrade
* Shut down the firewall and SELinux
=>System => Administration => Firewall=> disable
=>System => Administration => SELinux management => disable
=> vim /etc/selinux/config => SELINUX=disabled
=> vim /boot/grub/menu.lst => add "selinux=0" in back of kernel
* Shut down the service you do not need because we don't have firewall
=> sendmail, iptables, ip6tables, httpd, cup and etc.

2. hosts
* The inner computer must can be checked each others
=> 192.168.10.1 n1
=> 192.168.10.2 n2
=> 127.0.0.1 n1 localhost
* This is very important step. If you have the message as using mpd later like that
=> conn error in connect_rhs: Connection refused
(connect_rhs 979): failed to connect to rhs at 127.0.0.1 48503
(enter_ring 886): rhs connect failed
failed to enter ring
* This due to the n2 always connect to itself as checking the hosts file
* You have to change the localhost to the last line, and put 192.168.10.2 n2 in first line

3. NFS
rpm: nfs , nfs-utils, rpcbind (before fedora 7 is portmap)
on n1
* I want to share the /home and /opt to n2
* vim /etc/exports
=> /home 192.168.10.0/24(rw,async,no_root_squash)
=> /opt 192.168.10.0/24(ro,async)
* restart the nfs and rpcbind
* observe whether it work
=> check /var/log/messages
=> showmount -e n1
=> netstat -utln
=> rpcinfo -p n1
On n2
* restart rpcbind
* Can it find the n1 share
=> showmount -e n1
* Mount n1 share to n2
=> mount -t nfs n1:/home /home
=> mount -t nfs n1:/opt /opt
* edit the /etc/fstab
=> n1:/home /home nfs defaults 1 2
=> n1:/opt /opt nfs async,auto,ro,exec,nouser

4. NIS
rpm: yp-tools,ypbind,ypserv,rpcbind
on n1 (NIS server):
**set nis domainname
=>nisdomainname aaa
=>vim /etc/rc.d/rc.local
=>/bin/nisdomainname aaa
=> add "NISDOMAIN=vbirdnis" in /etc/sysconfig/network
**edit main configure file
=>vim /etc/ypserv.conf
127.0.0.0/255.255.255.0 : * : * : none
192.168.10.0/255.255.255.0 : * : * : none
* : * : * : deny

**edit the trust group
=>touch /etc/netgroup
**restart the service: rpcbind, ypserv, yppasswdd
**set the user and password to database for ypserver
=>/usr/lib/yp/ypinit -m
***If the error message says miss some file, just touch it
=>touch /etc/aliases
=>/usr/lib/yp/ypinit -m
**restart the service: rpcbind, ypserv, yppasswdd

on n2 (NIS client):
rpm: ypbind, yp-tools
**set nis domainname as same as n1 server
=>nisdomainname aaa
=>vim /etc/rc.d/rc.local
=>/bin/nisdomainname aaa
=> add "NISDOMAIN=vbirdnis" in /etc/sysconfig/network

**change user and password in authentication
=>vim /etc/nsswitch.conf
passwd: files nis
shadow: files nis
group: files nis
hosts: files nis dns

**edit authconfig
=>vi /etc/sysconfig/authconfig
USENIS=yes <- change no to yes

**edit pam
=>vi /etc/pam.d/system-auth
"password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow"
change to
"password sufficient /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow nis"

**set which server to look up
=>vi /etc/yp.conf
domain aaa
server n1

**restart ypbind and rpcbind

**test
=>yptest

5. SSH
rpm: sshd
server: n2
client: n1
**Actually, n1 and n2 always turn on ssh server as the operating system installing

**restart sshd

**no password log in n2 (MPICH2 user-manual suggest)
on n1 (client):
=>ssh-keygen -t rsa
=>cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys

on n2 (server):
**switch on sshd to RSA Authentication
=>vim /etc/ssh/sshd_config
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

**restart sshd


6. intel compiler

7.MPICH




To be continued

2009/5/11

MPICH2: the md5 module is deprecated

Due to Mandriva 2009 upgrade to Mandriva 2009 spring, as you type mpd&
You will get like this message:
The popen2 module is deprecated.
the md5 module is deprecated; use hashlib instead from md5

please refer to this article : http://trac.mcs.anl.gov/projects/mpich2/attachment/ticket/362/mpd_deprecated_workaround.patch

or
edit
mpdlib.py
add
*************************************************************
import warnings
warnings.filterwarnings('ignore', '.*the md5 module is deprecated.*', DeprecationWarning)
warnings.filterwarnings('ignore', '.*the popen2 module is deprecated.*', DeprecationWarning)
****************************************************************

2008/11/27

Install MPICH2 in Mandriva 2009 single machine

  1. You will need the following prerequisites : download mpich2 from http://www.mcs.anl.gov/research/projects/mpich2/
  2. Set you environment : export CXX=icpc & export CC=icc
  3. ./configure --prefix=/home/YOU/MPICH2-install/ --enable-cxx --enable-sharedlibs=gcc
  4. make
  5. make install
  6. vi ~/.bashrc and plus "export PATH=/home/YOU/mpich2-install/bin:$PATH"
  7. touch ~/.mpd.conf
  8. touch .mpd.conf
  9. edit .mpd.conf to add line like that secretword=
It will work NOW! If your no-passwd sshd is work.
How to run a MPI program:
  1. mpd &
    mpdtrace
    mpdallexit
  2. mpdboot -n -f mpd.hosts
  3. mpd &
    mpdtrace -l
  4. mpdtrace
  5. mpdringtest 100
  6. mpiexec -n hostname
  7. mpiexec -n 2 c.out
  8. mpdallexit
Summary
  • How many processor: mpdboot -n -f mpd.hosts
  • mpd &
  • Run your parallel program: mpiexec -n 2 c.out
  • Clean mpd: mpdallexit

2008/11/26

The lastest MPICH-1 configure environment parameter

./configure --with-device=ch_p4 --with-arch=LINUX --with-mpe --enable-cxx --enable-mpedbg --enable-debug --enable-traceback -prefix=/opt/MPICH/ -c++=/opt/intel/Compiler/11.0/074/bin/ia32/icpc -cc=/opt/intel/Compiler/11.0/074/bin/ia32/icc -opt=-g -rsh=ssh

2008/8/28

把mpich加入PATH

export PATH=$PATH:/opt/mpich/bin
export LIBRARY_PATH=$LIBRARY_PATH:/opt/mpich/include

2008/6/8

MPICH configure

./configure --with-device=ch_p4 --with-mpe --enable-cxx --enable-mpedbg --enable-debug --enable-traceback -prefix=/usr/opt/mpich -c++=/opt/intel/cc/10.0.023/bin/icpc -cc=/opt/intel/cc/10.0.023/bin/icc -fc=/opt/intel/fc/10.0.023/bin/ifort -f90=/opt/intel/fc/10.0.023/bin/ifort -rsh=ssh --enable-f90modules --with-arch=LINUX