X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ce7a12f964dc13411a5b3e4571e8c55f8b5edc8e..bcc204c4cb401765352e07ee5133893a33f930d5:/examples/smpi/reduce.c diff --git a/examples/smpi/reduce.c b/examples/smpi/reduce.c index 25ae108206..2946edc930 100644 --- a/examples/smpi/reduce.c +++ b/examples/smpi/reduce.c @@ -24,7 +24,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * *************************************************************************** **/ -int ibm_test(int rank, int size) +static int ibm_test(int rank, int size) { int success = 1; #define MAXLEN 10000 @@ -43,8 +43,8 @@ int ibm_test(int rank, int size) if (rank == root) { for (k = 0; k < j; k++) { if (in[k] != k * size) { - printf("bad answer (%d) at index %d of %d (should be %d)", in[k], k, - j, k * size); + printf("bad answer (%d) at index %d of %d (should be %d)", in[k], + k, j, k * size); success = 0; break; } @@ -79,9 +79,10 @@ int main(int argc, char **argv) value = rank + 1; /* easy to verify that sum= (size*(size+1))/2; */ - printf("[%d] has value %d\n", rank, value); + //printf("[%d] has value %d\n", rank, value); MPI_Reduce(&value, &sum, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD); - MPI_Reduce(&value, &sum_mirror, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD); + MPI_Reduce(&value, &sum_mirror, 1, MPI_INT, MPI_SUM, root, + MPI_COMM_WORLD); MPI_Reduce(&value, &min, 1, MPI_INT, MPI_MIN, root, MPI_COMM_WORLD); MPI_Reduce(&value, &max, 1, MPI_INT, MPI_MAX, root, MPI_COMM_WORLD);