Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Create a (fake) simcall for creating a process directly from a simgrid::simix...
[simgrid.git] / src / surf / AsCluster.cpp
index cd79138..a42c765 100644 (file)
@@ -9,8 +9,7 @@
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_cluster, surf, "Routing part of surf");
 
 /* This routing is specifically setup to represent clusters, aka homogeneous sets of machines
- * Note that a router is created, easing the interconnexion with the rest of the world.
- */
+ * Note that a router is created, easing the interconnexion with the rest of the world. */
 
 namespace simgrid {
 namespace surf {
@@ -32,7 +31,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
 
     if((src->id() == dst->id()) && has_loopback_  ){
       info = xbt_dynar_get_as(privateLinks_, src->id() * nb_links_per_node_, s_surf_parsing_link_up_down_t);
-      route->link_list.push_back(info.link_up);
+      route->link_list->push_back(info.link_up);
       if (lat)
         *lat += info.link_up->getLatency();
       return;
@@ -41,12 +40,12 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
 
     if (has_limiter_){          // limiter for sender
       info = xbt_dynar_get_as(privateLinks_, src->id() * nb_links_per_node_ + has_loopback_, s_surf_parsing_link_up_down_t);
-      route->link_list.push_back((Link*)info.link_up);
+      route->link_list->push_back((Link*)info.link_up);
     }
 
     info = xbt_dynar_get_as(privateLinks_, src->id() * nb_links_per_node_ + has_loopback_ + has_limiter_, s_surf_parsing_link_up_down_t);
     if (info.link_up) {         // link up
-      route->link_list.push_back(info.link_up);
+      route->link_list->push_back(info.link_up);
       if (lat)
         *lat += info.link_up->getLatency();
     }
@@ -54,7 +53,7 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
   }
 
   if (backbone_) {
-    route->link_list.push_back(backbone_);
+    route->link_list->push_back(backbone_);
     if (lat)
       *lat += backbone_->getLatency();
   }
@@ -63,19 +62,20 @@ void AsCluster::getRouteAndLatency(NetCard *src, NetCard *dst, sg_platf_route_cb
     info = xbt_dynar_get_as(privateLinks_, dst->id() * nb_links_per_node_ + has_loopback_ + has_limiter_, s_surf_parsing_link_up_down_t);
 
     if (info.link_down) {       // link down
-      route->link_list.push_back(info.link_down);
+      route->link_list->push_back(info.link_down);
       if (lat)
         *lat += info.link_down->getLatency();
     }
     if (has_limiter_){          // limiter for receiver
         info = xbt_dynar_get_as(privateLinks_, dst->id() * nb_links_per_node_ + has_loopback_, s_surf_parsing_link_up_down_t);
-        route->link_list.push_back(info.link_up);
+        route->link_list->push_back(info.link_up);
     }
   }
 }
 
 void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 {
+  int isrc;
   int table_size = xbt_dynar_length(vertices_);
 
   NetCard *src;
@@ -95,7 +95,7 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
     new_xbt_graph_edge(graph, routerNode, backboneNode, edges);
   }
 
-  for (int isrc = 0; isrc < table_size; isrc++) {
+  for (isrc = 0; isrc < table_size; isrc++) {
     src = xbt_dynar_get_as(vertices_, isrc, NetCard*);
 
     if (! src->isRouter()) {