1 /* Copyright (c) 2014-2019. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 /* Bug report: https://gforge.inria.fr/tracker/index.php?func=detail&aid=17132&group_id=12&atid=165 */
12 int main(int argc, char ** argv)
17 MPI_Init(&argc, &argv);
20 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
22 double *a = malloc(sizeof(double) * M);
23 double *b = malloc(sizeof(double) * N);
26 size_t err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD);
27 if (err != MPI_SUCCESS) {
28 perror("Error Bcast A\n");
33 // Uncommenting this barrier fixes it!
34 // MPI_Barrier(MPI_COMM_WORLD);
37 err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD );
38 if (err != MPI_SUCCESS) {
39 perror("Error Bcast B\n");
44 // Commenting out this barrier fixes it!!
45 MPI_Barrier(MPI_COMM_WORLD);
48 printf("Walltime = %g\n",MPI_Wtime());