.. _mpi: ============================================================= MPI ============================================================= MPI is discussed in :ref:`slides` starting with Lecture 18. MPI stands for *Message Passing Interface* and is a standard approach for programming distributed memory machines such as clusters, supercomputers, or heterogeneous networks of computers. It can also be used on a single shared memory computer, although it is often more cumbersome to program in MPI than in OpenMP. MPI implementations ------------------- A number of different implementations are available (open source and vendor supplied for specific machines). See `this list `_, for example. MPI on the class VM ------------------- The VM has `open-mpi `_ installed. The libraries necessary to compile MPI programs are already installed on the class VM. You should be able to do the following:: $ cd $CLASSHG/codes/mpi $ mpif90 test1.f90 $ mpiexec -n 4 a.out and see output like:: Hello from Process number 1 of 4 processes Hello from Process number 3 of 4 processes Hello from Process number 0 of 4 processes Hello from Process number 2 of 4 processes For hints on installation on a Mac, see :ref:`mpi_osx`. Sample codes ------------ There are a few sample codes in the `$CLASSHG/codes/mpi` directory. See :ref:`jacobi2_mpi`. See also the samples in the list below. Further reading --------------- * `Argonne tutorials `_ * `Tutorial slides by Bill Gropp `_ * `Livermore tutorials `_ * `Open MPI `_ * `The MPI Standard `_ * `Some sample codes `_ * `LAM MPI tutorials `_ * Google "MPI tutorial" to find more.