Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add a warning if a given route is redefined. It will hopefully help users understandi...
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 3 Feb 2012 14:42:59 +0000 (15:42 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 3 Feb 2012 14:42:59 +0000 (15:42 +0100)
src/surf/surf_routing_full.c

index cc9c541..ceed24a 100644 (file)
@@ -8,6 +8,7 @@
 
 /* Global vars */
 extern routing_global_t global_routing;
 
 /* Global vars */
 extern routing_global_t global_routing;
+extern int surf_parse_lineno;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf");
 
@@ -190,11 +191,15 @@ void model_full_set_route(AS_t rc, const char *src,
                        xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
                        xbt_dynar_push(link_route_to_test,&link);
                }
                        xbt_assert(link,"Link : '%s' doesn't exists.",link_name);
                        xbt_dynar_push(link_route_to_test,&link);
                }
-               xbt_assert(!xbt_dynar_compare(
-                         (void*)TO_ROUTE_FULL(*src_id, *dst_id)->link_list,
-                         (void*)link_route_to_test,
-                         (int_f_cpvoid_cpvoid_t) full_pointer_resource_cmp),
-                         "The route between \"%s\" and \"%s\" already exists. If you are trying to define a reverse route, you must set the symmetrical=no attribute to your routes tags.", src,dst);
+               if (xbt_dynar_compare((void*)TO_ROUTE_FULL(*src_id, *dst_id)->link_list,
+                                             (void*)link_route_to_test,
+                                             (int_f_cpvoid_cpvoid_t) full_pointer_resource_cmp)) {
+                       surf_parse_error("A route between \"%s\" and \"%s\" already exists with a different content. "
+                                                "If you are trying to define a reverse route, you must set the symmetrical=no "
+                                                "attribute to your routes tags.", src,dst);
+               } else {
+                       surf_parse_warn("Ignoring the identical redefinition of the route between \"%s\" and \"%s\"",src,dst);
+               }
        }
        else
        {
        }
        else
        {