// ================================================================== // Author: Jean-Michel Richer // Date: Aug 2020 // Last modified: November 2020 // Purpose: Use of MPI::BCast // The master process creates its own local data and they are send // to other process (of rank not equal to 0) // ================================================================== #include #include #include #include // for sleep using namespace std; #include "ezmpi.h" using namespace ez::mpi; /** * run master and slaves */ void run(int argc, char *argv[]) { Process p(argc, argv); int global_data_size = 100; int *global_data = NULL; global_data = new int [ global_data_size ]; for (int i=0; i