#include #include #include "broadcast.h" int main(int argc, char *argv[]) { char msg[20]; int myrank; int tag = 99; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_rank(MPI_COMM_WORLD, &myrank); if (myrank == 0) { strcpy(msg, "Hello world"); MYMPI_Bcast_(msg, 20, MPI_CHAR, 0, MPI_COMM_WORLD); } else { MYMPI_Bcast_(msg, 20, MPI_CHAR, 0, MPI_COMM_WORLD); printf("%d: %s\n", myrank, msg); } MPI_Finalize(); return 0; }