Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill src/include
[simgrid.git] / src / kernel / routing / NetZoneImpl.cpp
index 404709e..b95021b 100644 (file)
@@ -9,33 +9,22 @@
 #include <simgrid/s4u/Host.hpp>
 #include <simgrid/s4u/VirtualMachine.hpp>
 
-#include "xbt/asserts.hpp"
-#include "src/include/simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/CpuImpl.hpp"
 #include "src/kernel/resource/DiskImpl.hpp"
+#include "src/kernel/resource/HostImpl.hpp"
 #include "src/kernel/resource/NetworkModel.hpp"
 #include "src/kernel/resource/SplitDuplexLinkImpl.hpp"
 #include "src/kernel/resource/StandardLinkImpl.hpp"
 #include "src/kernel/resource/VirtualMachineImpl.hpp"
-#include "src/surf/HostImpl.hpp"
+#include "src/simgrid/module.hpp"
+#include "src/simgrid/sg_config.hpp"
+#include "xbt/asserts.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ker_platform, kernel, "Kernel platform-related information");
 
 namespace simgrid::kernel::routing {
 
-/* Pick the right models for CPU, net and host, and call their model_init_preparse */
-static void surf_config_models_setup()
-{
-  simgrid_host_models().init_from_flag_value();
-
-  XBT_DEBUG("Call vm_model_init");
-  /* TODO: ideally we should get back the pointer to CpuModel from init(), but this
-   * requires changing the declaration of the ModuleGroup returned by simgrid_cpu_models() */
-  surf_vm_model_init_HL13(
-      simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->get_cpu_pm_model().get());
-}
-
 xbt::signal<void(bool symmetrical, kernel::routing::NetPoint* src, kernel::routing::NetPoint* dst,
                  kernel::routing::NetPoint* gw_src, kernel::routing::NetPoint* gw_dst,
                  std::vector<kernel::resource::StandardLinkImpl*> const& link_list)>
@@ -45,22 +34,23 @@ NetZoneImpl::NetZoneImpl(const std::string& name) : piface_(this), name_(name)
 {
   auto* engine = s4u::Engine::get_instance();
   /* workaroud: first netzoneImpl will be the root netzone.
-   * Without globals and with current surf_*_model_description init functions, we need
+   * Without globals and with current model description init functions (see module.hpp), we need
    * the root netzone to exist when creating the models.
-   * This was usually done at sg_platf.cpp, during XML parsing */
+   * This is usually done at sg_platf.cpp, during XML parsing */
   if (not engine->get_netzone_root()) {
     engine->set_netzone_root(&piface_);
     /* root netzone set, initialize models */
     simgrid::s4u::Engine::on_platform_creation();
 
-    /* Initialize the surf models. That must be done after we got all config, and before we need the models.
+    /* Initialize the models. That must be done after we got all config, and before we need the models.
      * That is, after the last <config> tag, if any, and before the first of cluster|peer|zone|trace|trace_cb
      *
      * I'm not sure for <trace> and <trace_cb>, there may be a bug here
      * (FIXME: check it out by creating a file beginning with one of these tags)
      * but cluster and peer come down to zone creations, so putting this verification here is correct.
      */
-    surf_config_models_setup();
+    simgrid_host_models().init_from_flag_value();
+    simgrid_vm_model_init_HL13();
   }
 
   xbt_enforce(nullptr == engine->netpoint_by_name_or_null(get_name()),