From: Pierre Veyre Date: Thu, 13 Mar 2014 14:21:56 +0000 (+0100) Subject: Use surf_parse_error() rather than xbt_die() during surf parsing X-Git-Tag: v3_11~217 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/97c23c35d161c99ba16870289149a69583e40abc?hp=ca7e44eedb71bed5a09556bdd8e3fa13be21c9ce Use surf_parse_error() rather than xbt_die() during surf parsing --- diff --git a/src/surf/network_smpi.cpp b/src/surf/network_smpi.cpp index e9dea0e30a..68174dae76 100644 --- a/src/surf/network_smpi.cpp +++ b/src/surf/network_smpi.cpp @@ -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); diff --git a/src/surf/surf_routing.cpp b/src/surf/surf_routing.cpp index 93a3ca0fcd..f62f852947 100644 --- a/src/surf/surf_routing.cpp +++ b/src/surf/surf_routing.cpp @@ -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; } diff --git a/src/surf/surf_routing_dijkstra.cpp b/src/surf/surf_routing_dijkstra.cpp index 48a3ae2a29..805dd10299 100644 --- a/src/surf/surf_routing_dijkstra.cpp +++ b/src/surf/surf_routing_dijkstra.cpp @@ -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; diff --git a/src/surf/surf_routing_floyd.cpp b/src/surf/surf_routing_floyd.cpp index f116c4e8cc..18d3c9ef66 100644 --- a/src/surf/surf_routing_floyd.cpp +++ b/src/surf/surf_routing_floyd.cpp @@ -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())) diff --git a/src/surf/surf_routing_full.cpp b/src/surf/surf_routing_full.cpp index 79c2a4b202..d00fdb8f1f 100644 --- a/src/surf/surf_routing_full.cpp +++ b/src/surf/surf_routing_full.cpp @@ -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()); diff --git a/src/surf/surfxml_parseplatf.c b/src/surf/surfxml_parseplatf.c index 198b74563c..2c93389049 100644 --- a/src/surf/surfxml_parseplatf.c +++ b/src/surf/surfxml_parseplatf.c @@ -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); }