1 /* Copyright (c) 2014. 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 */
13 XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test");
15 int main(int argc, char ** argv)
20 MPI_Init(&argc, &argv);
23 MPI_Comm_rank(MPI_COMM_WORLD,&rank);
25 double *a = malloc(sizeof(double) * M);
26 double *b = malloc(sizeof(double) * N);
29 size_t err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD);
30 if (err != MPI_SUCCESS) {
31 perror("Error Bcast A\n");
36 // Uncommenting this barrier fixes it!
37 // MPI_Barrier(MPI_COMM_WORLD);
40 err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD );
41 if (err != MPI_SUCCESS) {
42 perror("Error Bcast B\n");
47 // Commenting out this barrier fixes it!!
48 MPI_Barrier(MPI_COMM_WORLD);
51 printf("Walltime = %g\n",MPI_Wtime());