Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
start refreshing and fixing the GTNetS interface (WIP)
[simgrid.git] / src / surf / surf_routing_dijkstra.cpp
index 48a3ae2..57d39b9 100644 (file)
@@ -176,7 +176,7 @@ void AsDijkstra::addLoopback() {
 
 xbt_dynar_t AsDijkstra::getOnelinkRoutes()
 {
-  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free);
+  xbt_dynar_t ret = xbt_dynar_new(sizeof(OnelinkPtr), xbt_free_f);
   sg_platf_route_cbarg_t route = xbt_new0(s_sg_platf_route_cbarg_t,1);
   route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t),NULL);
 
@@ -256,7 +256,7 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
     xbt_dynar_foreach(links, cpt, link) {
       xbt_dynar_unshift(route->link_list, &link);
       if (lat)
-        *lat += static_cast<NetworkLinkPtr>(link)->getLatency();
+        *lat += static_cast<Link*>(link)->getLatency();
     }
 
   }
@@ -278,7 +278,7 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
     int nr_nodes = xbt_dynar_length(nodes);
     cost_arr = xbt_new0(double, nr_nodes);      /* link cost from src to other hosts */
     pred_arr = xbt_new0(int, nr_nodes); /* predecessors in path from src */
-    pqueue = xbt_heap_new(nr_nodes, xbt_free);
+    pqueue = xbt_heap_new(nr_nodes, xbt_free_f);
 
     /* initialize */
     cost_arr[src_node_id] = 0.0;
@@ -364,7 +364,7 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
       xbt_dynar_foreach(links, cpt, link) {
         xbt_dynar_insert_at(route->link_list, pos, &link);
         if (lat)
-          *lat += static_cast<NetworkLinkPtr>(link)->getLatency();
+          *lat += static_cast<Link*>(link)->getLatency();
         pos++;
       }
     }
@@ -373,7 +373,7 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
     xbt_dynar_foreach(links, cpt, link) {
       xbt_dynar_unshift(route->link_list, &link);
       if (lat)
-        *lat += static_cast<NetworkLinkPtr>(link)->getLatency();
+        *lat += static_cast<Link*>(link)->getLatency();
     }
     size++;
   }
@@ -398,8 +398,8 @@ void AsDijkstra::getRouteAndLatency(RoutingEdgePtr src, RoutingEdgePtr dst, sg_p
 
 AsDijkstra::~AsDijkstra()
 {
-  xbt_graph_free_graph(p_routeGraph, &xbt_free,
-      &graph_edge_data_free, &xbt_free);
+  xbt_graph_free_graph(p_routeGraph, &xbt_free_f,
+      &graph_edge_data_free, &xbt_free_f);
   xbt_dict_free(&p_graphNodeMap);
   if (m_cached)
     xbt_dict_free(&p_routeCache);
@@ -475,9 +475,9 @@ void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
         route->gw_src->getName(), dst, route->gw_dst->getName());
     as_route = 1;
     if(route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-      xbt_die("The gw_dst '%s' does not exist!",route->gw_dst->getName());
+      surf_parse_error("The gw_dst '%s' does not exist!",route->gw_dst->getName());
     if(route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-      xbt_die("The gw_src '%s' does not exist!",route->gw_src->getName());
+      surf_parse_error("The gw_src '%s' does not exist!",route->gw_src->getName());
   }
 
   RoutingEdgePtr src_net_elm, dst_net_elm;