X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8bf0e23b7f0a6ee8695d56fae94785f07f551fff..025965074dbe4c1b04466cc260260470f28b7472:/examples/smpi/compute2.c diff --git a/examples/smpi/compute2.c b/examples/smpi/compute2.c new file mode 100644 index 0000000000..153e1ba9ad --- /dev/null +++ b/examples/smpi/compute2.c @@ -0,0 +1,20 @@ +#include + +int main(int argc, char *argv[]) { + int i; + double d; + MPI_Init(&argc, &argv); + d = 2.0; + SMPI_DO_ONCE { + for (i = 0; i < atoi(argv[1]); i++) { + if (d < 10000) { + d = d*d; + } else { + d = 2; + } + } + printf("%d %f\n", i, d); + } + MPI_Finalize(); + return 0; +}