SimGrid  3.18
Versatile Simulation of Distributed Systems
simgrid::kernel::lmm::Constraint Class Reference

Detailed Description

LMM constraint Each constraint contains several partially overlapping logical sets of elements:

  • Disabled elements which variable's weight is zero. This variables are not at all processed by LMM, but eventually the corresponding action will enable it (at least this is the idea).
  • Enabled elements which variable's weight is non-zero. They are utilized in some LMM functions.
  • 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.

#include <maxmin.hpp>

Public Member Functions

 Constraint ()=default
 
 Constraint (void *id_value, double bound_value)
 
void unshare ()
 Unshare a constraint. More...
 
int get_sharing_policy () const
 Check if a constraint is shared (shared by default) More...
 
double get_usage () const
 Get the usage of the constraint after the last lmm solve. More...
 
int get_variable_amount () const
 
void set_concurrency_limit (int limit)
 Sets the concurrency limit for this constraint. More...
 
int get_concurrency_limit () const
 Gets the concurrency limit for this constraint. More...
 
void reset_concurrency_maximum ()
 Reset the concurrency maximum for a given variable (we will update the maximum to reflect constraint evolution). More...
 
int get_concurrency_maximum () const
 Get the concurrency maximum for a given variable (which reflects constraint evolution). More...
 
int get_concurrency_slack () const
 
lmm_variable_t get_variable (const_lmm_element_t *elem) const
 Get a var associated to a constraint. More...
 
lmm_variable_t get_variable_safe (const_lmm_element_t *elem, const_lmm_element_t *nextelem, int *numelem) const
 Get a var associated to a constraint. More...
 
voidget_id () const
 Get the data associated to a constraint. More...
 

Public Attributes

boost::intrusive::list_member_hook constraint_set_hook
 
boost::intrusive::list_member_hook active_constraint_set_hook
 
boost::intrusive::list_member_hook modified_constraint_set_hook
 
boost::intrusive::list_member_hook saturated_constraint_set_hook
 
boost::intrusive::list< Element, boost::intrusive::member_hook< Element, boost::intrusive::list_member_hook<>, &Element::enabled_element_set_hook > > enabled_element_set
 
boost::intrusive::list< Element, boost::intrusive::member_hook< Element, boost::intrusive::list_member_hook<>, &Element::disabled_element_set_hook > > disabled_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 bound
 
int concurrency_current
 
int concurrency_maximum
 
int sharing_policy
 
int id_int
 
double lambda
 
double new_lambda
 
lmm_constraint_light_t cnst_light
 

Constructor & Destructor Documentation

◆ Constraint() [1/2]

simgrid::kernel::lmm::Constraint::Constraint ( )
default

◆ Constraint() [2/2]

simgrid::kernel::lmm::Constraint::Constraint ( void id_value,
double  bound_value 
)

Member Function Documentation

◆ unshare()

void simgrid::kernel::lmm::Constraint::unshare ( )
inline

Unshare a constraint.

◆ get_sharing_policy()

int simgrid::kernel::lmm::Constraint::get_sharing_policy ( ) const
inline

Check if a constraint is shared (shared by default)

Returns
1 if shared, 0 otherwise

◆ get_usage()

double simgrid::kernel::lmm::Constraint::get_usage ( ) const

Get the usage of the constraint after the last lmm solve.

Returns resource load (in flop per second, or byte per second, or similar)

Returns
The usage of the constraint

If the resource is shared (the default case), the load is sum of resource usage made by every variables located on this resource.

If the resource is not shared (ie in FATPIPE mode), then the load is the max (not the sum) of all resource usages located on this resource.

◆ get_variable_amount()

int simgrid::kernel::lmm::Constraint::get_variable_amount ( ) const

◆ set_concurrency_limit()

void simgrid::kernel::lmm::Constraint::set_concurrency_limit ( int  limit)
inline

Sets the concurrency limit for this constraint.

Parameters
limitThe concurrency limit to use for this constraint

◆ get_concurrency_limit()

int simgrid::kernel::lmm::Constraint::get_concurrency_limit ( ) const
inline

Gets the concurrency limit for this constraint.

Returns
The concurrency limit used by this constraint

◆ reset_concurrency_maximum()

void simgrid::kernel::lmm::Constraint::reset_concurrency_maximum ( )
inline

Reset the concurrency maximum for a given variable (we will update the maximum to reflect constraint evolution).

◆ get_concurrency_maximum()

int simgrid::kernel::lmm::Constraint::get_concurrency_maximum ( ) const
inline

Get the concurrency maximum for a given variable (which reflects constraint evolution).

Returns
the maximum concurrency of the constraint

◆ get_concurrency_slack()

int simgrid::kernel::lmm::Constraint::get_concurrency_slack ( ) const
inline

◆ get_variable()

lmm_variable_t simgrid::kernel::lmm::Constraint::get_variable ( const_lmm_element_t *  elem) const

Get a var associated to a constraint.

Get the first variable of the next variable of elem if elem is not NULL

Parameters
elemA element of constraint of the constraint or NULL
Returns
A variable associated to a constraint

◆ get_variable_safe()

lmm_variable_t simgrid::kernel::lmm::Constraint::get_variable_safe ( const_lmm_element_t *  elem,
const_lmm_element_t *  nextelem,
int *  numelem 
) const

Get a var associated to a constraint.

Get the first variable of the next variable of elem if elem is not NULL

Parameters
elemA element of constraint of the constraint or NULL
nextelemA element of constraint of the constraint or NULL, the one after elem
numelemparameter representing the number of elements to go
Returns
A variable associated to a constraint

◆ get_id()

void* simgrid::kernel::lmm::Constraint::get_id ( ) const
inline

Get the data associated to a constraint.

Returns
The data associated to the constraint

Member Data Documentation

◆ constraint_set_hook

boost::intrusive::list_member_hook simgrid::kernel::lmm::Constraint::constraint_set_hook

◆ active_constraint_set_hook

boost::intrusive::list_member_hook simgrid::kernel::lmm::Constraint::active_constraint_set_hook

◆ modified_constraint_set_hook

boost::intrusive::list_member_hook simgrid::kernel::lmm::Constraint::modified_constraint_set_hook

◆ saturated_constraint_set_hook

boost::intrusive::list_member_hook simgrid::kernel::lmm::Constraint::saturated_constraint_set_hook

◆ enabled_element_set

boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>, &Element::enabled_element_set_hook> > simgrid::kernel::lmm::Constraint::enabled_element_set

◆ disabled_element_set

boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>, &Element::disabled_element_set_hook> > simgrid::kernel::lmm::Constraint::disabled_element_set

◆ active_element_set

boost::intrusive::list<Element, boost::intrusive::member_hook<Element, boost::intrusive::list_member_hook<>, &Element::active_element_set_hook> > simgrid::kernel::lmm::Constraint::active_element_set

◆ remaining

double simgrid::kernel::lmm::Constraint::remaining

◆ usage

double simgrid::kernel::lmm::Constraint::usage

◆ bound

double simgrid::kernel::lmm::Constraint::bound

◆ concurrency_current

int simgrid::kernel::lmm::Constraint::concurrency_current

◆ concurrency_maximum

int simgrid::kernel::lmm::Constraint::concurrency_maximum

◆ sharing_policy

int simgrid::kernel::lmm::Constraint::sharing_policy

◆ id_int

int simgrid::kernel::lmm::Constraint::id_int

◆ lambda

double simgrid::kernel::lmm::Constraint::lambda

◆ new_lambda

double simgrid::kernel::lmm::Constraint::new_lambda

◆ cnst_light

lmm_constraint_light_t simgrid::kernel::lmm::Constraint::cnst_light

The documentation for this class was generated from the following files: