Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
The code deal with <ASroute> in the exact same way than <route>. Disturbing
[simgrid.git] / src / surf / surf_routing_dijkstra.cpp
index 0fad741..ec006a6 100644 (file)
@@ -52,7 +52,7 @@ void AsDijkstra::Seal()
     p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
 
   /* Add the loopback if needed */
-  if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE)
+  if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE)
     addLoopback();
 
   /* initialize graph indexes in nodes after graph has been built */
@@ -171,20 +171,20 @@ xbt_dynar_t AsDijkstra::getOneLinkRoutes()
 
   int src,dst;
   NetCard *src_elm, *dst_elm;
-  int table_size = (int)xbt_dynar_length(p_indexNetworkElm);
+  int table_size = (int)xbt_dynar_length(vertices_);
   for(src=0; src < table_size; src++) {
     for(dst=0; dst< table_size; dst++) {
       xbt_dynar_reset(route->link_list);
-      src_elm = xbt_dynar_get_as(p_indexNetworkElm, src, NetCard*);
-      dst_elm = xbt_dynar_get_as(p_indexNetworkElm, dst, NetCard*);
+      src_elm = xbt_dynar_get_as(vertices_, src, NetCard*);
+      dst_elm = xbt_dynar_get_as(vertices_, dst, NetCard*);
       this->getRouteAndLatency(src_elm, dst_elm,route, NULL);
 
       if (xbt_dynar_length(route->link_list) == 1) {
         void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
         Onelink *onelink;
-        if (p_hierarchy == SURF_ROUTING_BASE)
+        if (hierarchy_ == SURF_ROUTING_BASE)
           onelink = new Onelink(link, src_elm, dst_elm);
-        else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
+        else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
           onelink = new Onelink(link, route->gw_src, route->gw_dst);
         else
           onelink = new Onelink(link, NULL, NULL);
@@ -341,7 +341,7 @@ void AsDijkstra::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_c
     if (v == dst_node_id)
       first_gw = gw_dst;
 
-    if (p_hierarchy == SURF_ROUTING_RECURSIVE && v != dst_node_id
+    if (hierarchy_ == SURF_ROUTING_RECURSIVE && v != dst_node_id
         && strcmp(gw_dst->getName(), prev_gw_src->getName())) {
       xbt_dynar_t e_route_as_to_as=NULL;
 
@@ -367,7 +367,7 @@ void AsDijkstra::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_c
     size++;
   }
 
-  if (p_hierarchy == SURF_ROUTING_RECURSIVE) {
+  if (hierarchy_ == SURF_ROUTING_RECURSIVE) {
     route->gw_src = gw_src;
     route->gw_dst = first_gw;
   }
@@ -403,14 +403,6 @@ AsDijkstra::AsDijkstra(const char*name, bool cached)
   p_routeGraph = NULL;
   p_graphNodeMap = NULL;
   p_routeCache = NULL;
-  /*new_component->generic_routing.parse_route = model_dijkstra_both_parse_route;
-  new_component->generic_routing.parse_ASroute = model_dijkstra_both_parse_route;
-  new_component->generic_routing.get_route_and_latency = dijkstra_get_route_and_latency;
-  new_component->generic_routing.get_onelink_routes =
-      dijkstra_get_onelink_routes;
-  new_component->generic_routing.get_graph = generic_get_graph;
-  new_component->generic_routing.finalize = dijkstra_finalize;
-  new_component->cached = cached;*/
 }
 
 void AsDijkstra::end()
@@ -429,7 +421,7 @@ void AsDijkstra::end()
     p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
 
   /* Add the loopback if needed */
-  if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE)
+  if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE)
     addLoopback();
 
   /* initialize graph indexes in nodes after graph has been built */
@@ -442,11 +434,6 @@ void AsDijkstra::end()
 
 }
 
-void AsDijkstra::parseASroute(sg_platf_route_cbarg_t route)
-{
-  parseRoute(route);
-}
-
 void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
 {
   char *src = (char*)(route->src);
@@ -482,7 +469,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
   if (m_cached && !p_routeCache)
     p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
 
-  sg_platf_route_cbarg_t e_route = newExtendedRoute(p_hierarchy, route, 1);
+  sg_platf_route_cbarg_t e_route = newExtendedRoute(hierarchy_, route, 1);
   newRoute(src_net_elm->getId(), dst_net_elm->getId(), e_route);
 
   // Symmetrical YES
@@ -511,7 +498,7 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
       route->gw_src = route->gw_dst;
       route->gw_dst = gw_tmp;
     }
-    sg_platf_route_cbarg_t link_route_back = newExtendedRoute(p_hierarchy, route, 0);
+    sg_platf_route_cbarg_t link_route_back = newExtendedRoute(hierarchy_, route, 0);
     newRoute(dst_net_elm->getId(), src_net_elm->getId(), link_route_back);
   }
   xbt_dynar_free(&route->link_list);