X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/12e2600d416ea922cdaa3fdefe2522260e7312d1..b9c6a09e911fc100b36051e9c138ae14d1b18b5c:/teshsuite/smpi/allreduce_coll.c diff --git a/teshsuite/smpi/allreduce_coll.c b/teshsuite/smpi/allreduce_coll.c index a2c992195e..197607db6d 100644 --- a/teshsuite/smpi/allreduce_coll.c +++ b/teshsuite/smpi/allreduce_coll.c @@ -15,6 +15,8 @@ #define EXIT_FAILURE 1 #endif +#define MAXLEN 300000 + int main(int argc, char *argv[]) { int rank, size; @@ -27,23 +29,23 @@ int main(int argc, char *argv[]) MPI_Comm_rank(MPI_COMM_WORLD, &rank); MPI_Comm_size(MPI_COMM_WORLD, &size); - sb = (int *) xbt_malloc(size * sizeof(int)); - rb = (int *) xbt_malloc(size * sizeof(int)); + sb = (int *) xbt_malloc(size *MAXLEN * sizeof(int)); + rb = (int *) xbt_malloc(size *MAXLEN * sizeof(int)); - for (i = 0; i < size; ++i) { + for (i = 0; i < size *MAXLEN; ++i) { sb[i] = rank*size + i; rb[i] = 0; } printf("[%d] sndbuf=[", rank); - for (i = 0; i < size; i++) + for (i = 0; i < size *size; i++) printf("%d ", sb[i]); printf("]\n"); - status = MPI_Allreduce(sb, rb, size, MPI_INT, MPI_SUM, MPI_COMM_WORLD); + status = MPI_Allreduce(sb, rb, size *MAXLEN, MPI_INT, MPI_SUM, MPI_COMM_WORLD); printf("[%d] rcvbuf=[", rank); - for (i = 0; i < size; i++) + for (i = 0; i < size *size; i++)//do not print everything printf("%d ", rb[i]); printf("]\n");