/* MCS 572 Wednesday 18 January 2006: a parallel hello world program
 * to compile and run the program
 *   1) mpicc hello.c -o hello (or do "make hello" using a makefile);
 *   2) mpirun -np 10 hello
 * with the flag "-np 10" we indidate we will use 10 processors. */

#include <stdio.h>
#include "mpi.h"

int main ( int argc, char *argv[] )
{
   int i,p;

   MPI_Init(&argc,&argv);

   MPI_Comm_size(MPI_COMM_WORLD,&p);

   MPI_Comm_rank(MPI_COMM_WORLD,&i);

   printf("Hello world from processor %d out of %d.\n",i,p);

   MPI_Finalize();

   return 0;
}
