Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Kill set_concurrency_share
authorBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 18 Mar 2022 17:30:41 +0000 (18:30 +0100)
committerBruno Donassolo <bruno.donassolo@inria.fr>
Fri, 18 Mar 2022 17:34:23 +0000 (18:34 +0100)
src/kernel/lmm/System.cpp
src/kernel/lmm/System.hpp
src/surf/network_cm02.cpp
teshsuite/surf/maxmin_bench/maxmin_bench.cpp

index 6c5824c..97e4c27 100644 (file)
@@ -103,7 +103,7 @@ void System::check_concurrency() const
     for (Element const& elem : cnst.disabled_element_set_) {
       // We should have staged variables only if concurrency is reached in some constraint
       xbt_assert(cnst.get_concurrency_limit() < 0 || elem.variable->staged_penalty_ == 0 ||
-                     elem.variable->get_min_concurrency_slack() < elem.variable->concurrency_share_,
+                     elem.variable->get_min_concurrency_slack() == 0,
                  "should not have staged variable!");
     }
 
@@ -506,7 +506,6 @@ void Variable::initialize(resource::Action* id_value, double sharing_penalty, do
   sharing_penalty_   = sharing_penalty;
   staged_penalty_    = 0.0;
   bound_             = bound_value;
-  concurrency_share_ = 1;
   value_             = 0.0;
   visited_           = visited_value;
   mu_                = 0.0;
@@ -645,10 +644,8 @@ void System::update_variable_penalty(Variable* var, double penalty)
   if (enabling_var) {
     var->staged_penalty_ = penalty;
     int minslack       = var->get_min_concurrency_slack();
-    if (minslack < var->concurrency_share_) {
-      XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack %i, with penalty %f and concurrency"
-                " share %i",
-                minslack, penalty, var->concurrency_share_);
+    if (minslack == 0) {
+      XBT_DEBUG("Staging var (instead of enabling) because min concurrency slack is 0");
       return;
     }
     XBT_DEBUG("Enabling var with min concurrency slack %i", minslack);
index e58e7ed..bb73e9d 100644 (file)
@@ -319,12 +319,6 @@ public:
   /** @brief Get the maximum value of the variable (-1.0 if no specified maximum) */
   double get_bound() const { return bound_; }
 
-  /**
-   * @brief Set the concurrent share of the variable
-   * @param value The new concurrency share
-   */
-  void set_concurrency_share(short int value) { concurrency_share_ = value; }
-
   /**
    * @brief Get the numth constraint associated to the variable
    * @param num The rank of constraint we want to get
@@ -357,7 +351,7 @@ public:
   /** @brief Check if a variable can be enabled
    * Make sure to set staged_penalty before, if your intent is only to check concurrency
    */
-  bool can_enable() const { return staged_penalty_ > 0 && get_min_concurrency_slack() >= concurrency_share_; }
+  bool can_enable() const { return staged_penalty_ > 0 && get_min_concurrency_slack() > 0; }
 
   /* hookup to system */
   boost::intrusive::list_member_hook<> variable_set_hook_;
@@ -375,7 +369,6 @@ public:
                             met */
   double bound_;
   double value_;
-  short int concurrency_share_; /* The maximum number of elements that variable will add to a constraint */
   resource::Action* id_;
   int rank_;         // Only used in debug messages to identify the variable
   unsigned visited_; /* used by System::update_modified_cnst_set() */
index 5f21418..8d1b395 100644 (file)
@@ -263,9 +263,6 @@ void NetworkCm02Model::comm_action_expand_constraints(const s4u::Host* src, cons
       if (link->get_sharing_policy() != s4u::Link::SharingPolicy::WIFI)
         get_maxmin_system()->expand(link->get_constraint(), action->get_variable(), .05);
     }
-    // Change concurrency_share here, if you want that cross-traffic is included in the SURF concurrency
-    // (You would also have to change simgrid::kernel::lmm::Element::get_concurrency())
-    // action->getVariable()->set_concurrency_share(2)
   }
 }
 
index 5bced38..0836e4b 100644 (file)
@@ -43,7 +43,6 @@ static double test(int nb_cnst, int nb_var, int nb_elem, unsigned int pw_base_li
     var = Sys.variable_new(nullptr, 1.0, -1.0, nb_elem);
     //Have a few variables with a concurrency share of two (e.g. cross-traffic in some cases)
     short concurrency_share = 1 + static_cast<short>(simgrid::xbt::random::uniform_int(0, max_share - 1));
-    var->set_concurrency_share(concurrency_share);
 
     std::vector<int> used(nb_cnst, 0);
     for (int j = 0; j < nb_elem; j++) {