X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2fe78f8bc84b3da9ec09542499edeb2189227f61..b356ce9a510410f879eb3cd1b16b33856aebfdbe:/src/surf/instr_routing.cpp diff --git a/src/surf/instr_routing.cpp b/src/surf/instr_routing.cpp index 2eb79f75d5..89e978735f 100644 --- a/src/surf/instr_routing.cpp +++ b/src/surf/instr_routing.cpp @@ -8,6 +8,7 @@ #include "simgrid/s4u/engine.hpp" #include "simgrid/s4u/host.hpp" + #include "src/kernel/routing/NetZoneImpl.hpp" #include "src/surf/network_interface.hpp" #include "src/surf/xml/platf_private.hpp" @@ -205,7 +206,7 @@ void sg_instr_AS_end() } } -static void instr_routing_parse_start_link(simgrid::surf::Link* link) +static void instr_routing_parse_start_link(simgrid::surf::LinkImpl* link) { if (currentContainer.empty()) // No ongoing parsing. Are you creating the loopback? return; @@ -214,7 +215,7 @@ static void instr_routing_parse_start_link(simgrid::surf::Link* link) double bandwidth_value = link->bandwidth(); double latency_value = link->latency(); - container_t container = PJ_container_new(link->getName(), INSTR_LINK, father); + container_t container = PJ_container_new(link->cname(), INSTR_LINK, father); if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) { type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type); @@ -297,10 +298,12 @@ void sg_instr_new_host(simgrid::s4u::Host& host) } -void sg_instr_new_router(sg_platf_router_cbarg_t router) +void sg_instr_new_router(const char* name) { - container_t father = currentContainer.back(); - PJ_container_new (router->id, INSTR_ROUTER, father); + if (TRACE_is_enabled() && TRACE_needs_platform()) { + container_t father = currentContainer.back(); + PJ_container_new(name, INSTR_ROUTER, father); + } } static void instr_routing_parse_end_platform () @@ -321,8 +324,8 @@ void instr_routing_define_callbacks () //always need the call backs to ASes (we need only the root AS), //to create the rootContainer and the rootType properly if (!TRACE_needs_platform()) return; - simgrid::surf::Link::onCreation.connect(instr_routing_parse_start_link); - simgrid::surf::on_postparse.connect(instr_routing_parse_end_platform); + simgrid::surf::LinkImpl::onCreation.connect(instr_routing_parse_start_link); + simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform); } /*