SimGrid  3.16
Versatile Simulation of Distributed Systems
simgrid::surf::CpuCas01 Class Reference

#include <cpu_cas01.hpp>

Inheritance diagram for simgrid::surf::CpuCas01:
simgrid::surf::Cpu simgrid::surf::Resource

Public Member Functions

 CpuCas01 (CpuCas01Model *model, simgrid::s4u::Host *host, std::vector< double > *speedPerPstate, int core)
 
 ~CpuCas01 () override
 
void apply_event (tmgr_trace_event_t event, double value) override
 Apply an event of external load event to that resource. More...
 
CpuActionexecution_start (double size) override
 Start a new execution on this CPU lasting. More...
 
CpuActionexecution_start (double size, int requestedCore) override
 Execute some quantity of computation on more than one core. More...
 
CpuActionsleep (double duration) override
 Make a process sleep for duration (in seconds) More...
 
bool isUsed () override
 Check if the current Resource is used (if it currently serves an action) More...
 
std::vector< double > * getSpeedPeakList ()
 
- Public Member Functions inherited from simgrid::surf::Cpu
 Cpu (simgrid::surf::Model *model, simgrid::s4u::Host *host, lmm_constraint_t constraint, std::vector< double > *speedPerPstate, int core)
 Cpu constructor. More...
 
 Cpu (simgrid::surf::Model *model, simgrid::s4u::Host *host, std::vector< double > *speedPerPstate, int core)
 Cpu constructor. More...
 
 ~Cpu ()
 
virtual int coreCount ()
 Get the amount of cores. More...
 
virtual double getSpeed (double load)
 Get the speed, accounting for the trace load and provided process load instead of the real current one. More...
 
virtual double getAvailableSpeed ()
 Get the available speed of the current Cpu. More...
 
virtual double getPstateSpeed (int pstate_index)
 Get the current Cpu computational speed. More...
 
virtual int getNbPStates ()
 
virtual void setPState (int pstate_index)
 
virtual int getPState ()
 
simgrid::s4u::HostgetHost ()
 
virtual void setStateTrace (tmgr_trace_t trace)
 
virtual void setSpeedTrace (tmgr_trace_t trace)
 
- Public Member Functions inherited from simgrid::surf::Resource
 Resource (Model *model, const char *name, lmm_constraint_t constraint)
 Constructor of LMM Resources. More...
 
virtual ~Resource ()
 
Modelmodel () const
 Get the Model of the current Resource. More...
 
const char * cname () const
 Get the name of the current Resource. More...
 
bool operator== (const Resource &other) const
 
virtual bool isOn () const
 Check if the current Resource is active. More...
 
virtual bool isOff () const
 Check if the current Resource is shut down. More...
 
virtual void turnOn ()
 Turn on the current Resource. More...
 
virtual void turnOff ()
 Turn off the current Resource. More...
 
lmm_constraint_t constraint () const
 Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) More...
 

Protected Member Functions

void onSpeedChange () override
 take into account changes of speed (either load or max) More...
 

Additional Inherited Members

- Public Attributes inherited from simgrid::surf::Cpu
int coresAmount_ = 1
 
simgrid::s4u::Hosthost_
 
std::vector< double > speedPerPstate_
 
int pstate_ = 0
 
tmgr_trace_event_t stateEvent_ = nullptr
 
s_surf_metric_t speed_ = {1.0, 0, nullptr}
 
- Protected Attributes inherited from simgrid::surf::Resource
const lmm_constraint_t constraint_ = nullptr
 

Constructor & Destructor Documentation

◆ CpuCas01()

simgrid::surf::CpuCas01::CpuCas01 ( CpuCas01Model model,
simgrid::s4u::Host host,
std::vector< double > *  speedPerPstate,
int  core 
)

◆ ~CpuCas01()

simgrid::surf::CpuCas01::~CpuCas01 ( )
override

Member Function Documentation

◆ apply_event()

void simgrid::surf::CpuCas01::apply_event ( tmgr_trace_event_t  event,
double  value 
)
overridevirtual

Apply an event of external load event to that resource.

Parameters
eventWhat happened
value[TODO]

Implements simgrid::surf::Resource.

◆ execution_start() [1/2]

CpuAction * simgrid::surf::CpuCas01::execution_start ( double  size)
overridevirtual

Start a new execution on this CPU lasting.

Parameters
sizeflops and using one core

Implements simgrid::surf::Cpu.

◆ execution_start() [2/2]

CpuAction * simgrid::surf::CpuCas01::execution_start ( double  size,
int  requestedCores 
)
overridevirtual

Execute some quantity of computation on more than one core.

Parameters
sizeThe value of the processing amount (in flop) needed to process
requestedCoresThe desired amount of cores. Must be >= 1
Returns
The CpuAction corresponding to the processing

Reimplemented from simgrid::surf::Cpu.

◆ sleep()

CpuAction * simgrid::surf::CpuCas01::sleep ( double  duration)
overridevirtual

Make a process sleep for duration (in seconds)

Parameters
durationThe number of seconds to sleep
Returns
The CpuAction corresponding to the sleeping

Implements simgrid::surf::Cpu.

◆ isUsed()

bool simgrid::surf::CpuCas01::isUsed ( )
overridevirtual

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

Implements simgrid::surf::Resource.

◆ getSpeedPeakList()

std::vector< double > * simgrid::surf::CpuCas01::getSpeedPeakList ( )

◆ onSpeedChange()

void simgrid::surf::CpuCas01::onSpeedChange ( )
overrideprotectedvirtual

take into account changes of speed (either load or max)

Reimplemented from simgrid::surf::Cpu.


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