SimGrid
3.18
Versatile Simulation of Distributed Systems
|
SURF cpu resource interface class.
A Cpu represent a cpu associated to a host
#include <cpu_interface.hpp>
Public Member Functions | |
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 simgrid::surf::Action * | execution_start (double size)=0 |
Execute some quantity of computation. More... | |
virtual simgrid::surf::Action * | execution_start (double size, int requestedCores) |
Execute some quantity of computation on more than one core. More... | |
virtual simgrid::surf::Action * | sleep (double duration)=0 |
Make a process sleep for duration (in seconds) More... | |
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::Host * | getHost () |
virtual void | setStateTrace (tmgr_trace_t trace) |
virtual void | setSpeedTrace (tmgr_trace_t trace) |
![]() | |
Resource (Model *model, const std::string &name, lmm_constraint_t constraint) | |
Constructor of LMM Resources. More... | |
virtual | ~Resource () |
Model * | model () const |
Get the Model of the current Resource. More... | |
const std::string & | getName () const |
Get the name of the current Resource. More... | |
const char * | getCname () const |
Get the name of the current Resource. More... | |
bool | operator== (const Resource &other) const |
virtual void | apply_event (tmgr_trace_event_t event, double value)=0 |
Apply an event of external load event to that resource. More... | |
virtual bool | isUsed ()=0 |
Check if the current Resource is used (if it currently serves an action) More... | |
virtual double | getLoad () |
returns the current load (in flops per second, byte per second or similar) More... | |
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... | |
Public Attributes | |
int | coresAmount_ = 1 |
simgrid::s4u::Host * | host_ |
std::vector< double > | speedPerPstate_ |
int | pstate_ = 0 |
tmgr_trace_event_t | stateEvent_ = nullptr |
s_surf_metric_t | speed_ = {1.0, 0, nullptr} |
Protected Member Functions | |
virtual void | onSpeedChange () |
Take speed changes (either load or max) into account. More... | |
Additional Inherited Members | |
![]() | |
const lmm_constraint_t | constraint_ = nullptr |
simgrid::surf::Cpu::Cpu | ( | simgrid::surf::Model * | model, |
simgrid::s4u::Host * | host, | ||
lmm_constraint_t | constraint, | ||
std::vector< double > * | speedPerPstate, | ||
int | core | ||
) |
Cpu constructor.
simgrid::surf::Cpu::Cpu | ( | simgrid::surf::Model * | model, |
simgrid::s4u::Host * | host, | ||
std::vector< double > * | speedPerPstate, | ||
int | core | ||
) |
|
default |
|
pure virtual |
Execute some quantity of computation.
size | The value of the processing amount (in flop) needed to process |
Implemented in simgrid::surf::CpuTi, simgrid::surf::CpuL07, and simgrid::surf::CpuCas01.
|
inlinevirtual |
Execute some quantity of computation on more than one core.
size | The value of the processing amount (in flop) needed to process |
requestedCores | The desired amount of cores. Must be >= 1 |
Reimplemented in simgrid::surf::CpuCas01.
|
pure virtual |
Make a process sleep for duration (in seconds)
duration | The number of seconds to sleep |
Implemented in simgrid::surf::CpuTi, simgrid::surf::CpuL07, and simgrid::surf::CpuCas01.
|
virtual |
Get the amount of cores.
|
virtual |
Get the speed, accounting for the trace load and provided process load instead of the real current one.
|
protectedvirtual |
Take speed changes (either load or max) into account.
Reimplemented in simgrid::surf::CpuL07, and simgrid::surf::CpuCas01.
|
virtual |
Get the available speed of the current Cpu.
Reimplemented in simgrid::surf::CpuTi.
|
virtual |
Get the current Cpu computational speed.
|
virtual |
|
virtual |
|
virtual |
|
inline |
|
virtual |
|
virtual |
Reimplemented in simgrid::surf::CpuTi.
int simgrid::surf::Cpu::coresAmount_ = 1 |
simgrid::s4u::Host* simgrid::surf::Cpu::host_ |
std::vector<double> simgrid::surf::Cpu::speedPerPstate_ |
int simgrid::surf::Cpu::pstate_ = 0 |
tmgr_trace_event_t simgrid::surf::Cpu::stateEvent_ = nullptr |
s_surf_metric_t simgrid::surf::Cpu::speed_ = {1.0, 0, nullptr} |