A practical question and answer session on MPI.
$ cat <<EOF >> mpihello_simple.cc
#include <mpi.h>
#include <iostream>
int main (int argc, char** argv)
{
int rank;
MPI_Init (&argc, &argv);
MPI_Comm_rank (MPI_COMM_WORLD, &rank);
std::cout << "Hello world from process " << rank << std::endl;
MPI_Finalize();
return 0;
}
EOF
$ mpiicpc mpihello_simple.cc
$ ./a.out
Hello world from process 0
$ mpiexec -np 2 ./a.out
Hello world from process 1
Hello world from process 0