SimGrid  3.21
Versatile Simulation of Distributed Systems
simgrid::kernel::resource::Resource Class Referenceabstract

Detailed Description

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 ()
 
Modelget_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
 

Constructor & Destructor Documentation

◆ Resource()

simgrid::kernel::resource::Resource::Resource ( Model model,
const std::string &  name,
lmm::Constraint *  constraint 
)

Constructor of LMM Resources.

Parameters
modelModel associated to this Resource
nameThe name of the Resource
constraintThe lmm constraint associated to this Resource if it is part of a LMM component

◆ ~Resource()

virtual simgrid::kernel::resource::Resource::~Resource ( )
virtual

Member Function Documentation

◆ get_model()

Model* simgrid::kernel::resource::Resource::get_model ( ) const

Get the Model of the current Resource.

◆ get_name()

const std::string& simgrid::kernel::resource::Resource::get_name ( ) const

Get the name of the current Resource.

◆ get_cname()

const char* simgrid::kernel::resource::Resource::get_cname ( ) const

Get the name of the current Resource.

◆ operator==()

bool simgrid::kernel::resource::Resource::operator== ( const Resource other) const

◆ apply_event()

virtual void simgrid::kernel::resource::Resource::apply_event ( TraceEvent *  event,
double  value 
)
pure virtual

Apply an event of external load event to that resource.

◆ is_used()

virtual bool simgrid::kernel::resource::Resource::is_used ( )
pure virtual

Check if the current Resource is used (if it currently serves an action)

◆ get_load()

virtual double simgrid::kernel::resource::Resource::get_load ( )
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.

◆ is_on()

virtual bool simgrid::kernel::resource::Resource::is_on ( ) const
virtual

Check if the current Resource is active.

◆ is_off()

virtual bool simgrid::kernel::resource::Resource::is_off ( ) const
virtual

Check if the current Resource is shut down.

◆ turn_on()

virtual void simgrid::kernel::resource::Resource::turn_on ( )
virtual

Turn on the current Resource.

◆ turn_off()

virtual void simgrid::kernel::resource::Resource::turn_off ( )
virtual

Turn off the current Resource.

◆ set_state_trace()

virtual void simgrid::kernel::resource::Resource::set_state_trace ( tmgr_trace_t  trace)
virtual

setup the trace file with states events (ON or OFF).

Trace must contain boolean values.

◆ get_constraint()

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)

Member Data Documentation

◆ state_event_

TraceEvent* simgrid::kernel::resource::Resource::state_event_ = nullptr

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