A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[sonar] Constify pointer and reference local variables in src/kernel/.
[simgrid.git]
/
src
/
kernel
/
lmm
/
maxmin.hpp
diff --git
a/src/kernel/lmm/maxmin.hpp
b/src/kernel/lmm/maxmin.hpp
index
4e88bba
..
4244c99
100644
(file)
--- a/
src/kernel/lmm/maxmin.hpp
+++ b/
src/kernel/lmm/maxmin.hpp
@@
-8,6
+8,7
@@
#include "simgrid/kernel/resource/Action.hpp"
#include "simgrid/s4u/Link.hpp"
#include "simgrid/kernel/resource/Action.hpp"
#include "simgrid/s4u/Link.hpp"
+#include "src/surf/surf_interface.hpp"
#include "xbt/asserts.h"
#include "xbt/mallocator.h"
#include "xbt/asserts.h"
#include "xbt/mallocator.h"
@@
-174,7
+175,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.
* 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
u
nactive.
+ * LMM_solve iterates over active elements during resolution, dynamically making them active or
i
nactive.
*/
class XBT_PUBLIC Constraint {
public:
*/
class XBT_PUBLIC Constraint {
public:
@@
-260,24
+261,24
@@
public:
boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>,
&Element::active_element_set_hook>>
active_element_set_;
boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>,
&Element::active_element_set_hook>>
active_element_set_;
- double remaining_;
- double usage_;
+ double remaining_
= 0.0
;
+ double usage_
= 0.0
;
double bound_;
// TODO MARTIN Check maximum value across resources at the end of simulation and give a warning is more than e.g. 500
double bound_;
// TODO MARTIN Check maximum value across resources at the end of simulation and give a warning is more than e.g. 500
- int concurrency_current_; /* The current concurrency */
- int concurrency_maximum_
; /* The maximum number of (enabled and disabled) variables associated to the constraint a
t
-
*
any given time (essentially for tracing)*/
+ int concurrency_current_
= 0
; /* The current concurrency */
+ int concurrency_maximum_
= 0; /* The maximum number of (enabled and disabled) variables associated to the constrain
t
+
* at
any given time (essentially for tracing)*/
- s4u::Link::SharingPolicy sharing_policy_;
+ s4u::Link::SharingPolicy sharing_policy_
= s4u::Link::SharingPolicy::SHARED
;
int rank_; // Only used in debug messages to identify the constraint
int rank_; // Only used in debug messages to identify the constraint
- double lambda_;
- double new_lambda_;
- ConstraintLight* cnst_light_;
+ double lambda_
= 0.0
;
+ double new_lambda_
= 0.0
;
+ ConstraintLight* cnst_light_
= nullptr
;
private:
private:
- static int next_rank_; // To give a separate rank_ to each contraint
- int concurrency_limit_
; /* The maximum number of variables that may be enabled at any time (stage variables if
-
*
necessary) */
+ static int next_rank_; // To give a separate rank_ to each con
s
traint
+ int concurrency_limit_
= sg_concurrency_limit; /* The maximum number of variables that may be enabled at any time
+
* (stage variables if
necessary) */
resource::Resource* id_;
};
resource::Resource* id_;
};
@@
-371,7
+372,7
@@
inline void Element::make_active()
inline void Element::make_inactive()
{
if (active_element_set_hook.is_linked())
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);
}
/**
}
/**
@@
-475,9
+476,9
@@
private:
void remove_variable(Variable * var)
{
if (var->variable_set_hook_.is_linked())
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())
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)
{
}
void make_constraint_active(Constraint * cnst)
{
@@
-487,9
+488,9
@@
private:
void make_constraint_inactive(Constraint * cnst)
{
if (cnst->active_constraint_set_hook_.is_linked())
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())
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);
}
void enable_var(Variable * var);
@@
-531,6
+532,12
@@
public:
resource::Action::ModifiedSet* modified_set_ = nullptr;
private:
resource::Action::ModifiedSet* modified_set_ = nullptr;
private:
+ typedef std::vector<int> dyn_light_t;
+
+ //Data used in lmm::solve
+ 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) */
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) */
@@
-557,8
+564,8
@@
XBT_PUBLIC System* make_new_maxmin_system(bool selective_update);
XBT_PUBLIC System* make_new_fair_bottleneck_system(bool selective_update);
/** @} */
XBT_PUBLIC System* make_new_fair_bottleneck_system(bool selective_update);
/** @} */
-}
-}
-}
+}
// namespace lmm
+}
// namespace kernel
+}
// namespace simgrid
#endif
#endif