]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/lmm/maxmin.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
easy sonar fixes
[simgrid.git] / src / kernel / lmm / maxmin.hpp
index 8d8c01c663e466ec334d1672f9487fc8ad0d76c5..3f5a2f2d5e9debf28f8217aeab2cbac8fcea6e0f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2004-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -146,7 +146,7 @@ class XBT_PUBLIC Element {
 public:
   // Use rule-of-three, and implicitely disable the move constructor which should be 'noexcept' according to C++ Core
   // Guidelines.
-  Element()               = default;
+  Element(Constraint* constraint, Variable* variable, double cweight);
   Element(const Element&) = default;
   ~Element()              = default;
 
@@ -169,6 +169,8 @@ public:
   //   - if CPU, then probably 1.
   //   - If network, then 1 in forward direction and 0.05 backward for the ACKs
   double consumption_weight;
+  // maximum consumption weight (can be different from consumption_weight with subflows/ptasks)
+  double max_consumption_weight;
 };
 
 class ConstraintLight {
@@ -190,7 +192,6 @@ class XBT_PUBLIC Constraint {
 public:
   enum class SharingPolicy { NONLINEAR = 2, SHARED = 1, FATPIPE = 0 };
 
-  Constraint() = delete;
   Constraint(resource::Resource* id_value, double bound_value);
 
   /** @brief Unshare a constraint. */
@@ -546,6 +547,12 @@ public:
 
   std::unique_ptr<resource::Action::ModifiedSet> modified_set_ = nullptr;
 
+protected:
+  bool selective_update_active; /* flag to update partially the system only selecting changed portions */
+  boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
+                                                                   &Constraint::modified_constraint_set_hook_>>
+      modified_constraint_set;
+
 private:
   using dyn_light_t = std::vector<int>;
 
@@ -553,15 +560,11 @@ private:
   std::vector<ConstraintLight> cnst_light_vec;
   dyn_light_t saturated_constraints;
 
-  bool selective_update_active; /* flag to update partially the system only selecting changed portions */
   unsigned visited_counter_ = 1; /* used by System::update_modified_set() and System::remove_all_modified_set() to
                                   * cleverly (un-)flag the constraints (more details in these functions) */
   boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
                                                                    &Constraint::constraint_set_hook_>>
       constraint_set;
-  boost::intrusive::list<Constraint, boost::intrusive::member_hook<Constraint, boost::intrusive::list_member_hook<>,
-                                                                   &Constraint::modified_constraint_set_hook_>>
-      modified_constraint_set;
   xbt_mallocator_t variable_mallocator_ =
       xbt_mallocator_new(65536, System::variable_mallocator_new_f, System::variable_mallocator_free_f, nullptr);
 };