X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/df308bdc5212ab9944427c118fdf6a9cd84221ed..e22da6010c6499813ff88c76041cf499ffbf2b67:/src/surf/cpu_ti.cpp diff --git a/src/surf/cpu_ti.cpp b/src/surf/cpu_ti.cpp index f31b334145..5c24e9a55c 100644 --- a/src/surf/cpu_ti.cpp +++ b/src/surf/cpu_ti.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "cpu_ti.hpp" +#include "src/kernel/EngineImpl.hpp" #include "src/kernel/resource/profile/Event.hpp" #include "src/kernel/resource/profile/Profile.hpp" #include "src/surf/surf_interface.hpp" @@ -269,20 +270,19 @@ int CpuTiProfile::binary_search(const std::vector& array, double a) void CpuTiModel::create_pm_vm_models() { - auto cpu_model_pm = new CpuTiModel(); - models_by_type[simgrid::kernel::resource::Model::Type::CPU_PM].push_back(cpu_model_pm); - auto cpu_model_vm = new CpuTiModel(); - models_by_type[simgrid::kernel::resource::Model::Type::CPU_VM].push_back(cpu_model_vm); + auto cpu_model_pm = std::make_unique(); + simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::CPU_PM, + std::move(cpu_model_pm), true); + auto cpu_model_vm = std::make_unique(); + simgrid::kernel::EngineImpl::get_instance()->add_model(simgrid::kernel::resource::Model::Type::CPU_VM, + std::move(cpu_model_vm), true); } CpuTiModel::CpuTiModel() : CpuModel(Model::UpdateAlgo::FULL) { - all_existing_models.push_back(this); } -CpuTiModel::~CpuTiModel() -{ -} +CpuTiModel::~CpuTiModel() {} Cpu* CpuTiModel::create_cpu(s4u::Host* host, const std::vector& speed_per_pstate) {