X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b8df87e176f27b25534f27d7e240defa32ca35bc..08e94eb0482589e4b287cbea301b84daf52635bd:/src/instr/instr_platform.cpp diff --git a/src/instr/instr_platform.cpp b/src/instr/instr_platform.cpp index 4def7efe76..4bc1e2c8be 100644 --- a/src/instr/instr_platform.cpp +++ b/src/instr/instr_platform.cpp @@ -132,7 +132,7 @@ static void recursiveGraphExtraction(simgrid::s4u::NetZone* netzone, container_t if (not netzone->get_children().empty()) { // bottom-up recursion for (auto const& nz_son : netzone->get_children()) { - container_t child_container = container->children_.at(nz_son->get_cname()); + container_t child_container = container->children_.at(nz_son->get_name()); recursiveGraphExtraction(nz_son, child_container, filter); } } @@ -160,6 +160,7 @@ static void instr_netzone_on_creation(simgrid::s4u::NetZone& netzone) std::string id = netzone.get_name(); if (simgrid::instr::Container::get_root() == nullptr) { simgrid::instr::NetZoneContainer* root = new simgrid::instr::NetZoneContainer(id, 0, nullptr); + xbt_assert(simgrid::instr::Container::get_root() == root); if (TRACE_smpi_is_enabled()) { simgrid::instr::ContainerType* mpi = root->type_->by_name_or_create("MPI"); @@ -233,7 +234,7 @@ static void instr_host_on_creation(simgrid::s4u::Host& host) static void instr_host_on_speed_change(simgrid::s4u::Host& host) { - simgrid::instr::Container::by_name(host.get_cname()) + simgrid::instr::Container::by_name(host.get_name()) ->get_variable("speed") ->set_event(surf_get_clock(), host.get_core_count() * host.get_available_speed()); } @@ -264,7 +265,7 @@ static void instr_action_on_state_change(simgrid::kernel::resource::Action* acti static void instr_link_on_bandwidth_change(simgrid::s4u::Link& link) { - simgrid::instr::Container::by_name(link.get_cname()) + simgrid::instr::Container::by_name(link.get_name()) ->get_variable("bandwidth") ->set_event(surf_get_clock(), sg_bandwidth_factor * link.get_bandwidth()); } @@ -272,7 +273,7 @@ static void instr_link_on_bandwidth_change(simgrid::s4u::Link& link) static void instr_netpoint_on_creation(simgrid::kernel::routing::NetPoint* netpoint) { if (netpoint->is_router()) - new simgrid::instr::RouterContainer(netpoint->get_cname(), currentContainer.back()); + new simgrid::instr::RouterContainer(netpoint->get_name(), currentContainer.back()); } static void instr_on_platform_created() @@ -305,13 +306,11 @@ static void instr_actor_on_creation(simgrid::s4u::ActorPtr actor) root->type_->by_name_or_create("ACTOR_TASK_LINK", actor_type, actor_type); std::string container_name = instr_pid(actor.get()); - actor->on_exit( - [container_name](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(container_name)->remove_from_parent(); - }, - actor->get_impl()); + actor->on_exit([container_name](bool failed) { + if (failed) + // kill means that this actor no longer exists, let's destroy it + simgrid::instr::Container::by_name(container_name)->remove_from_parent(); + }); } static long long int counter = 0; @@ -429,7 +428,8 @@ void instr_define_callbacks() /* * user categories support */ -static void recursiveNewVariableType(std::string new_typename, std::string color, simgrid::instr::Type* root) +static void recursiveNewVariableType(const std::string& new_typename, const std::string& color, + simgrid::instr::Type* root) { if (root->get_name() == "HOST" || root->get_name() == "VM") root->by_name_or_create(std::string("p") + new_typename, color); @@ -442,13 +442,13 @@ static void recursiveNewVariableType(std::string new_typename, std::string color } } -void instr_new_variable_type(std::string new_typename, std::string color) +void instr_new_variable_type(const std::string& new_typename, const std::string& color) { recursiveNewVariableType(new_typename, color, simgrid::instr::Container::get_root()->type_); } -static void recursiveNewUserVariableType(std::string father_type, std::string new_typename, std::string color, - simgrid::instr::Type* root) +static void recursiveNewUserVariableType(const std::string& father_type, const std::string& new_typename, + const std::string& color, simgrid::instr::Type* root) { if (root->get_name() == father_type) { root->by_name_or_create(new_typename, color); @@ -457,12 +457,14 @@ static void recursiveNewUserVariableType(std::string father_type, std::string ne recursiveNewUserVariableType(father_type, new_typename, color, elm.second); } -void instr_new_user_variable_type(std::string father_type, std::string new_typename, std::string color) +void instr_new_user_variable_type(const std::string& father_type, const std::string& new_typename, + const std::string& color) { recursiveNewUserVariableType(father_type, new_typename, color, simgrid::instr::Container::get_root()->type_); } -static void recursiveNewUserStateType(std::string father_type, std::string new_typename, simgrid::instr::Type* root) +static void recursiveNewUserStateType(const std::string& father_type, const std::string& new_typename, + simgrid::instr::Type* root) { if (root->get_name() == father_type) root->by_name_or_create(new_typename); @@ -471,12 +473,12 @@ static void recursiveNewUserStateType(std::string father_type, std::string new_t recursiveNewUserStateType(father_type, new_typename, elm.second); } -void instr_new_user_state_type(std::string father_type, std::string new_typename) +void instr_new_user_state_type(const std::string& father_type, const std::string& new_typename) { recursiveNewUserStateType(father_type, new_typename, simgrid::instr::Container::get_root()->type_); } -static void recursiveNewValueForUserStateType(std::string type_name, const char* val, std::string color, +static void recursiveNewValueForUserStateType(const std::string& type_name, const char* val, const std::string& color, simgrid::instr::Type* root) { if (root->get_name() == type_name) @@ -486,7 +488,7 @@ static void recursiveNewValueForUserStateType(std::string type_name, const char* recursiveNewValueForUserStateType(type_name, val, color, elm.second); } -void instr_new_value_for_user_state_type(std::string type_name, const char* value, std::string color) +void instr_new_value_for_user_state_type(const std::string& type_name, const char* value, const std::string& color) { recursiveNewValueForUserStateType(type_name, value, color, simgrid::instr::Container::get_root()->type_); } @@ -500,7 +502,7 @@ static void recursiveXBTGraphExtraction(xbt_graph_t graph, std::mapget_children().empty()) { // bottom-up recursion for (auto const& netzone_child : netzone->get_children()) { - container_t child_container = container->children_.at(netzone_child->get_cname()); + container_t child_container = container->children_.at(netzone_child->get_name()); recursiveXBTGraphExtraction(graph, nodes, edges, netzone_child, child_container); } }