A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
model-checker : if get_libsimgrid_plt_section called before first snapshot, libsimgri...
[simgrid.git]
/
src
/
smpi
/
sample
/
reduce.c
diff --git
a/src/smpi/sample/reduce.c
b/src/smpi/sample/reduce.c
index d939385bba57bb4a5ab61fb69e38671b5151afd1..f7321d6028e01303a38bcd1ca9fd42baabe6993f 100644
(file)
--- a/
src/smpi/sample/reduce.c
+++ b/
src/smpi/sample/reduce.c
@@
-7,11
+7,12
@@
#include <stdio.h>
#include <mpi.h>
#include <stdio.h>
#include <mpi.h>
-int main (int argc, char **argv) {
+int main(int argc, char **argv)
+{
int size, rank;
int size, rank;
- int root
=
0;
+ int root
=
0;
int value = 1;
int value = 1;
- int sum
=
-99;
+ int sum
=
-99;
double start_timer;
double start_timer;
@@
-24,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);
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;
}
MPI_Finalize();
return 0;