From: degomme Date: Thu, 28 Jul 2016 10:01:38 +0000 (+0200) Subject: Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid X-Git-Tag: v3_14~699^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/7bc01999f5003e51cc1d12f93647999a1a143f23?hp=6b0e0e1b73c15e423659c0844e0a5b67e7c0bed0 Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/simgrid/simgrid --- diff --git a/src/surf/sg_platf.cpp b/src/surf/sg_platf.cpp index 8796ae57d4..1a90883272 100644 --- a/src/surf/sg_platf.cpp +++ b/src/surf/sg_platf.cpp @@ -175,6 +175,7 @@ void sg_platf_new_host(sg_platf_host_cbarg_t host) /** @brief Add a "router" to the network element list */ void sg_platf_new_router(sg_platf_router_cbarg_t router) { + using simgrid::routing::AsCluster; simgrid::routing::AsImpl* current_routing = routing_get_current(); if (current_routing->hierarchy_ == simgrid::routing::AsImpl::RoutingMode::unset) @@ -205,6 +206,10 @@ void sg_platf_new_router(sg_platf_router_cbarg_t router) xbt_lib_set(as_router_lib, router->id, COORD_ASR_LEVEL, (void *) ctn); } + auto cluster = dynamic_cast(current_routing); + if(cluster != nullptr) + cluster->router_ = static_cast(xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL)); + if (TRACE_is_enabled() && TRACE_needs_platform()) sg_instr_new_router(router); } @@ -704,7 +709,6 @@ void sg_platf_new_peer(sg_platf_peer_cbarg_t peer) router.id = router_id; router.coord = peer->coord; sg_platf_new_router(&router); - static_cast(current_routing)->router_ = static_cast(xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL)); XBT_DEBUG(""); sg_platf_new_AS_seal();