domingo, agosto 20, 2006

Installation and configuration of MPICH2 for a Beowulf Cluster, version 0.2.1
For kanibalv (kanibalv@gmailNOSPAM.com)

(Supercomputing with Ubuntu o Kubuntu.)



This is how I configure the MPICH2 packages in Kubuntu Dapper LTS whit 2 PC's. Also works for 1 PC's.


I have:
-2 PC's pentium III with ethernet card, connected to a five port switch (this have a port connected to a "router" for adsl of timofonica).
-The master PC, have the name kubuntu and the node have the name of nodo01
-the addresses are 192.168.1.2 for kubuntu and 192.168.1.3 for nodo01. (my /etc/network/interfaces in the end of the guide)

-Ok, first install ssh service, this could be rsh, but i don't try it yet, (for now so much head-ache jajaja)
$ sudo apt-get install ssh

- then for password less connection, (this is how i did it, post a better way)
$ssh-keygen -t dsa
#here ask for save place and pass, i just hit enter.

-then copy the key
$ssh-copy-id usuarioremoto@nodo01
$ssh-add

- the same whit RSA
$ssh-keygen -t rsa
#here ask for save place and pass, i just hit enter.

-then copy the key
$ssh-copy-id usuarioremoto@nodo01
$ssh-add

(you can test this whit the command "ssh nodo01", put "exit" for log out)

-So, install MPICH2 packages,this must be in the master and nodes:

$ sudo apt-get install mpich2
$ sudo apt-get install mpich2-mpd
$ sudo apt-get install mpich2-mpe
$ sudo apt-get install libmpich2-1.0
$ sudo apt-get install libmpich2-1.0-dev

the repositories for MPICH2 packages are in (put it in /etc/apt/sources.list):
#MPICH2.deb Packages
deb http://torvalds.cs.mtsu.edu/~zach/debian/current/ /

- the /etc/hosts file must be like this, with other don't work:
$sudo vim /etc/hosts

127.0.0.1 localhost localhost.localdomain
192.168.1.2 ubuntu master
192.168.1.3 nodo01
# IPv6, etc

-after this, must be a file called ".mpd.conf" in /home/"usuario" whit the follow line:
MPD_SECRETWORD="secret"

# the word "secret" is for your choice

-Also a file called ".mpd.hosts" with:
#
kubuntu
nodo01
#

(the same in nodes)

-repeat the steps in all PC's


-then in the master, run the MPD daemon

For run it on 1 PC only:
usuario@kubuntu:~$mpdboot

For 2 o more PC's is:
usuario@kubuntu:~$mpdboot -n 2 -f .mpd.hosts
# the 2 number is for 2 PC's, but could be any number lower than all PC's number

- for test
usuario@kubuntu:~$mpdtrace
kubuntu
nodo01
-this messages means that MPD daemon is running on the PC's

-another way
usuario@kubuntu:~$mpiexec -n 2 hostname
kubuntu
nodo01

-or:
usuario@kubuntu:~$mpiexec -l -n 3 hostname
1: nodo2
0: kubuntu
2: kubuntu

-and finally the cpi program
usuario@kubuntu:~$mpiexec -l -n 5 /usr/share/mpich2/examples/cpi
0: Process 0 of 5 is on kubuntu
1: Process 1 of 5 is on nodo2
3: Process 3 of 5 is on nodo2
2: Process 2 of 5 is on kubuntu
4: Process 4 of 5 is on kubuntu
0: pi is approximately 3.1415926544231230, Error is 0.0000000008333298
0: wall clock time = 0.026098



I hope this works for you, i spend a lot of time to get here, write about yours experiences....
-o-

Note: My /etc/network/interfaces file (with my ADSL conf):

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

auto dsl-provider
iface dsl-provider inet ppp
provider dsl-provider

pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf

# added by pppoeconf
auto eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1

-o-