There are many MPI documents on the Web. Here is a list of good starting points.

Also see the examples in /usr/local/examples/mpi.