Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
added compute timer test
authormarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Nov 2007 08:29:25 +0000 (08:29 +0000)
committermarkls <markls@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 6 Nov 2007 08:29:25 +0000 (08:29 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4974 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/smpi/sample/compute.c [new file with mode: 0644]

diff --git a/src/smpi/sample/compute.c b/src/smpi/sample/compute.c
new file mode 100644 (file)
index 0000000..26ce12a
--- /dev/null
@@ -0,0 +1,18 @@
+#include <stdio.h>
+
+int main(int argc, char *argv[]) {
+       int i;
+       double d;
+       MPI_Init(&argc, &argv);
+       d = 2.0;
+       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;
+}