X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8ab9fbef9cd17e59a43126cd5ea214f4190db39e..2591e519da64d744ad34e5ca2de5352eb4206b7b:/teshsuite/bug-17132/bug-17132.c?ds=sidebyside diff --git a/teshsuite/bug-17132/bug-17132.c b/teshsuite/bug-17132/bug-17132.c new file mode 100644 index 0000000000..cecb3e4607 --- /dev/null +++ b/teshsuite/bug-17132/bug-17132.c @@ -0,0 +1,40 @@ +#include "xbt/log.h" +#include +#include + +XBT_LOG_NEW_DEFAULT_CATEGORY(MM_mpi, "Messages for this SMPI test"); + +int main(int argc, char ** argv) +{ + size_t err; + size_t M = 8*1024; + size_t N = 32*1024; + + MPI_Init(&argc, &argv); + + double *a = malloc(sizeof(double) * M); + double *b = malloc(sizeof(double) * N); + + // A broadcast + err = MPI_Bcast(a, M, MPI_DOUBLE, 0, MPI_COMM_WORLD); + if (err != MPI_SUCCESS) { + perror("Error Bcast A\n"); MPI_Finalize(); exit(-1); + } + +// Uncommenting this barrier fixes it! +// MPI_Barrier(MPI_COMM_WORLD); + + // Another broadcast + err = MPI_Bcast(b, N, MPI_DOUBLE, 0, MPI_COMM_WORLD ); + if (err != MPI_SUCCESS) { + perror("Error Bcast B\n"); MPI_Finalize(); exit(-1); + } + + // Commenting out this barrier fixes it!! + MPI_Barrier(MPI_COMM_WORLD); + + MPI_Finalize(); + free(a); + free(b); + return 0; +}