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
Compare Architecture 32 or 64 with size of long
[simgrid.git]
/
examples
/
smpi
/
compute.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
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
MPI_Comm_rank(MPI_COMM_WORLD, &i);
18
MPI_Finalize();
19
return 0;
20
}