/************************************************************************ * Write an MPI "hello World!" program using the appropriate MPI calls. ************************************************************************/ /************************** 1.Include the header **************************/ #include "mpi.h" #include int main(int argc, char** argv) { char message[20]; MPI::Status status; int i,rank, size, tag=11; /************************** 2.Initialize MPI **************************/ MPI::Init(argc, argv); /************************** 3.Find out my rank in the global communicator MPI_COMM_WORLD **************************/ rank = MPI::COMM_WORLD.XXX_XXXX( ); /************************** 4.Find out the size of the global communicator MPI_COMM_WORLD **************************/ size = MPI::COMM_WORLD.XXX_XXXX( ); /************************** 5.Check the rank, and **************************/ if(XXXXXXXXX) { /************************** a.if the process is the master, then send a "Hello,World!" message, in characters, to each of the workers. **************************/ strcpy(message, "Hello,World!"); for (i=1; i