Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
SplitDuplexLinkImpl always have SharingPolicy::SPLITDUPLEX. Use a sdingle assert...
[simgrid.git] / src / surf / cpu_cas01.cpp
index e11e314..2223a80 100644 (file)
@@ -3,12 +3,13 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "cpu_cas01.hpp"
 #include "simgrid/kernel/routing/NetZoneImpl.hpp"
 #include "simgrid/s4u/Engine.hpp"
+
 #include "simgrid/sg_config.hpp"
 #include "src/kernel/EngineImpl.hpp"
 #include "src/kernel/resource/profile/Event.hpp"
+#include "src/surf/cpu_cas01.hpp"
 #include "src/surf/cpu_ti.hpp"
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
@@ -44,9 +45,8 @@ void surf_cpu_model_init_Cas01()
     return;
   }
 
-  auto cpu_model_pm = std::make_shared<simgrid::kernel::resource::CpuCas01Model>();
-  simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::CPU_PM, cpu_model_pm,
-                                                         true);
+  auto cpu_model_pm = std::make_shared<simgrid::kernel::resource::CpuCas01Model>("Cpu_Cas01");
+  simgrid::kernel::EngineImpl::get_instance()->add_model(cpu_model_pm);
   simgrid::s4u::Engine::get_instance()->get_netzone_root()->get_impl()->set_cpu_pm_model(cpu_model_pm);
 }
 
@@ -54,7 +54,7 @@ namespace simgrid {
 namespace kernel {
 namespace resource {
 
-CpuCas01Model::CpuCas01Model()
+CpuCas01Model::CpuCas01Model(const std::string& name) : CpuModel(name)
 {
   if (config::get_value<std::string>("cpu/optim") == "Lazy")
     set_update_algorithm(Model::UpdateAlgo::LAZY);
@@ -70,7 +70,7 @@ CpuCas01Model::CpuCas01Model()
   set_maxmin_system(new lmm::System(select));
 }
 
-Cpu* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate)
+CpuImpl* CpuCas01Model::create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate)
 {
   return (new CpuCas01(host, speed_per_pstate))->set_model(this);
 }
@@ -97,7 +97,7 @@ void CpuCas01::on_speed_change()
                                                             action->requested_core() * speed_.scale * speed_.peak);
   }
 
-  Cpu::on_speed_change();
+  CpuImpl::on_speed_change();
 }
 
 void CpuCas01::apply_event(profile::Event* event, double value)