Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
LMM: rename sharing_weight into sharing_penalty for sake of clarity
[simgrid.git] / src / kernel / lmm / fair_bottleneck.cpp
index e50d3a7..1db0704 100644 (file)
@@ -29,13 +29,13 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
   for (Variable& var : variable_set) {
     var.value_ = 0.0;
     XBT_DEBUG("Handling variable %p", &var);
-    if (var.sharing_weight_ > 0.0 && std::find_if(begin(var.cnsts_), end(var.cnsts_), [](Element const& x) {
-                                       return x.consumption_weight != 0.0;
-                                     }) != end(var.cnsts_)) {
+    if (var.sharing_penalty_ > 0.0 && std::find_if(begin(var.cnsts_), end(var.cnsts_), [](Element const& x) {
+                                        return x.consumption_weight != 0.0;
+                                      }) != end(var.cnsts_)) {
       saturated_variable_set.push_back(var);
     } else {
       XBT_DEBUG("Err, finally, there is no need to take care of variable %p", &var);
-      if (var.sharing_weight_ > 0.0)
+      if (var.sharing_penalty_ > 0.0)
         var.value_ = 1.0;
     }
   }
@@ -68,7 +68,7 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
       XBT_DEBUG("Processing cnst %p ", &cnst);
       cnst.usage_ = 0.0;
       for (Element& elem : cnst.enabled_element_set_) {
-        xbt_assert(elem.variable->sharing_weight_ > 0);
+        xbt_assert(elem.variable->sharing_penalty_ > 0);
         if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked())
           nb++;
       }
@@ -109,14 +109,14 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
       XBT_DEBUG("Updating cnst %p ", &cnst);
       if (cnst.sharing_policy_ != s4u::Link::SharingPolicy::FATPIPE) {
         for (Element& elem : cnst.enabled_element_set_) {
-          xbt_assert(elem.variable->sharing_weight_ > 0);
+          xbt_assert(elem.variable->sharing_penalty_ > 0);
           XBT_DEBUG("\tUpdate constraint %p (%g) with variable %p by %g", &cnst, cnst.remaining_, elem.variable,
                     elem.variable->mu_);
           double_update(&cnst.remaining_, elem.consumption_weight * elem.variable->mu_, sg_maxmin_precision);
         }
       } else {
         for (Element& elem : cnst.enabled_element_set_) {
-          xbt_assert(elem.variable->sharing_weight_ > 0);
+          xbt_assert(elem.variable->sharing_penalty_ > 0);
           XBT_DEBUG("\tNon-Shared variable. Update constraint usage of %p (%g) with variable %p by %g", &cnst,
                     cnst.usage_, elem.variable, elem.variable->mu_);
           cnst.usage_ = std::min(cnst.usage_, elem.consumption_weight * elem.variable->mu_);
@@ -131,7 +131,7 @@ void simgrid::kernel::lmm::FairBottleneck::bottleneck_solve()
 
         iter = cnst_list.erase(iter);
         for (Element& elem : cnst.enabled_element_set_) {
-          if (elem.variable->sharing_weight_ <= 0)
+          if (elem.variable->sharing_penalty_ <= 0)
             break;
           if (elem.consumption_weight > 0 && elem.variable->saturated_variable_set_hook_.is_linked()) {
             XBT_DEBUG("\t\tGet rid of variable %p", elem.variable);