/* * hello.ex1.c * Parallel version using MPI calls * Modified from basic version so that workers send back * a message to the master, who prints out a message * for each worker * RLF 10/11/95 */ #include #include #include "mpi.h" main(int argc, char **argv ) { char message[20]; int i,rank, size, type=99; MPI_Status status; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD,&size); MPI_Comm_rank(MPI_COMM_WORLD, &rank); if(rank == 0) { strcpy(message, "Hello, world"); for (i=1; i