Engine::Engine(int *argc, char **argv) {
xbt_assert(s4u::Engine::instance_ == nullptr, "It is currently forbidden to create more than one instance of s4u::Engine");
s4u::Engine::instance_ = this;
- // pimpl = new kernel::EngineImpl();
+ pimpl = new kernel::EngineImpl();
TRACE_global_init(argc, argv);
SIMIX_global_init(argc, argv);
break;
}
-
- if (current_routing == nullptr && routing_platf->root_ == nullptr) { /* it is the first one */
+ if (current_routing == nullptr) { /* it is the first one */
+ xbt_assert(routing_platf->root_ == nullptr, "All defined components must belong to a AS");
routing_platf->root_ = new_as;
- } else if (current_routing != nullptr && routing_platf->root_ != nullptr) {
+ } else {
/* set the father behavior */
if (current_routing->hierarchy_ == simgrid::kernel::routing::AsImpl::RoutingMode::unset)
current_routing->hierarchy_ = simgrid::kernel::routing::AsImpl::RoutingMode::recursive;
/* add to the sons dictionary */
xbt_dict_set(current_routing->children(), AS->id, (void *) new_as, nullptr);
-
- } else {
- THROWF(arg_error, 0, "All defined components must belong to a AS");
}
/* set the new current component of the tree */