Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2023.
[simgrid.git] / src / kernel / resource / CpuImpl.cpp
index 8bc77b8..f7dc10b 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */
@@ -10,9 +10,7 @@
 
 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 *
@@ -67,8 +65,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<int>(speed_per_pstate_.size()));
 
@@ -114,7 +112,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 +215,4 @@ std::list<CpuImpl*> CpuAction::cpus() const
 
   return retlist;
 }
-} // namespace resource
-} // namespace kernel
-} // namespace simgrid
+} // namespace simgrid::kernel::resource