Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Rename Link::get_usage() to Link::get_load() for consistency with Host::
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 4 May 2023 14:14:54 +0000 (16:14 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 4 May 2023 14:14:54 +0000 (16:14 +0200)
ChangeLog
include/simgrid/s4u/Link.hpp
src/kernel/lmm/System.cpp
src/kernel/lmm/System.hpp
src/kernel/resource/Resource.hpp
src/plugins/link_energy.cpp
src/plugins/link_energy_wifi.cpp
src/plugins/link_load.cpp
src/s4u/s4u_Link.cpp

index 9fc7013..a713a6b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@ S4U:
    are fullfiled. If it cannot be started right away, it will start as soon as it becomes
    possible.
  - Allow to set a concurrency limit on disks and hosts, as it was already the case for links.
+ - Rename Link::get_usage() to Link::get_load() for consistency with Host::
 
 Kernel:
  - optimize an internal datastructure (use a set instead of a list for ongoing activities),
index 2195c69..ca87ddc 100644 (file)
@@ -130,7 +130,14 @@ public:
   void set_host_wifi_rate(const s4u::Host* host, int level) const;
 
   /** @brief Returns the current load (in bytes per second) */
-  double get_usage() const;
+  double get_load() const;
+
+#ifndef DOXYGEN
+  XBT_ATTRIB_DEPRECATED_v337("Please use get_load() instead") double get_usage() const
+  {
+    return get_load();
+  }
+#endif
 
   /** @brief Check if the Link is used (at least one flow uses the link) */
   bool is_used() const;
index 75eb88a..cebcb96 100644 (file)
@@ -747,7 +747,7 @@ void System::remove_all_modified_cnst_set()
  * If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum)
  * of all resource usages located on this resource.
  */
-double Constraint::get_usage() const
+double Constraint::get_load() const
 {
   double result              = 0.0;
   if (sharing_policy_ != SharingPolicy::FATPIPE) {
index bfbe7d2..25fa550 100644 (file)
@@ -220,8 +220,8 @@ public:
   /** @brief Check how a constraint is shared  */
   SharingPolicy get_sharing_policy() const { return sharing_policy_; }
 
-  /** @brief Get the usage of the constraint after the last lmm solve */
-  double get_usage() const;
+  /** @brief Get the load of the constraint after the last lmm solve */
+  double get_load() const;
 
   /** @brief Sets the concurrency limit for this constraint */
   void set_concurrency_limit(int limit)
index 6c864e3..9e2f284 100644 (file)
@@ -115,7 +115,7 @@ public:
   /** @brief returns the current load due to activities (in flops per second, byte per second or similar)
    *
    * The load due to external usages modeled by profile files is ignored.*/
-  virtual double get_load() const { return constraint_->get_usage(); }
+  virtual double get_load() const { return constraint_->get_load(); }
 
   bool is_used() const override { return model_->get_maxmin_system()->constraint_used(constraint_); }
 };
index 29b3700..4cf3a5e 100644 (file)
@@ -128,7 +128,7 @@ double LinkEnergy::get_power() const
 
   double power_slope = busy_ - idle_;
 
-  double normalized_link_usage = link_->get_usage() / link_->get_bandwidth();
+  double normalized_link_usage = link_->get_load() / link_->get_bandwidth();
   double dynamic_power         = power_slope * normalized_link_usage;
 
   return idle_ + dynamic_power;
index 481f1f2..0eb9cf0 100644 (file)
@@ -187,7 +187,7 @@ void LinkEnergyWifi::update()
    *  - if idle i.e. get_usage = 0, update P_{stat}
    * P_{tot} = P_{dyn}+P_{stat}
    */
-  if (link_->get_usage() != 0.0) {
+  if (link_->get_load() != 0.0) {
     eDyn_ += /*duration * */ durUsage * ((host_count * pRx_) + pTx_);
     eStat_ += (duration - durUsage) * pIdle_ * (host_count + 1);
     XBT_DEBUG("eDyn +=  %f * ((%f * %f) + %f) | eDyn = %f (durusage =%f)", durUsage, host_count, pRx_, pTx_, eDyn_,
index 1afdd6e..8614765 100644 (file)
@@ -111,7 +111,7 @@ void LinkLoad::update()
              " Please track your link with sg_link_load_track before trying to access any of its load metrics.",
              link_->get_cname());
 
-  double current_instantaneous_bytes_per_second = link_->get_usage();
+  double current_instantaneous_bytes_per_second = link_->get_load();
   double now                                    = simgrid::s4u::Engine::get_clock();
 
   // Update minimum/maximum observed values if needed
index 8d41270..4280066 100644 (file)
@@ -130,9 +130,9 @@ Link* Link::set_concurrency_limit(int limit)
   return this;
 }
 
-double Link::get_usage() const
+double Link::get_load() const
 {
-  return this->pimpl_->get_constraint()->get_usage();
+  return this->pimpl_->get_constraint()->get_load();
 }
 
 void Link::turn_on()