Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "Change those functions to public for use external parser."
[simgrid.git] / src / surf / surf_routing.c
index 92a2675..42a3b98 100644 (file)
@@ -232,7 +232,6 @@ static void parse_S_host(const char *host_id, const char* coord)
   info->rc_type = SURF_NETWORK_ELEMENT_HOST;
   xbt_dict_set(global_routing->where_network_elements, host_id,
                (void *) info, xbt_free);
-
   if (strcmp(coord,"")) {
     xbt_dynar_t ctn = xbt_str_split_str(coord, " ");
     xbt_dynar_shrink(ctn, 0);
@@ -2621,6 +2620,7 @@ static route_extended_t rulebased_get_route(routing_component_t rc,
   int ovector_dst[OVECCOUNT];
   const char **list_src = NULL;
   const char **list_dst = NULL;
+  int res;
   xbt_dynar_foreach(rule_list, cpt, ruleroute) {
     rc_src =
         pcre_exec(ruleroute->re_src, NULL, src, src_length, 0, 0,
@@ -2630,12 +2630,10 @@ static route_extended_t rulebased_get_route(routing_component_t rc,
           pcre_exec(ruleroute->re_dst, NULL, dst, dst_length, 0, 0,
                     ovector_dst, OVECCOUNT);
       if (rc_dst >= 0) {
-        xbt_assert1(!pcre_get_substring_list
-                    (src, ovector_src, rc_src, &list_src),
-                    "error solving substring list for src \"%s\"", src);
-        xbt_assert1(!pcre_get_substring_list
-                    (dst, ovector_dst, rc_dst, &list_dst),
-                    "error solving substring list for src \"%s\"", dst);
+        res = pcre_get_substring_list(src, ovector_src, rc_src, &list_src);
+        xbt_assert1(!res, "error solving substring list for src \"%s\"", src);
+        res = pcre_get_substring_list(dst, ovector_dst, rc_dst, &list_dst);
+        xbt_assert1(!res, "error solving substring list for src \"%s\"", dst);
         char *link_name;
         xbt_dynar_foreach(ruleroute->re_str_link, cpt, link_name) {
           char *new_link_name =
@@ -3394,6 +3392,7 @@ static void routing_parse_Scluster(void)
       SURFXML_BUFFER_SET(host_power, temp_cluster_power);
       SURFXML_BUFFER_SET(host_core, cluster_core);
       SURFXML_BUFFER_SET(host_availability, "1.0");
+      SURFXML_BUFFER_SET(host_coordinates, "");
       xbt_free(availability_file);
       availability_file = bprintf("%s",cluster_availability_file);
       xbt_free(state_file);
@@ -3454,6 +3453,7 @@ static void routing_parse_Scluster(void)
         SURFXML_BUFFER_SET(host_power, temp_cluster_power);
         SURFXML_BUFFER_SET(host_core, cluster_core);
         SURFXML_BUFFER_SET(host_availability, "1.0");
+        SURFXML_BUFFER_SET(host_coordinates, "");
         xbt_free(availability_file);
         availability_file = bprintf("%s",cluster_availability_file);
         xbt_free(state_file);
@@ -3783,6 +3783,7 @@ static void routing_parse_Speer(void)
   SURFXML_BUFFER_SET(host_availability, "1.0");
   SURFXML_BUFFER_SET(host_availability_file, peer_availability_file);
   SURFXML_BUFFER_SET(host_state_file, peer_state_file);
+  SURFXML_BUFFER_SET(host_coordinates, "");
   SURFXML_START_TAG(host);
   SURFXML_END_TAG(host);