Compile MPI Program Using MPICH

While it is possible to compile and link manually through command line, it is a good idea to incorporate the above into a makefile.

To run job interactively using MPICH:
tonka% example -np 4
tonka% mpirun -np 4 example
tonka% mpirun example -np 4
alt at prompt, type mpirun -help to get a list of all mpirun options

On Boston University’s SGI systems, because SGI’s MPI implementation is the default MPI, the mpirun run script is for executables created for the SGI MPI. An MPICH-compiled executable will fail using this script. There are a number of ways to get around this:

  • not to use mpirun at all; use “example -np 4” aliasing mpirun to point to the MPICH mpirun
    lego% alias mpirun /usr/local/mpi-1.2.0/IRIX64/ch_shmem/bin/mpirun
  • aliasing MPICH mpirun to, say, mpirun2 to ease typing as well as avoid confusion
    lego% alias mpirun2 /usr/local/mpi-1.2.0/IRIX64/ch_shmem/bin/mpirun