/* From: "COMPUTATIONAL PHYSICS, 2nd Ed" by RH Landau, MJ Paez, and CC Bordeianu Copyright Wiley-VCH 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; & CC Bordeianu, Univ Bucharest, 2007 Support by National Science Foundation */ // MPIhello.c has each processor prints hello to screen #include "mpi.h" #include int main( int argc, char *argv[] ) { int myrank; MPI_Init( &argc, &argv ); // Initialize MPI MPI_Comm_rank(MPI_COMM_WORLD, &myrank); // Get CPU's rank printf( "Hello World from processor %d\n", myrank ); MPI_Finalize( ); // Finalize MPI return 0; }