A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cosmetics
[simgrid.git]
/
src
/
surf
/
surf_routing_generic.c
diff --git
a/src/surf/surf_routing_generic.c
b/src/surf/surf_routing_generic.c
index
bfb16f9
..
ce41bac
100644
(file)
--- a/
src/surf/surf_routing_generic.c
+++ b/
src/surf/surf_routing_generic.c
@@
-14,6
+14,8
@@
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_routing_generic, surf_route, "Generic implementation of the surf routing");
+static int no_bypassroute_declared = 1;
+
AS_t model_generic_create_sized(size_t childsize) {
AS_t new_component = model_none_create_sized(childsize);
AS_t model_generic_create_sized(size_t childsize) {
AS_t new_component = model_none_create_sized(childsize);
@@
-81,6
+83,7
@@
void generic_parse_bypassroute(AS_t rc,
xbt_free(e_route);
xbt_dict_set(dict_bypassRoutes, route_name, new_e_route, NULL);
xbt_free(e_route);
xbt_dict_set(dict_bypassRoutes, route_name, new_e_route, NULL);
+ no_bypassroute_declared = 0;
xbt_free(route_name);
}
xbt_free(route_name);
}
@@
-94,6
+97,10
@@
xbt_dynar_t generic_get_onelink_routes(AS_t rc) { // FIXME: kill that stub
route_t generic_get_bypassroute(AS_t rc, const char *src, const char *dst)
{
route_t generic_get_bypassroute(AS_t rc, const char *src, const char *dst)
{
+ // If never set a bypass route return NULL without any further computations
+ if(no_bypassroute_declared)
+ return NULL;
+
xbt_dict_t dict_bypassRoutes = rc->bypassRoutes;
AS_t src_as, dst_as;
int index_src, index_dst;
xbt_dict_t dict_bypassRoutes = rc->bypassRoutes;
AS_t src_as, dst_as;
int index_src, index_dst;