/****************************************************************************** * FILE: poe_hello.c * DESCRIPTION: * Simple MPI program which prints a tasks hostname and rank. Used for POE * exercise. * AUTHOR: 10/98 Blaise Barney * LAST REVISED: ****************************************************************************/ #include #include void main (int argc, char* argv[]) { int myrank, numtasks; char procname [50]; int len; MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &numtasks); MPI_Comm_rank (MPI_COMM_WORLD, &myrank); if (myrank == 0) printf ("Total number of tasks = %d \n", numtasks); MPI_Get_processor_name (procname, &len); printf ("Hello! From task %d on host %s\n", myrank, procname); MPI_Finalize (); }