5 XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test");
7 int main(int argc, char ** argv)
13 MPI_Init(&argc, &argv);
15 double *a = malloc(sizeof(double) * M);
16 double *b = malloc(sizeof(double) * N);
19 err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD);
20 if (err != MPI_SUCCESS) {
21 perror("Error Bcast A\n"); MPI_Finalize(); exit(-1);
24 // Uncommenting this barrier fixes it!
25 // MPI_Barrier(MPI_COMM_WORLD);
28 err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD );
29 if (err != MPI_SUCCESS) {
30 perror("Error Bcast B\n"); MPI_Finalize(); exit(-1);
33 // Commenting out this barrier fixes it!!
34 MPI_Barrier(MPI_COMM_WORLD);