After writing a MPI programs you can compile them by using the following commands
For c
mpicc hello.c –o hello
For c++
mpiCC hello.cc –o hello
For fortran
mpiff hello.f –o hello
For running a the MPI programs
mpirun C hello
The C option means “launch one copy of hello on
every CPU that was listed in the boot schema.
mpirun N hello
N means “launch one copy of hello on every node in
the LAM universe.” Hence, N disregards the CPU count.
This can be useful for multithreaded
MPI program
mpirun –np 4 hello
This runs 4 copies of hello. LAM will “schedule” how
many copies of hello will be run in a roundrobin fashion
on each node by how many CPUs were listed in the boot
schema file.
I have done a lame documentation regarding the building of a cluster and running MPI programes. You can donwload it from
http://sudeepk.info/projects/clustering.pdf