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. Several of the examples directories already have symbolic links to this command, but eventually you might want to add it to your path, with
set path=($path /home/me/mpich/bin)
More details on mpirun can be found in Section Some simple MPI programs will have been built during the compilation process. They are in the directory mpich/examples/basic and contain (at least) a C and a Fortran program for estimating 1#1. So change to that directory and do
mpirun -np 4 cpi
to run the C version, and
mpirun -np 4 fpi
to 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 Another program in the examples/basic subdirectory is cpilog. If you make it and run it, it will produce a simple log file that can be viewed with the program analysis tool upshot. To do so, do
make cpilog
mpirun -np <np> cpilog
upshot cpilog.log
The log file produced by cpilog is not very interesting, since
cpi is such a simple program. Many interesting logfiles can be found
in the profiling/upshot/logfiles subdirectory. The file
cpilog.c demonstrates how to instrument your own code for producing
such logs, and Section