In order to make running programs on parallel machines nearly as portable as
writing them, the environment distributed with mpich contains a script for
doing so. It is the
mpirun command, found in the mpich/bin
directory, which you might want to add it to your path, with
(assuming your shell is the C shell)
set path=($path /home/me/mpich/bin)More details on mpirun can be found in Section mpirun, a Portable Startup Script . If you are going to run on a network of workstations, you will need a machines.xxxx file in mpich/util/machines; see Section Special Considerations for Running on a Network of Workstations for details. Systems that use various kinds of filesystem automounters may need to make small changes to these programs; these are detailed in Section Dealing with automounters .
Some simple MPI programs are in the directory
mpich/examples/basic and contain a
C and a Fortran program for estimating
. So change to that directory and
do (assuming that you have added the directory containing
mpirun to your path)
make cpi
mpirun -np 4 cpi
to build and run the C version, and
make fpi
mpirun -np 4 fpi
to build and run the Fortran version. At this point, you have
minimally tested your
installation of mpich.
You might also want to check out the performance of MPI on your system. You
can do a crude check by running the program systest, also found in the
examples/basic directory. To try it, do:
make systest
mpirun -np 2 systest
For a more precise benchmark, see Section Benchmarking mpich
.