Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill another dummy function
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Jan 2016 00:36:57 +0000 (01:36 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Wed, 27 Jan 2016 00:36:57 +0000 (01:36 +0100)
examples/simdag/scheduling/minmin_test.c
examples/simdag/sd_test.c
include/simgrid/simdag.h
src/simdag/sd_task.cpp
src/simdag/sd_workstation.cpp

index 560f981..10ae769 100644 (file)
@@ -116,10 +116,16 @@ static double finish_on_at(SD_task_t task, sg_host_t workstation)
         grand_parent_workstation_list =
             SD_task_get_workstation_list(grand_parent);
         /* Estimate the redistribution time from this parent */
         grand_parent_workstation_list =
             SD_task_get_workstation_list(grand_parent);
         /* Estimate the redistribution time from this parent */
-        redist_time =
-            SD_route_get_communication_time(grand_parent_workstation_list
-                                            [0], workstation,
-                                            SD_task_get_amount(parent));
+        if (SD_task_get_amount(parent) == 0){
+          redist_time= 0;
+        } else {
+          redist_time =
+            SD_route_get_latency(grand_parent_workstation_list[0],
+                                 workstation) +
+            SD_task_get_amount(parent) /
+            SD_route_get_bandwidth(grand_parent_workstation_list[0],
+                                 workstation);
+        }
         data_available =
             SD_task_get_finish_time(grand_parent) + redist_time;
 
         data_available =
             SD_task_get_finish_time(grand_parent) + redist_time;
 
index d773d39..2f236a6 100644 (file)
@@ -78,10 +78,12 @@ int main(int argc, char **argv)
         SD_route_get_bandwidth(w1, w2));
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
         SD_route_get_bandwidth(w1, w2));
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount12, name1, name2,
-        SD_route_get_communication_time(w1, w2, communication_amount12));
+        SD_route_get_latency(w1, w2) +
+        communication_amount12 / SD_route_get_bandwidth(w1, w2));
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount21, name2, name1,
   XBT_INFO("Communication time for %f bytes between %s and %s: %f",
         communication_amount21, name2, name1,
-        SD_route_get_communication_time(w2, w1, communication_amount21));
+        SD_route_get_latency(w2, w1) +
+        communication_amount21 / SD_route_get_bandwidth(w2, w1));
 
   /* creation of the tasks and their dependencies */
   taskA = SD_task_create("Task A", NULL, 10.0);
 
   /* creation of the tasks and their dependencies */
   taskA = SD_task_create("Task A", NULL, 10.0);
index 7d2ac9e..0fcdfbd 100644 (file)
@@ -95,9 +95,6 @@ XBT_PUBLIC(int) SD_route_get_size(sg_host_t src, sg_host_t dst);
 
 XBT_PUBLIC(double) SD_route_get_latency(sg_host_t src, sg_host_t dst);
 XBT_PUBLIC(double) SD_route_get_bandwidth(sg_host_t src, sg_host_t dst);
 
 XBT_PUBLIC(double) SD_route_get_latency(sg_host_t src, sg_host_t dst);
 XBT_PUBLIC(double) SD_route_get_bandwidth(sg_host_t src, sg_host_t dst);
-XBT_PUBLIC(double) SD_route_get_communication_time(sg_host_t src,
-                                                   sg_host_t dst,
-                                                   double bytes_amount);
 
 XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
 /** @} */
 
 XBT_PUBLIC(const char*) SD_storage_get_host(SD_storage_t storage);
 /** @} */
index 828ac09..9309197 100644 (file)
@@ -904,12 +904,13 @@ double SD_task_get_execution_time(SD_task_t task,
 
     if (bytes_amount != NULL)
       for (j = 0; j < workstation_nb; j++) {
 
     if (bytes_amount != NULL)
       for (j = 0; j < workstation_nb; j++) {
-        time +=
-            SD_route_get_communication_time(workstation_list[i],
-                                            workstation_list[j],
-                                            bytes_amount[i *
-                                                                 workstation_nb
-                                                                 + j]);
+        if (bytes_amount[i * workstation_nb + j] !=0 ) {
+          time += (SD_route_get_latency(workstation_list[i],
+                                        workstation_list[j]) +
+                   bytes_amount[i * workstation_nb + j] /
+                   SD_route_get_bandwidth(workstation_list[i],
+                                          workstation_list[j]));
+        }
       }
 
     if (time > max_time) {
       }
 
     if (time > max_time) {
index 8caaff5..8334329 100644 (file)
@@ -129,31 +129,6 @@ double SD_route_get_bandwidth(sg_host_t src, sg_host_t dst)
   return min_bandwidth;
 }
 
   return min_bandwidth;
 }
 
-/**
- * \brief Returns an approximative estimated time for the given
- * communication amount between two hosts
- *
- * \param src the first host
- * \param dst the second host
- * \param bytes_amount the communication amount you want to evaluate (in bytes)
- * \return an approximative estimated communication time for the given bytes amount
- * between the workstations (in seconds)
- */
-double SD_route_get_communication_time(sg_host_t src,sg_host_t dst,
-                                       double bytes_amount)
-{
-  /* total time = latency + transmission time of the slowest link
-     transmission time of a link = communication amount / link bandwidth */
-
-  xbt_assert(bytes_amount >= 0, "bytes_amount must be greater than or equal to zero");
-
-
-  if (bytes_amount == 0.0)
-    return 0.0;
-
-  return SD_route_get_latency(src, dst) +
-          (bytes_amount / SD_route_get_bandwidth(src,dst));
-}
 
 /**
  * \brief Returns the host name the storage is attached to
 
 /**
  * \brief Returns the host name the storage is attached to