Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 1 Dec 2016 20:40:45 +0000 (21:40 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 1 Dec 2016 20:40:45 +0000 (21:40 +0100)
src/s4u/s4u_engine.cpp
src/surf/sg_platf.cpp

index ad67fbd..f28ecad 100644 (file)
@@ -29,7 +29,7 @@ Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see
 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;
 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);
 
   TRACE_global_init(argc, argv);
   SIMIX_global_init(argc, argv);
index 6d6ba0c..e1aecbc 100644 (file)
@@ -767,19 +767,16 @@ simgrid::s4u::As * sg_platf_new_AS_begin(sg_platf_AS_cbarg_t AS)
       break;
   }
 
       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;
 
     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);
     /* 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 */
   }
 
   /* set the new current component of the tree */