Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile the sendrecv example
[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 }