A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
thought this one would fix my long-standing wait_all() bug.
[simgrid.git]
/
examples
/
smpi
/
compute3.c
1
#include <stdio.h>
2
3
int main(int argc, char *argv[])
4
{
5
int i;
6
double d;
7
MPI_Init(&argc, &argv);
8
d = 2.0;
9
SMPI_DO_ONCE {
10
for (i = 0; i < atoi(argv[1]); i++) {
11
if (d < 10000) {
12
d = d * d;
13
} else {
14
d = 2;
15
}
16
}
17
printf("%d %f\n", i, d);
18
}
19
SMPI_DO_ONCE {
20
for (i = 0; i < 2 * atoi(argv[1]); i++) {
21
if (d < 10000) {
22
d = d * d;
23
} else {
24
d = 2;
25
}
26
}
27
printf("%d %f\n", i, d);
28
}
29
MPI_Finalize();
30
return 0;
31
}