-/* Copyright (c) 2010-2018. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2010-2019. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
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<simgrid::instr::ContainerType>("MPI");
std::string container_name = instr_pid(actor.get());
actor->on_exit(
- [container_name](int status, void* actor) {
+ [container_name](int status, void*) {
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();
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");
});