allContainers.erase(name_);
}
+void Container::createChild(std::string name, std::string type_name)
+{
+ new Container(name, type_name, this);
+}
+
Container* Container::byNameOrNull(std::string name)
{
auto cont = allContainers.find(name);
StateType* getState(std::string name);
LinkType* getLink(std::string name);
VariableType* getVariable(std::string name);
-
+ void createChild(std::string name, std::string type_name);
static Container* getRoot();
};
if (TRACE_actor_is_enabled()) {
// create new container on the new_host location
- new simgrid::instr::Container(instr_pid(this), "ACTOR", simgrid::instr::Container::byName(new_host->getName()));
-
+ simgrid::instr::Container::byName(new_host->getName())->createChild(instr_pid(this), "ACTOR");
// end link
link->endEvent(simgrid::instr::Container::byName(instr_pid(this)), "M", key);
}
intrusive_ptr_add_ref(process);
/* Tracing the process creation */
if (TRACE_actor_is_enabled())
- new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
- simgrid::instr::Container::byName(process->host->getName()));
-
+ simgrid::instr::Container::byName(process->host->getName())->createChild(instr_pid(process->ciface()), "ACTOR");
/* The onCreation() signal must be delayed until there, where the pid and everything is set */
simgrid::s4u::ActorPtr tmp = process->iface(); // Passing this directly to onCreation will lead to crashes
simgrid::s4u::Actor::onCreation(tmp);
/* Tracing the process creation */
if (TRACE_actor_is_enabled())
- new simgrid::instr::Container(instr_pid(process->ciface()), "ACTOR",
- simgrid::instr::Container::byName(process->host->getName()));
+ simgrid::instr::Container::byName(process->host->getName())->createChild(instr_pid(process->ciface()), "ACTOR");
auto* context = dynamic_cast<simgrid::kernel::context::AttachContext*>(process->context);
if (not context)
father = simgrid::instr::Container::getRoot();
}
xbt_assert(father != nullptr, "Could not find a parent for mpi rank %s at function %s", str.c_str(), __FUNCTION__);
+ father->createChild(str, "MPI");
#if HAVE_PAPI
- container_t container =
-#endif
- new simgrid::instr::Container(str, "MPI", father);
-#if HAVE_PAPI
+ container_t container = simgrid::instr::Container::byName(str);
papi_counter_t counters = smpi_process()->papi_counters();
for (auto const& it : counters) {