Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[HostLoad] Update comments + add debug statement
[simgrid.git] / src / plugins / host_load.cpp
index 7420129..5387b3c 100644 (file)
@@ -52,7 +52,8 @@ private:
   double last_updated_      = 0;
   double last_reset_        = 0;
   /**
-   * current_speed each core is running at right now
+   * current_speed each core is running at; we need to store this as the speed
+   * will already have changed once we get notified
    */
   double current_speed_     = 0;
   /**
@@ -72,8 +73,8 @@ void HostLoad::update()
 {
   double now = surf_get_clock();
 
-  /* Current flop per second computed by the cpu; current_flops = k * pstate_speed_in_flops, k @in {0, 1, ..., cores}
-   * number of active cores */
+  /* Current flop per second computed by the cpu; current_flops = k * pstate_speed_in_flops, k @in {0, 1, ..., cores-1}
+   * designates number of active cores; will be 0 if CPU is currently idle */
   current_flops_ = host_->pimpl_cpu->get_constraint()->get_usage();
 
   /* flops == pstate_speed * cores_being_currently_used */
@@ -82,6 +83,7 @@ void HostLoad::update()
   if (current_flops_ == 0) {
     idle_time_ += (now - last_updated_);
     total_idle_time_ += (now - last_updated_);
+    XBT_DEBUG("[%s]: Currently idle -> Added %f seconds to idle time (totaling %fs)", host_->get_cname(), (now - last_updated_), idle_time_);
   }
 
   theor_max_flops_ += current_speed_ * host_->get_core_count() * (now - last_updated_);