Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot/simgrid/simgrid into...
authorJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Thu, 27 Sep 2012 12:04:15 +0000 (14:04 +0200)
committerJonathan Rouzaud-Cornabas <jonathan.rouzaud-cornabas@ens-lyon.fr>
Thu, 27 Sep 2012 12:04:15 +0000 (14:04 +0200)
examples/smpi/mc_bugged2.c
src/msg/msg_gos.c
src/surf/network.c
src/xbt/datadesc/datadesc.c

index 707950e..479b147 100644 (file)
@@ -13,7 +13,7 @@
 
 int main(int argc, char **argv)
 {
-  int recv_buff, err, size, rank;
+  int x,y, err, size, rank;
   MPI_Status status;
 
   /* Initialize MPI */
@@ -32,10 +32,10 @@ int main(int argc, char **argv)
   }
 
   if (rank % 3 == 0) {
-    MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-    printf("(%d) receive %d\n", rank, recv_buff);
-    MPI_Recv(&recv_buff, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
-    printf("(%d) receive %d\n", rank, recv_buff);
+    MPI_Recv(&x, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    printf("(%d) x <- %d\n", rank, x);
+    MPI_Recv(&y, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
+    printf("(%d) y <- %d\n", rank, y);
   }else{
     MPI_Send(&rank, 1, MPI_INT, (rank / 3) * 3, 42, MPI_COMM_WORLD);
     printf("Sent %d to rank %d\n", rank, (rank / 3) * 3);
index e63d05f..a883deb 100644 (file)
@@ -664,7 +664,7 @@ msg_task_t MSG_comm_get_task(msg_comm_t comm)
 }
 
 /**
- * \brief This function is called by SIMIX to copy the data of a comm.
+ * \brief This function is called by SIMIX in kernel mode to copy the data of a comm.
  * \param comm the comm
  * \param buff the data copied
  * \param buff_size size of the buffer
index ed1db7b..e295c73 100644 (file)
@@ -122,14 +122,17 @@ static double smpi_bandwidth_factor(double size)
 
   unsigned int iter = 0;
   s_smpi_factor_t fact;
+  double current=1.0;
   xbt_dynar_foreach(smpi_bw_factor, iter, fact) {
-    if (size >= fact.factor) {
-      XBT_DEBUG("%lf >= %ld return %f", size, fact.factor, fact.value);
-      return fact.value;
-    }
+    if (size <= fact.factor) {
+      XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current);
+      return current;
+    }else
+      current=fact.value;
   }
+  XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current);
 
-  return 1.0;
+  return current;
 }
 
 static double smpi_latency_factor(double size)
@@ -140,14 +143,17 @@ static double smpi_latency_factor(double size)
 
   unsigned int iter = 0;
   s_smpi_factor_t fact;
+  double current=1.0;
   xbt_dynar_foreach(smpi_lat_factor, iter, fact) {
-    if (size >= fact.factor) {
-      XBT_DEBUG("%lf >= %ld return %f", size, fact.factor, fact.value);
-      return fact.value;
-    }
+    if (size <= fact.factor) {
+      XBT_DEBUG("%lf <= %ld return %f", size, fact.factor, current);
+      return current;
+    }else
+      current=fact.value;
   }
+  XBT_DEBUG("%lf > %ld return %f", size, fact.factor, current);
 
-  return 1.0;
+  return current;
 }
 
 /**--------- <copy/paste C code snippet in surf/network.c> -----------*/
index 8c2328f..40856a5 100644 (file)
@@ -170,10 +170,8 @@ void xbt_datadesc_preinit(void)
  **/
 void xbt_datadesc_postexit(void)
 {
-  XBT_VERB("Exiting DataDesc");
   xbt_set_free(&xbt_datadesc_set_local);
   xbt_dict_free(&xbt_dd_constants);
-  XBT_DEBUG("Exited DataDesc");
 }
 
 /** This is mainly to debug */