X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4fa1717d674d45f694ea8637db1a32afcbd6cc8c..9da45f53bdedff9ac9320a7a3c2ac1d5b9184ce2:/src/instr/instr_platform.cpp diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index 7bbf6bf3c4..0184c25331 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -127,9 +127,9 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t return; } XBT_DEBUG("Graph extraction for NetZone = %s", netzone->get_cname()); - if (not netzone->getChildren()->empty()) { + if (not netzone->get_children()->empty()) { // bottom-up recursion - for (auto const& nz_son : *netzone->getChildren()) { + for (auto const& nz_son : *netzone->get_children()) { container_t child_container = container->children_.at(nz_son->get_cname()); recursiveGraphExtraction(nz_son, child_container, filter); } @@ -229,11 +229,10 @@ static void instr_host_on_speed_change(simgrid::s4u::Host& host) { simgrid::instr::Container::by_name(host.get_cname()) ->get_variable("power") - ->set_event(surf_get_clock(), host.getCoreCount() * host.get_available_speed()); + ->set_event(surf_get_clock(), host.get_core_count() * host.get_available_speed()); } -static void instr_cpu_action_on_state_change(simgrid::surf::CpuAction* action, - simgrid::kernel::resource::Action::State /* previous */) +static void instr_cpu_action_on_state_change(simgrid::surf::CpuAction* action) { simgrid::surf::Cpu* cpu = static_cast(action->get_variable()->get_constraint(0)->get_id()); TRACE_surf_resource_set_utilization("HOST", "power_used", cpu->get_cname(), action->get_category(), @@ -278,13 +277,6 @@ static void instr_on_platform_created() TRACE_paje_dump_buffer(true); } -static void TRACE_actor_kill(smx_process_exit_status_t status, simgrid::s4u::Actor* actor) -{ - if (status == SMX_EXIT_FAILURE) - // kill means that this actor no longer exists, let's destroy it - simgrid::instr::Container::by_name(instr_pid(actor))->remove_from_parent(); -} - static void instr_actor_on_creation(simgrid::s4u::ActorPtr actor) { container_t root = simgrid::instr::Container::get_root(); @@ -302,7 +294,13 @@ static void instr_actor_on_creation(simgrid::s4u::ActorPtr actor) root->type_->by_name_or_create("ACTOR_LINK", actor_type, actor_type); root->type_->by_name_or_create("ACTOR_TASK_LINK", actor_type, actor_type); - actor->on_exit((int_f_pvoid_pvoid_t)TRACE_actor_kill, actor->get_impl()); + actor->on_exit( + [](int status, void* actor) { + if (status == SMX_EXIT_FAILURE) + // kill means that this actor no longer exists, let's destroy it + simgrid::instr::Container::by_name(instr_pid(static_cast(actor)))->remove_from_parent(); + }, + actor->get_impl()); } static long long int counter = 0; @@ -353,12 +351,12 @@ void instr_define_callbacks() simgrid::s4u::Host::on_speed_change.connect(instr_host_on_speed_change); simgrid::s4u::Link::on_creation.connect(instr_link_on_creation); simgrid::s4u::Link::on_bandwidth_change.connect(instr_link_on_bandwidth_change); - simgrid::s4u::NetZone::onSeal.connect([](simgrid::s4u::NetZone& /*netzone*/) { currentContainer.pop_back(); }); + simgrid::s4u::NetZone::on_seal.connect([](simgrid::s4u::NetZone& /*netzone*/) { currentContainer.pop_back(); }); simgrid::kernel::routing::NetPoint::onCreation.connect(instr_netpoint_on_creation); } - simgrid::s4u::NetZone::onCreation.connect(instr_netzone_on_creation); + simgrid::s4u::NetZone::on_creation.connect(instr_netzone_on_creation); - simgrid::surf::CpuAction::onStateChange.connect(instr_cpu_action_on_state_change); + simgrid::surf::CpuAction::on_state_change.connect(instr_cpu_action_on_state_change); simgrid::s4u::Link::on_communication_state_change.connect(instr_link_on_communication_state_change); if (TRACE_actor_is_enabled()) { @@ -468,9 +466,9 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::map* edges, sg_netzone_t netzone, container_t container) { - if (not netzone->getChildren()->empty()) { + if (not netzone->get_children()->empty()) { // bottom-up recursion - for (auto const& netzone_child : *netzone->getChildren()) { + for (auto const& netzone_child : *netzone->get_children()) { container_t child_container = container->children_.at(netzone_child->get_cname()); recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container); }