Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use surf_parse_error() rather than xbt_die() during surf parsing
authorPierre Veyre <pierre.veyre@cc.in2p3.fr>
Thu, 13 Mar 2014 14:21:56 +0000 (15:21 +0100)
committerPierre Veyre <pierre.veyre@cc.in2p3.fr>
Thu, 13 Mar 2014 14:21:56 +0000 (15:21 +0100)
src/surf/network_smpi.cpp
src/surf/surf_routing.cpp
src/surf/surf_routing_dijkstra.cpp
src/surf/surf_routing_floyd.cpp
src/surf/surf_routing_full.cpp
src/surf/surfxml_parseplatf.c

index e9dea0e..68174da 100644 (file)
@@ -40,7 +40,7 @@ static xbt_dynar_t parse_factor(const char *smpi_coef_string)
 
     radical_elements2 = xbt_str_split(value, ":");
     if (xbt_dynar_length(radical_elements2) != 2)
-      xbt_die("Malformed radical for smpi factor!");
+      surf_parse_error("Malformed radical for smpi factor!");
     fact.factor = atol(xbt_dynar_get_as(radical_elements2, 0, char *));
     fact.value = atof(xbt_dynar_get_as(radical_elements2, 1, char *));
     xbt_dynar_push_as(smpi_factor, s_smpi_factor_t, fact);
index 93a3ca0..f62f852 100644 (file)
@@ -140,7 +140,7 @@ static void parse_S_host_link(sg_platf_host_link_cbarg_t host)
   // If dynar is is greater than edge id and if the host_link is already defined
   if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > info->getId() &&
       xbt_dynar_get_as(current_routing->p_linkUpDownList, info->getId(), void*))
-    xbt_die("Host_link for '%s' is already defined!",host->id);
+       surf_parse_error("Host_link for '%s' is already defined!",host->id);
 
   XBT_DEBUG("Push Host_link for host '%s' to position %d", info->getName(), info->getId());
   xbt_dynar_set_as(current_routing->p_linkUpDownList, info->getId(), s_surf_parsing_link_up_down_t, link_up_down);
@@ -322,7 +322,7 @@ static void routing_parse_trace_connect(sg_platf_trace_connect_cbarg_t trace_con
         xbt_strdup(trace_connect->element), NULL);
     break;
   default:
-    xbt_die("Cannot connect trace %s to %s: kind of trace unknown",
+       surf_parse_error("Cannot connect trace %s to %s: kind of trace unknown",
         trace_connect->trace, trace_connect->element);
     break;
   }
index 48a3ae2..805dd10 100644 (file)
@@ -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;
index f116c4e..18d3c9e 100644 (file)
@@ -177,9 +177,9 @@ void AsFloyd::parseRoute(sg_platf_route_cbarg_t route)
     XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
         route->gw_src->getName(), dst, route->gw_dst->getName());
     if(route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-      xbt_die("The dst_gateway '%s' does not exist!",route->gw_dst->getName());
+      surf_parse_error("The dst_gateway '%s' does not exist!",route->gw_dst->getName());
     if(route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-      xbt_die("The src_gateway '%s' does not exist!",route->gw_src->getName());
+      surf_parse_error("The src_gateway '%s' does not exist!",route->gw_src->getName());
   }
 
   if(TO_FLOYD_LINK(src_net_elm->getId(), dst_net_elm->getId()))
index 79c2a4b..d00fdb8 100644 (file)
@@ -217,11 +217,11 @@ void AsFull::parseRoute(sg_platf_route_cbarg_t route)
       XBT_DEBUG("Load ASroute from \"%s\" to \"%s\"", src, dst);
       if (!route->gw_src ||
           route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-        xbt_die("The src_gateway \"%s\" does not exist!",
+       surf_parse_error("The src_gateway \"%s\" does not exist!",
                 route->gw_src ? route->gw_src->getName() : "(null)");
       if (!route->gw_dst ||
           route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL)
-        xbt_die("The dst_gateway \"%s\" does not exist!",
+       surf_parse_error("The dst_gateway \"%s\" does not exist!",
                 route->gw_dst ? route->gw_dst->getName() : "(null)");
       XBT_DEBUG("ASroute goes from \"%s\" to \"%s\"",
                 route->gw_src->getName(), route->gw_dst->getName());
index 198b745..2c93389 100644 (file)
@@ -119,6 +119,6 @@ void parse_platform_file(const char *file)
   /* Stop the flex parser */
   surf_parse_close();
   if (parse_status)
-    xbt_die("Parse error in %s", file);
+    surf_parse_error("Parse error in %s", file);
 }