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
cosmetics
[simgrid.git]
/
src
/
smpi
/
sample
/
compute3.c
1
#include <stdio.h>
2
3
int main(int argc, char *argv[]) {
4
int i;
5
double d;
6
MPI_Init(&argc, &argv);
7
d = 2.0;
8
SMPI_DO_ONCE {
9
for (i = 0; i < atoi(argv[1]); i++) {
10
if (d < 10000) {
11
d = d*d;
12
} else {
13
d = 2;
14
}
15
}
16
printf("%d %f\n", i, d);
17
}
18
SMPI_DO_ONCE {
19
for (i = 0; i < 2*atoi(argv[1]); i++) {
20
if (d < 10000) {
21
d = d*d;
22
} else {
23
d = 2;
24
}
25
}
26
printf("%d %f\n", i, d);
27
}
28
MPI_Finalize();
29
return 0;
30
}