Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into 'master'
[simgrid.git] / src / surf / cpu_interface.cpp
index 5019df39636ad372635328f574c6080f97fe057a..c8269441efe040a8d142f38a24a34940afaf9d18 100644 (file)
@@ -8,8 +8,7 @@
 #include "src/surf/surf_interface.hpp"
 #include "surf/surf.hpp"
 
-XBT_LOG_EXTERNAL_CATEGORY(surf_kernel);
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_cpu, surf, "Logging specific to the SURF cpu module");
+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;
@@ -26,10 +25,10 @@ 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)) {
     auto* action = static_cast<CpuAction*>(get_action_heap().pop());
-    XBT_CDEBUG(surf_kernel, "Something happened to action %p", action);
+    XBT_DEBUG("Something happened to action %p", action);
 
     action->finish(kernel::resource::Action::State::FINISHED);
-    XBT_CDEBUG(surf_kernel, "Action %p finished", action);
+    XBT_DEBUG("Action %p finished", action);
   }
 }
 
@@ -59,11 +58,12 @@ Cpu::Cpu(Model* model, s4u::Host* host, const std::vector<double>& speed_per_pst
 
 Cpu::Cpu(Model* model, s4u::Host* host, lmm::Constraint* constraint, const std::vector<double>& speed_per_pstate,
          int core)
-    : Resource(model, host->get_cname(), constraint)
-    , core_count_(core)
+    : core_count_(core)
     , host_(host)
     , speed_per_pstate_(speed_per_pstate)
 {
+  this->set_name(host->get_cname())->set_model(model)->set_constraint(constraint);
+
   xbt_assert(core > 0, "Host %s must have at least one core, not 0.", host->get_cname());
 
   speed_.peak     = speed_per_pstate_.front();
@@ -154,11 +154,11 @@ void CpuAction::update_remains_lazy(double now)
   double delta = now - get_last_update();
 
   if (get_remains_no_update() > 0) {
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
-               get_last_update());
+    XBT_DEBUG("Updating action(%p): remains was %f, last_update was: %f", this, get_remains_no_update(),
+              get_last_update());
     update_remains(get_last_value() * delta);
 
-    XBT_CDEBUG(surf_kernel, "Updating action(%p): remains is now %f", this, get_remains_no_update());
+    XBT_DEBUG("Updating action(%p): remains is now %f", this, get_remains_no_update());
   }
 
   set_last_update();