/******************************************************************** Sharon Chambers username: chambers program: hello2.c 11/04/1999 ********************************************************************/ #include #include #include #define TAG MPI_ANY_TAG /* tag for messages */ #define ROOT 0 #define COMM MPI_COMM_WORLD /* define handle for communication */ #define MAX 20 /* max msg size */ void main(int argc, char **argv) { int i, rank, size, worker[1]; char buff[MAX], *msg="Hello World!"; MPI_Status status; MPI_Init(&argc, &argv); /* initialize mpi */ MPI_Comm_rank(COMM, &rank); /* get rank */ worker[0] = rank; if(rank == 0) /* master */ { MPI_Comm_size(COMM, &size); /* get size,send broadcast msg*/ for(i=1; i