X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7fb943357282ab31e64a5bee5dde6db232c37c2b..020b717e6bebcacc1195c7b16929c670684dd1ff:/src/kernel/lmm/maxmin.hpp diff --git a/src/kernel/lmm/maxmin.hpp b/src/kernel/lmm/maxmin.hpp index dab8763a4c..670e24a795 100644 --- a/src/kernel/lmm/maxmin.hpp +++ b/src/kernel/lmm/maxmin.hpp @@ -174,7 +174,7 @@ public: * the corresponding action will enable it (at least this is the idea). * \li Enabled elements which variable's weight is non-zero. They are utilized in some LMM functions. * \li Active elements which variable's weight is non-zero (i.e. it is enabled) AND its element value is non-zero. - * LMM_solve iterates over active elements during resolution, dynamically making them active or unactive. + * LMM_solve iterates over active elements during resolution, dynamically making them active or inactive. */ class XBT_PUBLIC Constraint { public: @@ -275,7 +275,7 @@ public: ConstraintLight* cnst_light_; private: - static int next_rank_; // To give a separate rank_ to each contraint + static int next_rank_; // To give a separate rank_ to each constraint int concurrency_limit_; /* The maximum number of variables that may be enabled at any time (stage variables if * necessary) */ resource::Resource* id_; @@ -371,7 +371,7 @@ inline void Element::make_active() inline void Element::make_inactive() { if (active_element_set_hook.is_linked()) - simgrid::xbt::intrusive_erase(constraint->active_element_set_, *this); + xbt::intrusive_erase(constraint->active_element_set_, *this); } /** @@ -397,11 +397,12 @@ public: /** * @brief Create a new Linear MaxMin variable * @param id Data associated to the variable (e.g.: a network communication) - * @param weight_value The weight of the variable (0.0 if not used) + * @param sharing_penalty The weight of the variable (0.0 if not used) * @param bound The maximum value of the variable (-1.0 if no maximum value) - * @param number_of_constraints The maximum number of constraint to associate to the variable + * @param number_of_constraints The maximum number of constraints to associate to the variable */ - Variable* variable_new(resource::Action* id, double weight_value, double bound, size_t number_of_constraints); + Variable* variable_new(resource::Action* id, double sharing_penalty, double bound = -1.0, + size_t number_of_constraints = 1); /** * @brief Free a variable @@ -474,9 +475,9 @@ private: void remove_variable(Variable * var) { if (var->variable_set_hook_.is_linked()) - simgrid::xbt::intrusive_erase(variable_set, *var); + xbt::intrusive_erase(variable_set, *var); if (var->saturated_variable_set_hook_.is_linked()) - simgrid::xbt::intrusive_erase(saturated_variable_set, *var); + xbt::intrusive_erase(saturated_variable_set, *var); } void make_constraint_active(Constraint * cnst) { @@ -486,9 +487,9 @@ private: void make_constraint_inactive(Constraint * cnst) { if (cnst->active_constraint_set_hook_.is_linked()) - simgrid::xbt::intrusive_erase(active_constraint_set, *cnst); + xbt::intrusive_erase(active_constraint_set, *cnst); if (cnst->modified_constraint_set_hook_.is_linked()) - simgrid::xbt::intrusive_erase(modified_constraint_set, *cnst); + xbt::intrusive_erase(modified_constraint_set, *cnst); } void enable_var(Variable * var); @@ -530,6 +531,12 @@ public: resource::Action::ModifiedSet* modified_set_ = nullptr; private: + typedef std::vector dyn_light_t; + + //Data used in lmm::solve + std::vector 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) */ @@ -556,8 +563,8 @@ XBT_PUBLIC System* make_new_maxmin_system(bool selective_update); XBT_PUBLIC System* make_new_fair_bottleneck_system(bool selective_update); /** @} */ -} -} -} +} // namespace lmm +} // namespace kernel +} // namespace simgrid #endif