Thai Language
How to Setup MPI on Linux Cluster.

1. Unpack mpich.tar.gz with gunzip and tar in /usr/local
2. cd mpich and call "configure" command
3. type "make" command
4. Setup configuration ,We have one master of cluster and other be worker.

On Master machine.

1. add all IP,hostname in /etc/hosts ,/etc/hosts.equiv,and set all for mail, networking ,add all user on our cluster on Master computer.
2. add all machines name to /usr/local/mpich/util/machines/machines.LINUX
such as pg1
pg2
3. go to directory /var/yp and type "domainname hpc" for HPC domainname and type "make"
4. add
domainname hpc
ypserv
in /etc/rc.d/rc.local
5. create file in /etc/yp.conf and type
#systax
#ypserver
ypserver pg1.math.sc.chula.ac.th
which pg1 is Master machine.
6. edit /etc/exports
/home pg1(rw) pg2(rw) pg3(rw) pg4(rw)
/usr pg1(rw) pg2(rw) pg3(rw) pg4(rw)
if you don't add pg1:/usr in worker machines you will cancel /usr in this file.

NOTE : If you add new user or you change some configuation on your network to master you must go to /var/yp and "make"

On Worker machines (assume pg2,pg3,pg4,...)

1. edit /etc/fstab and add
pg1:/home /home nfs defaults 1 1
pg1:/usr /usr nfs defaults 1 1
for the second line for /usr is not important to do upto 6 on Master config.
2. add all host to /etc/hosts and hosts.equiv same Master config.
3. go to /var/yp and type "domainname hpc" and type make
4. add
domainname hpc
ypbind
in /etc/rc.d/rc.local
5. create file in /etc/yp.conf and type
#systax
#ypserver
ypserver pg1.math.sc.chula.ac.th
which pg1 is Master machine.

Restart all machines ,try to restart Master first and restart worker after.

Some configuration of home directory
1. create .rhost and add host name all to this file
2. telnet to master and rlogin to worker if you can access it without password
request ,I think it's ok for your cluster.
3. try to run some example program.

How to Compile and Run MPI

Compile
$ mpicc -o test test.c -lm -lmpi
-lm for math library #include

Run
$ mpirun -np 4 test
4 is number of tasks or processes.

Enjoy! Some problems, mail to Somporn.ChuaiAree@iwr.uni-heidelberg.de