]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/routing/AsImpl.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
empty RoutingPlatf: move the loopback link to the network_model(s)
[simgrid.git] / src / kernel / routing / AsImpl.cpp
index 67e292fb0892951bf1851f4f103a7abbe113d17a..3bd9c9e08011853cc4efd0185f3ef53c0e9aa900 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "simgrid/s4u/host.hpp"
 #include "src/kernel/routing/AsImpl.hpp"
+#include "src/surf/cpu_interface.hpp"
 #include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(AsImpl,surf, "Implementation of S4U autonomous systems");
@@ -26,12 +27,18 @@ namespace simgrid {
   }
   AsImpl::~AsImpl() = default;
 
-  void AsImpl::attachHost(s4u::Host* host)
+  simgrid::s4u::Host* AsImpl::createHost(const char* name, std::vector<double>* speedPerPstate, int coreAmount)
   {
+    simgrid::s4u::Host* res = new simgrid::s4u::Host(name);
+
     if (hierarchy_ == RoutingMode::unset)
       hierarchy_ = RoutingMode::base;
 
-    host->pimpl_netcard = new NetCardImpl(host->name().c_str(), NetCard::Type::Host, this);
+    res->pimpl_netcard = new NetCardImpl(name, NetCard::Type::Host, this);
+
+    surf_cpu_model_pm->createCpu(res, speedPerPstate, coreAmount);
+
+    return res;
   }
 
   xbt_dynar_t AsImpl::getOneLinkRoutes()