Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
don't trust globals to be memset'ed to 0 (and rework a message)
[simgrid.git] / src / surf / surf_routing.c
index 3c055e2..ed2c35d 100644 (file)
@@ -19,7 +19,7 @@ int SURF_WKS_LEVEL;             //Surf workstation level
 int SIMIX_HOST_LEVEL;           //Simix level
 int MSG_HOST_LEVEL;             //Msg level
 int SD_HOST_LEVEL;              //Simdag level
-int COORD_HOST_LEVEL;           //Coordinates level
+int COORD_HOST_LEVEL=0;         //Coordinates level
 int NS3_HOST_LEVEL;             //host node for ns3
 
 xbt_lib_t link_lib;
@@ -107,7 +107,7 @@ static void parse_S_host(sg_platf_host_cbarg_t host)
   if (host->coord && strcmp(host->coord, "")) {
     if (!COORD_HOST_LEVEL)
       xbt_die
-          ("To use coordinates, you must set configuration 'coordinates' to 'yes'");
+          ("To use host coordinates, please add --cfg=coordinates:yes to your command line");
     xbt_dynar_t ctn = xbt_str_split_str(host->coord, " ");
     xbt_dynar_shrink(ctn, 0);
     xbt_lib_set(host_lib, host->id, COORD_HOST_LEVEL, (void *) ctn);
@@ -225,8 +225,8 @@ static void routing_parse_link_ctn(void)
  */
 static void routing_parse_E_route(void)
 {
-  route_extended_t route = xbt_new0(s_route_extended_t, 1);
-  route->generic_route.link_list = link_list;
+  route_t route = xbt_new0(s_route_t, 1);
+  route->link_list = link_list;
   xbt_assert(current_routing->parse_route,
              "no defined method \"set_route\" in \"%s\"",
              current_routing->name);
@@ -241,8 +241,8 @@ static void routing_parse_E_route(void)
  */
 static void routing_parse_E_ASroute(void)
 {
-  route_extended_t e_route = xbt_new0(s_route_extended_t, 1);
-  e_route->generic_route.link_list = link_list;
+  route_t e_route = xbt_new0(s_route_t, 1);
+  e_route->link_list = link_list;
   e_route->src_gateway = xbt_strdup(gw_src);
   e_route->dst_gateway = xbt_strdup(gw_dst);
   xbt_assert(current_routing->parse_ASroute,
@@ -261,8 +261,8 @@ static void routing_parse_E_ASroute(void)
  */
 static void routing_parse_E_bypassRoute(void)
 {
-  route_extended_t e_route = xbt_new0(s_route_extended_t, 1);
-  e_route->generic_route.link_list = link_list;
+  route_t e_route = xbt_new0(s_route_t, 1);
+  e_route->link_list = link_list;
   e_route->src_gateway = xbt_strdup(gw_src);
   e_route->dst_gateway = xbt_strdup(gw_dst);
   xbt_assert(current_routing->parse_bypassroute,
@@ -477,11 +477,11 @@ static void _get_route_and_latency(const char *src, const char *dst,
 
   if (src_father == dst_father) {       /* SURF_ROUTING_BASE */
 
-    route_extended_t e_route = NULL;
+    route_t e_route = NULL;
     if (route) {
       e_route = common_father->get_route(common_father, src, dst);
       xbt_assert(e_route, "no route between \"%s\" and \"%s\"", src, dst);
-      *route = e_route->generic_route.link_list;
+      *route = e_route->link_list;
     }
     if (latency) {
       *latency = common_father->get_latency(common_father, src, dst, e_route);
@@ -496,14 +496,14 @@ static void _get_route_and_latency(const char *src, const char *dst,
 
   } else {                      /* SURF_ROUTING_RECURSIVE */
 
-    route_extended_t e_route_bypass = NULL;
+    route_t e_route_bypass = NULL;
     if (common_father->get_bypass_route)
       e_route_bypass = common_father->get_bypass_route(common_father, src, dst);
 
     xbt_assert(!latency || !e_route_bypass,
                "Bypass cannot work yet with get_latency");
 
-    route_extended_t e_route_cnt = e_route_bypass
+    route_t e_route_cnt = e_route_bypass
         ? e_route_bypass : common_father->get_route(common_father,
                                                     src_father->name,
                                                     dst_father->name);
@@ -554,7 +554,7 @@ static void _get_route_and_latency(const char *src, const char *dst,
     }
 
     if (route) {
-      xbt_dynar_foreach(e_route_cnt->generic_route.link_list, cpt, link) {
+      xbt_dynar_foreach(e_route_cnt->link_list, cpt, link) {
         xbt_dynar_push(*route, &link);
       }
     }
@@ -582,7 +582,7 @@ static void _get_route_and_latency(const char *src, const char *dst,
       }
     }
 
-    generic_free_extended_route(e_route_cnt);
+    generic_free_route(e_route_cnt);
   }
 }