Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
authorMartin Quinson <martin.quinson@loria.fr>
Tue, 19 Jan 2016 11:40:28 +0000 (12:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 19 Jan 2016 11:40:28 +0000 (12:40 +0100)
examples/simdag/test_simdag.tesh
src/simdag/sd_workstation.cpp
src/smpi/smpi_replay.c

index d81c786..5da3a1b 100644 (file)
@@ -15,6 +15,6 @@ $ $SG_TEST_EXENV ./sd_test ${srcdir:=.}/../platforms/platform.xml
 > [0.000000] [sd_test/INFO] Route latency = 0.070615, route bandwidth = 472125.000000
 > [0.000000] [sd_test/INFO] Communication time for 2000000.000000 bytes between Jacquelin and Intel: 4.306781
 > [0.000000] [sd_test/INFO] Communication time for 3000000.000000 bytes between Intel and Jacquelin: 6.424864
-> [0.000000] [sd_test/INFO] Estimated time for 'Task D': 6.432146
+> [0.000000] [sd_test/INFO] Estimated time for 'Task D': 6.502761
 > [21.322061] [sd_test/INFO] Task 'Task D' start time: 0.000000, finish time: 10.661030
 > [21.322061] [sd_test/INFO] Task 'Task B' start time: 10.661030, finish time: 21.322061
index 45ab192..d40c185 100644 (file)
@@ -296,30 +296,20 @@ double SD_workstation_get_computation_time(SD_workstation_t workstation,
 }
 
 /**
- * \brief Returns the latency of the route between two workstations, i.e. the sum of all link latencies
- * between the workstations.
+ * \brief Returns the latency of the route between two workstations.
  *
  * \param src the first workstation
  * \param dst the second workstation
  * \return the latency of the route between the two workstations (in seconds)
  * \see SD_route_get_current_bandwidth()
  */
-double SD_route_get_current_latency(SD_workstation_t src,
-                                    SD_workstation_t dst)
+double SD_route_get_current_latency(SD_workstation_t src, SD_workstation_t dst)
 {
-
-  const SD_link_t *links;
-  int nb_links;
+  xbt_dynar_t route = NULL;
   double latency;
-  int i;
 
-  links = SD_route_get_list(src, dst);
-  nb_links = SD_route_get_size(src, dst);
-  latency = 0.0;
-
-  for (i = 0; i < nb_links; i++) {
-    latency += SD_link_get_current_latency(links[i]);
-  }
+  routing_platf->getRouteAndLatency(src->pimpl_netcard, dst->pimpl_netcard,
+                                    &route, &latency);
 
   return latency;
 }
@@ -376,6 +366,7 @@ double SD_route_get_communication_time(SD_workstation_t src,
      transmission time of a link = communication amount / link bandwidth */
 
   const SD_link_t *links;
+  xbt_dynar_t route = NULL;
   int nb_links;
   double bandwidth, min_bandwidth;
   double latency;
@@ -387,13 +378,14 @@ double SD_route_get_communication_time(SD_workstation_t src,
   if (bytes_amount == 0.0)
     return 0.0;
 
+  routing_platf->getRouteAndLatency(src->pimpl_netcard, dst->pimpl_netcard,
+                                    &route, &latency);
+
   links = SD_route_get_list(src, dst);
   nb_links = SD_route_get_size(src, dst);
   min_bandwidth = -1.0;
-  latency = 0;
 
   for (i = 0; i < nb_links; i++) {
-    latency += SD_link_get_current_latency(links[i]);
     bandwidth = SD_link_get_current_bandwidth(links[i]);
     if (bandwidth < min_bandwidth || min_bandwidth == -1.0)
       min_bandwidth = bandwidth;
index ef4cc43..d92975d 100644 (file)
@@ -636,20 +636,23 @@ static void action_allReduce(const char *const *action) {
 }
 
 static void action_allToAll(const char *const *action) {
+  CHECK_ACTION_PARAMS(action, 2, 2); //two mandatory (send and recv volumes)
+                                     //two optional (corresponding datatypes)
   double clock = smpi_process_simulated_elapsed();
   int comm_size = smpi_comm_size(MPI_COMM_WORLD);
   int send_size = parse_double(action[2]);
   int recv_size = parse_double(action[3]);
   MPI_Datatype MPI_CURRENT_TYPE2;
 
-  if(action[4]) {
+  if(action[4] && action[5]) {
     MPI_CURRENT_TYPE=decode_datatype(action[4]);
     MPI_CURRENT_TYPE2=decode_datatype(action[5]);
   }
-  else {
+  else{
     MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
+
   void *send = smpi_get_tmp_sendbuffer(send_size*comm_size* smpi_datatype_size(MPI_CURRENT_TYPE));
   void *recv = smpi_get_tmp_recvbuffer(recv_size*comm_size* smpi_datatype_size(MPI_CURRENT_TYPE2));
 
@@ -749,7 +752,7 @@ static void action_gatherv(const char *const *action) {
   int i=0,recv_sum=0;
 
   MPI_Datatype MPI_CURRENT_TYPE2;
-  if(action[4+comm_size]) {
+  if(action[4+comm_size] && action[5+comm_size]) {
     MPI_CURRENT_TYPE=decode_datatype(action[4+comm_size]);
     MPI_CURRENT_TYPE2=decode_datatype(action[5+comm_size]);
   } else {
@@ -877,9 +880,9 @@ static void action_allgather(const char *const *action) {
 
   MPI_Datatype MPI_CURRENT_TYPE2;
 
-  if(action[4]) {
-    MPI_CURRENT_TYPE = decode_datatype(action[3]);
-    MPI_CURRENT_TYPE2 = decode_datatype(action[4]);
+  if(action[4] && action[5]) {
+    MPI_CURRENT_TYPE = decode_datatype(action[4]);
+    MPI_CURRENT_TYPE2 = decode_datatype(action[5]);
   } else {
     MPI_CURRENT_TYPE = MPI_DEFAULT_TYPE;
     MPI_CURRENT_TYPE2 = MPI_DEFAULT_TYPE;    
@@ -930,7 +933,7 @@ static void action_allgatherv(const char *const *action) {
   int recv_sum=0;  
   MPI_Datatype MPI_CURRENT_TYPE2;
 
-  if(action[3+comm_size]) {
+  if(action[3+comm_size] && action[4+comm_size]) {
     MPI_CURRENT_TYPE = decode_datatype(action[3+comm_size]);
     MPI_CURRENT_TYPE2 = decode_datatype(action[4+comm_size]);
   } else {
@@ -995,13 +998,13 @@ static void action_allToAllv(const char *const *action) {
 
   send_buf_size=parse_double(action[2]);
   recv_buf_size=parse_double(action[3+comm_size]);
-  if(action[4+2*comm_size]) {
+  if(action[4+2*comm_size] && action[5+2*comm_size]) {
     MPI_CURRENT_TYPE=decode_datatype(action[4+2*comm_size]);
     MPI_CURRENT_TYPE2=decode_datatype(action[5+2*comm_size]);
   }
-  else {
-      MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
-      MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
+  else{
+    MPI_CURRENT_TYPE=MPI_DEFAULT_TYPE;
+    MPI_CURRENT_TYPE2=MPI_DEFAULT_TYPE;
   }
 
   void *sendbuf = smpi_get_tmp_sendbuffer(send_buf_size* smpi_datatype_size(MPI_CURRENT_TYPE));