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
Do not require doxygen in maintainer mode
[simgrid.git]
/
src
/
smpi
/
sample
/
compute.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
for (i = 0; i < atoi(argv[1]); i++) {
9
if (d < 10000) {
10
d = d*d;
11
} else {
12
d = 2;
13
}
14
}
15
printf("%d %f\n", i, d);
16
MPI_Comm_rank(MPI_COMM_WORLD, &i);
17
MPI_Finalize();
18
return 0;
19
}