|
SimGrid
3.21
Versatile Simulation of Distributed Systems
|
SURF resource interface class.
This is the ancestor class of every resources in SimGrid, such as links, CPU or storage
#include <Resource.hpp>
Classes | |
| struct | Metric |
Public Member Functions | |
| Resource (Model *model, const std::string &name, lmm::Constraint *constraint) | |
| Constructor of LMM Resources. More... | |
| virtual | ~Resource () |
| Model * | get_model () const |
| Get the Model of the current Resource. More... | |
| const std::string & | get_name () const |
| Get the name of the current Resource. More... | |
| const char * | get_cname () const |
| Get the name of the current Resource. More... | |
| bool | operator== (const Resource &other) const |
| virtual void | apply_event (TraceEvent *event, double value)=0 |
| Apply an event of external load event to that resource. More... | |
| virtual bool | is_used ()=0 |
| Check if the current Resource is used (if it currently serves an action) More... | |
| virtual double | get_load () |
| returns the current load due to activities (in flops per second, byte per second or similar) More... | |
| virtual bool | is_on () const |
| Check if the current Resource is active. More... | |
| virtual bool | is_off () const |
| Check if the current Resource is shut down. More... | |
| virtual void | turn_on () |
| Turn on the current Resource. More... | |
| virtual void | turn_off () |
| Turn off the current Resource. More... | |
| virtual void | set_state_trace (tmgr_trace_t trace) |
| setup the trace file with states events (ON or OFF). More... | |
| lmm::Constraint * | get_constraint () const |
| Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More... | |
Public Attributes | |
| TraceEvent * | state_event_ = nullptr |
| simgrid::kernel::resource::Resource::Resource | ( | Model * | model, |
| const std::string & | name, | ||
| lmm::Constraint * | constraint | ||
| ) |
|
virtual |
| Model* simgrid::kernel::resource::Resource::get_model | ( | ) | const |
| const std::string& simgrid::kernel::resource::Resource::get_name | ( | ) | const |
Get the name of the current Resource.
| const char* simgrid::kernel::resource::Resource::get_cname | ( | ) | const |
Get the name of the current Resource.
| bool simgrid::kernel::resource::Resource::operator== | ( | const Resource & | other | ) | const |
|
pure virtual |
Apply an event of external load event to that resource.
|
pure virtual |
Check if the current Resource is used (if it currently serves an action)
|
virtual |
returns the current load due to activities (in flops per second, byte per second or similar)
The load due to external usages modeled by trace files is ignored.
|
virtual |
Check if the current Resource is active.
|
virtual |
Check if the current Resource is shut down.
|
virtual |
Turn on the current Resource.
|
virtual |
Turn off the current Resource.
|
virtual |
setup the trace file with states events (ON or OFF).
Trace must contain boolean values.
| lmm::Constraint* simgrid::kernel::resource::Resource::get_constraint | ( | ) | const |
Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none)
| TraceEvent* simgrid::kernel::resource::Resource::state_event_ = nullptr |