#include #include #include int main(int argc, char *argv[]) { unsigned int n; int me, nprocs; int master=1; MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &nprocs); MPI_Comm_rank (MPI_COMM_WORLD, &me); if (me == 0) { printf("%s", "Input array length :\n"); scanf ("%d", &n); printf("Size in MB: %g\n",(double) n*8/1024/1024); } MPI_Bcast (&n, 1, MPI_INT, 0, MPI_COMM_WORLD); MPI_Barrier (MPI_COMM_WORLD); MPI_Status status; double *d; // Master recv if (me == master ) { for (int pe=0; pe