X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c78100114ee98cae862783d942238de2011ac251..952402db6d0f3eade16684d4b044c4ed5282abef:/src/kernel/resource/CpuImpl.cpp diff --git a/src/kernel/resource/CpuImpl.cpp b/src/kernel/resource/CpuImpl.cpp index 8bc77b8dfc..73ef40b6c9 100644 --- a/src/kernel/resource/CpuImpl.cpp +++ b/src/kernel/resource/CpuImpl.cpp @@ -1,18 +1,15 @@ -/* Copyright (c) 2013-2021. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2023. The SimGrid Team. All rights reserved. */ /* 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 "src/kernel/resource/CpuImpl.hpp" +#include "src/kernel/resource/models/cpu_ti.hpp" #include "src/kernel/resource/profile/Profile.hpp" -#include "src/surf/cpu_ti.hpp" -#include "src/surf/surf_interface.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(res_cpu, ker_resource, "CPU resource, fueling execution activites"); -namespace simgrid { -namespace kernel { -namespace resource { +namespace simgrid::kernel::resource { /********* * Model * @@ -20,7 +17,7 @@ namespace resource { void CpuModel::update_actions_state_lazy(double now, double /*delta*/) { - while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_surf_precision)) { + while (not get_action_heap().empty() && double_equals(get_action_heap().top_date(), now, sg_precision_timing)) { auto* action = static_cast(get_action_heap().pop()); XBT_DEBUG("Something happened to action %p", action); @@ -67,8 +64,8 @@ void CpuImpl::reset_vcpu(CpuImpl* that) CpuImpl* CpuImpl::set_pstate(unsigned long pstate_index) { xbt_assert( - pstate_index <= speed_per_pstate_.size(), - "Invalid parameters for CPU %s (pstate %lu > length of pstates %d). Please fix your platform file, or your " + pstate_index < speed_per_pstate_.size(), + "Invalid parameters for CPU %s (pstate %lu >= length of pstates %d). Please fix your platform file, or your " "call to change the pstate.", get_cname(), pstate_index, static_cast(speed_per_pstate_.size())); @@ -114,7 +111,7 @@ CpuImpl* CpuImpl::set_core_count(int core_count) void CpuImpl::apply_sharing_policy_cfg() const { - if (!get_constraint()) + if (not get_constraint()) return; kernel::lmm::Constraint::SharingPolicy lmm_policy = kernel::lmm::Constraint::SharingPolicy::SHARED; @@ -217,6 +214,4 @@ std::list CpuAction::cpus() const return retlist; } -} // namespace resource -} // namespace kernel -} // namespace simgrid +} // namespace simgrid::kernel::resource