X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/cf454dfcf7c27e86e15af1a45c58dbb7a76e43c8..f2aaadd437ac30adad539d969164098b50cd2338:/src/surf/cpu_interface.cpp diff --git a/src/surf/cpu_interface.cpp b/src/surf/cpu_interface.cpp index a15bc1faab..b07f84f9fa 100644 --- a/src/surf/cpu_interface.cpp +++ b/src/surf/cpu_interface.cpp @@ -4,15 +4,13 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "cpu_interface.hpp" +#include "cpu_ti.hpp" #include "src/kernel/resource/profile/Profile.hpp" #include "src/surf/surf_interface.hpp" #include "surf/surf.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_cpu, ker_resource, "CPU resource, fueling execution activites"); -simgrid::kernel::resource::CpuModel* surf_cpu_model_pm; -simgrid::kernel::resource::CpuModel* surf_cpu_model_vm; - namespace simgrid { namespace kernel { namespace resource { @@ -98,6 +96,9 @@ Cpu* Cpu::set_core_count(int core_count) { xbt_assert(not is_sealed(), "Core count cannot be changed once CPU has been sealed"); xbt_assert(core_count > 0, "Host %s must have at least one core, not 0.", piface_->get_cname()); + if (dynamic_cast(get_model()) != nullptr) + xbt_assert(core_count == 1, "Multi-core not handled by this model yet"); + core_count_ = core_count; return this; } @@ -116,6 +117,9 @@ void Cpu::set_speed_profile(kernel::profile::Profile* profile) void Cpu::seal() { + lmm::System* lmm = get_model()->get_maxmin_system(); + if (dynamic_cast(get_model()) == nullptr) + this->set_constraint(lmm->constraint_new(this, core_count_ * speed_per_pstate_.front())); Resource::seal(); }