Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
body count++: routing_get_latency_and_bandwidth
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 25 Jan 2016 22:25:24 +0000 (23:25 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 25 Jan 2016 22:25:24 +0000 (23:25 +0100)
src/instr/instr_interface.cpp
src/surf/network_ns3.cpp
src/surf/surf_c_bindings.cpp
src/surf/surf_private.h
src/surf/surf_routing.cpp
src/surf/surf_routing_floyd.cpp
teshsuite/simdag/platforms/flatifier.cpp

index 290bd88..84d70e6 100644 (file)
@@ -6,6 +6,7 @@
 
 #include "simgrid_config.h"
 
 
 #include "simgrid_config.h"
 
+#include "src/surf/network_interface.hpp"
 #include "src/instr/instr_private.h"
 #include "surf/surf.h"
 #include "src/surf/surf_private.h"
 #include "src/instr/instr_private.h"
 #include "surf/surf.h"
 #include "src/surf/surf_private.h"
@@ -370,7 +371,7 @@ static void instr_user_srcdst_variable(double time,
   sg_netcard_t dst_elm = sg_netcard_by_name_or_null(dst);
   if(!dst_elm) xbt_die("Element '%s' not found!",dst);
 
   sg_netcard_t dst_elm = sg_netcard_by_name_or_null(dst);
   if(!dst_elm) xbt_die("Element '%s' not found!",dst);
 
-  routing_get_route_and_latency (src_elm, dst_elm, &route,NULL);
+  routing_platf->getRouteAndLatency (src_elm, dst_elm, &route,NULL);
   unsigned int i;
   surf_cpp_resource_t link;
   xbt_dynar_foreach (route, i, link) {
   unsigned int i;
   surf_cpp_resource_t link;
   xbt_dynar_foreach (route, i, link) {
index 7a62ae1..fd34a63 100644 (file)
@@ -307,8 +307,7 @@ Link* NetworkNS3Model::createLink(const char *name,
 xbt_dynar_t NetworkNS3Model::getRoute(NetCard *src, NetCard *dst)
 {
   xbt_dynar_t route = NULL;
 xbt_dynar_t NetworkNS3Model::getRoute(NetCard *src, NetCard *dst)
 {
   xbt_dynar_t route = NULL;
-  routing_get_route_and_latency(src, dst, &route, NULL);
-  //routing_platf->getRouteAndLatency(src, dst, &route, NULL);
+  routing_platf->getRouteAndLatency(src, dst, &route, NULL);
   return route;
 }
 
   return route;
 }
 
@@ -379,7 +378,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
        xbt_dynar_t route = NULL;
 
 
        xbt_dynar_t route = NULL;
 
-       routing_get_route_and_latency (action->p_srcElm, action->p_dstElm, &route, NULL);
+       routing_platf->getRouteAndLatency (action->p_srcElm, action->p_dstElm, &route, NULL);
        unsigned int i;
        for (i = 0; i < xbt_dynar_length (route); i++){
                NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i));
        unsigned int i;
        for (i = 0; i < xbt_dynar_length (route); i++){
                NetworkNS3Link* link = ((NetworkNS3Link*)xbt_dynar_get_ptr(route, i));
index ea95db4..ce621b9 100644 (file)
@@ -158,11 +158,6 @@ double surf_solve(double max_date)
   return surf_min;
 }
 
   return surf_min;
 }
 
-void routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst,
-                              xbt_dynar_t * route, double *latency){
-  routing_platf->getRouteAndLatency(src, dst, route, latency);
-}
-
 /*********
  * MODEL *
  *********/
 /*********
  * MODEL *
  *********/
index fd5d0c1..aaa141e 100644 (file)
@@ -76,10 +76,6 @@ XBT_PUBLIC(void) routing_register_callbacks(void);
 XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
  // FIXME: make previous function private to routing again?
 
 XBT_PUBLIC(void) generic_free_route(sg_platf_route_cbarg_t route); // FIXME rename to routing_route_free
  // FIXME: make previous function private to routing again?
 
-
-XBT_PUBLIC(void) routing_get_route_and_latency(sg_netcard_t src, sg_netcard_t dst,
-                              xbt_dynar_t * route, double *latency);
-
 XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc);
 /**
  * Resource protected methods
 XBT_PUBLIC(void) generic_get_graph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges, AS_t rc);
 /**
  * Resource protected methods
index c317845..f5cb8aa 100644 (file)
@@ -542,7 +542,7 @@ namespace surf {
  */
 void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, xbt_dynar_t* route, double *latency)
 {
  */
 void RoutingPlatf::getRouteAndLatency(NetCard *src, NetCard *dst, xbt_dynar_t* route, double *latency)
 {
-  XBT_DEBUG("routing_get_route_and_latency from %s to %s", src->getName(), dst->getName());
+  XBT_DEBUG("getRouteAndLatency from %s to %s", src->getName(), dst->getName());
   if (NULL == *route) {
     xbt_dynar_reset(routing_platf->p_lastRoute);
     *route = routing_platf->p_lastRoute;
   if (NULL == *route) {
     xbt_dynar_reset(routing_platf->p_lastRoute);
     *route = routing_platf->p_lastRoute;
index b8674c0..2ece750 100644 (file)
@@ -120,7 +120,7 @@ void AsFloyd::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cbar
 
     if (p_hierarchy == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL
         && strcmp(prev_dst_gw->getName(), e_route->gw_src->getName())) {
 
     if (p_hierarchy == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL
         && strcmp(prev_dst_gw->getName(), e_route->gw_src->getName())) {
-      routing_get_route_and_latency(prev_dst_gw, e_route->gw_src,
+      routing_platf->getRouteAndLatency(prev_dst_gw, e_route->gw_src,
                                     &res->link_list, lat);
     }
 
                                     &res->link_list, lat);
     }
 
index 28c340f..a217844 100644 (file)
@@ -14,7 +14,7 @@
 #include <string.h>
 #include <math.h>
 
 #include <string.h>
 #include <math.h>
 
-
+#include "src/surf/network_interface.hpp"
 #include "simgrid/simdag.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
 #include "simgrid/simdag.h"
 #include "xbt/log.h"
 #include "xbt/dict.h"
@@ -202,7 +202,7 @@ int main(int argc, char **argv)
             ,dst);
         xbt_dynar_t route=NULL;
         value2 = sg_host_by_name(dst)->pimpl_netcard;
             ,dst);
         xbt_dynar_t route=NULL;
         value2 = sg_host_by_name(dst)->pimpl_netcard;
-        routing_get_route_and_latency(value1, value2, &route,NULL);
+        routing_platf->getRouteAndLatency(value1, value2, &route,NULL);
         for(i=0;i<xbt_dynar_length(route) ;i++)
         {
           void *link = xbt_dynar_get_as(route,i,void *);
         for(i=0;i<xbt_dynar_length(route) ;i++)
         {
           void *link = xbt_dynar_get_as(route,i,void *);
@@ -221,7 +221,7 @@ int main(int argc, char **argv)
               ,dst);
           xbt_dynar_t route=NULL;
           value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
               ,dst);
           xbt_dynar_t route=NULL;
           value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
-          routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
+          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);
@@ -247,7 +247,7 @@ int main(int argc, char **argv)
                 ,dst);
             xbt_dynar_t route=NULL;
             value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
                 ,dst);
             xbt_dynar_t route=NULL;
             value2 = (sg_netcard_t)xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
-            routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
+            routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
             for(i=0;i<xbt_dynar_length(route) ;i++)
             {
               void *link = xbt_dynar_get_as(route,i,void *);
             for(i=0;i<xbt_dynar_length(route) ;i++)
             {
               void *link = xbt_dynar_get_as(route,i,void *);
@@ -265,7 +265,7 @@ int main(int argc, char **argv)
               ,src, dst);
           xbt_dynar_t route=NULL;
           value2 = sg_host_by_name(dst)->pimpl_netcard;
               ,src, dst);
           xbt_dynar_t route=NULL;
           value2 = sg_host_by_name(dst)->pimpl_netcard;
-          routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL);
+          routing_platf->getRouteAndLatency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);
           for(i=0;i<xbt_dynar_length(route) ;i++)
           {
             void *link = xbt_dynar_get_as(route,i,void *);