Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
We can use the cluster tag without backbone link if bb_bw and bb_lat attributes are...
[simgrid.git] / examples / smpi / compute.c
index 2e4b0e3..24607cb 100644 (file)
@@ -1,19 +1,27 @@
+/* Copyright (c) 2009, 2010. The SimGrid Team.
+ * All rights reserved.                                                     */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include <stdio.h>
+#include <mpi.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_Comm_rank(MPI_COMM_WORLD, &i);
-       MPI_Finalize();
-       return 0;
+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_Comm_rank(MPI_COMM_WORLD, &i);
+  MPI_Finalize();
+  return 0;
 }