X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7ff29e8672c30f460d929a39dfda8e912b8da6e7..856d00fcbcb6d15800cd7095c910c0347f7dde97:/src/smpi/sample/reduce.c diff --git a/src/smpi/sample/reduce.c b/src/smpi/sample/reduce.c index b71c1a6934..f7321d6028 100644 --- a/src/smpi/sample/reduce.c +++ b/src/smpi/sample/reduce.c @@ -1,11 +1,18 @@ +/* Copyright (c) 2007, 2009, 2010. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ + #include #include -int main (int argc, char **argv) { +int main(int argc, char **argv) +{ int size, rank; - int root=0; + int root = 0; int value = 1; - int sum=-99; + int sum = -99; double start_timer; @@ -18,9 +25,9 @@ int main (int argc, char **argv) { printf("rank %d has value %d\n", rank, value); MPI_Reduce(&value, &sum, 1, MPI_INT, MPI_SUM, root, MPI_COMM_WORLD); - if ( rank == root) { - printf("On root: sum=%d\n",sum); - printf("Elapsed time=%lf s\n", MPI_Wtime()-start_timer); + if (rank == root) { + printf("On root: sum=%d\n", sum); + printf("Elapsed time=%lf s\n", MPI_Wtime() - start_timer); } MPI_Finalize(); return 0;