////////////////////////////////////////////////////////////////////// // A very short MPI test routine to show the involved hosts ////////////////////////////////////////////////////////////////////// #include #include #include int main(int argc, char **argv){ int size,rank; char hostname[50]; MPI_Init(&argc,&argv); MPI_Comm_rank(MPI_COMM_WORLD, &rank); //Who am I? MPI_Comm_size(MPI_COMM_WORLD, &size); //How many processes? gethostname (hostname, 50); printf ("Hello World! I'm number %2d of %2d running on host %s\n", rank, size, hostname); MPI_Finalize(); return 0; }