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 b2b9c45..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 {
@@ -137,10 +136,10 @@ void AsCluster::getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)
 }
 
 void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id, int , int position){
-  s_sg_platf_link_cbarg_t link = SG_PLATF_LINK_INITIALIZER;
   s_surf_parsing_link_up_down_t info;
   char* link_id = bprintf("%s_link_%d", cluster->id, id);
 
+  s_sg_platf_link_cbarg_t link;
   memset(&link, 0, sizeof(link));
   link.id = link_id;
   link.bandwidth = cluster->bw;
@@ -150,14 +149,13 @@ void AsCluster::create_links_for_node(sg_platf_cluster_cbarg_t cluster, int id,
 
   if (link.policy == SURF_LINK_FULLDUPLEX) {
     char *tmp_link = bprintf("%s_UP", link_id);
-    info.link_up = sg_link_by_name(tmp_link);
+    info.link_up = Link::byName(tmp_link);
     xbt_free(tmp_link);
     tmp_link = bprintf("%s_DOWN", link_id);
-    info.link_down = sg_link_by_name(tmp_link);
+    info.link_down = Link::byName(tmp_link);
     xbt_free(tmp_link);
   } else {
-    info.link_up = sg_link_by_name(link_id);
-    info.link_down = info.link_up;
+    info.link_up = info.link_down = Link::byName(link_id);
   }
   xbt_dynar_set(privateLinks_, position, &info);
   xbt_free(link_id);