This is part of the removal of all trace-related pimpl all over the
code of MSG (my goal is to kill MSG_process_cleanup_from_SIMIX() all
together).
Note that I changed from Container::by_name() to
Container::by_name_or_null. It seems that not all actors have a
container by their name, not sure why.
Container* Container::by_name(std::string name)
{
Container* ret = Container::by_name_or_null(name);
- if (ret == nullptr)
- THROWF(tracing_error, 1, "container with name %s not found", name.c_str());
+ xbt_assert(ret != nullptr, "container with name %s not found", name.c_str());
return ret;
}
if (TRACE_actor_is_enabled()) {
simgrid::s4u::Actor::on_creation.connect(instr_actor_on_creation);
+ simgrid::s4u::Actor::on_destruction.connect([](simgrid::s4u::ActorPtr actor) {
+ auto container = simgrid::instr::Container::by_name_or_null(instr_pid(actor.get()));
+ if (container != nullptr)
+ container->remove_from_parent();
+ });
simgrid::s4u::Actor::on_suspend.connect([](simgrid::s4u::ActorPtr actor) {
simgrid::instr::Container::by_name(instr_pid(actor.get()))->get_state("ACTOR_STATE")->push_event("suspend");
});
*/
void MSG_process_cleanup_from_SIMIX(smx_actor_t smx_actor)
{
- if (TRACE_actor_is_enabled())
- simgrid::instr::Container::by_name(instr_pid(smx_actor->ciface()))->remove_from_parent();
-
// free the data if a function was provided
void* userdata = smx_actor->get_user_data();
if (userdata && msg_global->process_data_cleanup) {