/*
* Callbacks
*/
-void sg_instr_AS_begin(sg_platf_AS_cbarg_t AS)
+static void sg_instr_AS_begin(simgrid::s4u::NetZone& netzone)
{
- const char*id = AS->id;
+ const char* id = netzone.name();
if (PJ_container_get_root() == nullptr){
PJ_container_alloc ();
}
}
-void sg_instr_AS_end()
+static void sg_instr_AS_end(simgrid::s4u::NetZone& /*netzone*/)
{
if (TRACE_needs_platform()){
currentContainer.pop_back();
container_t container = PJ_container_new(link.name(), INSTR_LINK, father);
- if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_link())) {
+ if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_link())) {
type_t bandwidth = PJ_type_get_or_null("bandwidth", container->type);
if (bandwidth == nullptr) {
bandwidth = PJ_type_variable_new("bandwidth", nullptr, container->type);
}
}
-void sg_instr_new_host(simgrid::s4u::Host& host)
+static void sg_instr_new_host(simgrid::s4u::Host& host)
{
container_t father = currentContainer.back();
container_t container = PJ_container_new(host.cname(), INSTR_HOST, father);
- if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (! TRACE_disable_speed())) {
+ if ((TRACE_categorized() || TRACE_uncategorized() || TRACE_platform()) && (not TRACE_disable_speed())) {
type_t speed = PJ_type_get_or_null ("power", container->type);
if (speed == nullptr){
speed = PJ_type_variable_new ("power", nullptr, container->type);
{
//always need the call backs to ASes (we need only the root AS),
//to create the rootContainer and the rootType properly
- if (not TRACE_is_enabled() || not TRACE_needs_platform())
+ if (not TRACE_is_enabled())
return;
- simgrid::s4u::Link::onCreation.connect(instr_routing_parse_start_link);
- simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
+ if (TRACE_needs_platform()) {
+ simgrid::s4u::Link::onCreation.connect(instr_routing_parse_start_link);
+ simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
+ simgrid::s4u::Host::onCreation.connect(sg_instr_new_host);
+ }
+ simgrid::s4u::NetZone::onCreation.connect(sg_instr_AS_begin);
+ simgrid::s4u::NetZone::onSeal.connect(sg_instr_AS_end);
}
/*