SimGrid  3.11
Versatile Simulation of Distributed Systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Cpu Class Referenceabstract

SURF cpu resource interface class. More...

#include <cpu_interface.hpp>

Inheritance diagram for Cpu:
Resource

Public Member Functions

 Cpu ()
 Cpu constructor.
 
 Cpu (ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint, int core, double powerPeak, double powerScale)
 Cpu constructor. More...
 
 Cpu (ModelPtr model, const char *name, xbt_dict_t props, int core, double powerPeak, double powerScale)
 Cpu constructor. More...
 
 ~Cpu ()
 Cpu destructor.
 
virtual CpuActionPtr execute (double size)=0
 Execute some quantity of computation. More...
 
virtual CpuActionPtr sleep (double duration)=0
 Make a process sleep for duration (in seconds) More...
 
virtual int getCore ()
 Get the number of cores of the current Cpu. More...
 
virtual double getSpeed (double load)
 Get the speed of the current Cpu. More...
 
virtual double getAvailableSpeed ()
 Get the available speed of the current Cpu. More...
 
virtual double getCurrentPowerPeak ()
 Get the current Cpu power peak. More...
 
void setState (e_surf_resource_state_t state)
 Set the state of the current Resource. More...
 
- Public Member Functions inherited from Resource
 Resource ()
 Resource constructor.
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props)
 Resource constructor. More...
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props, lmm_constraint_t constraint)
 Resource constructor. More...
 
 Resource (ModelPtr model, const char *name, xbt_dict_t props, e_surf_resource_state_t stateInit)
 Resource constructor. More...
 
virtual ~Resource ()
 Resource destructor.
 
ModelPtr getModel ()
 Get the Model of the current Resource. More...
 
const char * getName ()
 Get the name of the current Resource. More...
 
virtual xbt_dict_t getProperties ()
 Get the properties of the current Resource. More...
 
virtual void updateState (tmgr_trace_event_t event_type, double value, double date)=0
 Update the state of the current Resource. More...
 
virtual bool isUsed ()=0
 Check if the current Resource is used. More...
 
bool isOn ()
 Check if the current Resource is active. More...
 
void turnOn ()
 Turn on the current Resource.
 
void turnOff ()
 Turn off the current Resource.
 
virtual e_surf_resource_state_t getState ()
 Get the state of the current Resource. More...
 
lmm_constraint_t getConstraint ()
 Get the lmm constraint associated to this Resource if it is part of a LMM component. More...
 

Detailed Description

SURF cpu resource interface class.

A Cpu represent a cpu associated to a workstation

Constructor & Destructor Documentation

Cpu::Cpu ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
lmm_constraint_t  constraint,
int  core,
double  powerPeak,
double  powerScale 
)

Cpu constructor.

Parameters
modelThe CpuModel associated to this Cpu
nameThe name of the Cpu
propsDictionary of properties associated to this Cpu
constraintThe lmm constraint associated to this Cpu if it is part of a LMM component
coreThe number of core of this Cpu
powerPeakThe power peak of this Cpu
powerScaleThe power scale of this Cpu
Cpu::Cpu ( ModelPtr  model,
const char *  name,
xbt_dict_t  props,
int  core,
double  powerPeak,
double  powerScale 
)

Cpu constructor.

Parameters
modelThe CpuModel associated to this Cpu
nameThe name of the Cpu
propsDictionary of properties associated to this Cpu
coreThe number of core of this Cpu
powerPeakThe power peak of this Cpu in [TODO]
powerScaleThe power scale of this Cpu in [TODO]

Member Function Documentation

virtual CpuActionPtr Cpu::execute ( double  size)
pure virtual

Execute some quantity of computation.

Parameters
sizeThe value of the processing amount (in flop) needed to process
Returns
The CpuAction corresponding to the processing
virtual CpuActionPtr Cpu::sleep ( double  duration)
pure virtual

Make a process sleep for duration (in seconds)

Parameters
durationThe number of seconds to sleep
Returns
The CpuAction corresponding to the sleeping
int Cpu::getCore ( )
virtual

Get the number of cores of the current Cpu.

Returns
The number of cores of the current Cpu
double Cpu::getSpeed ( double  load)
virtual

Get the speed of the current Cpu.

[TODO] load * m_powerPeak

Parameters
load[TODO]
Returns
The speed of the current Cpu
double Cpu::getAvailableSpeed ( )
virtual

Get the available speed of the current Cpu.

[TODO]

Returns
The available speed of the current Cpu
double Cpu::getCurrentPowerPeak ( )
virtual

Get the current Cpu power peak.

Returns
The current Cpu power peak
void Cpu::setState ( e_surf_resource_state_t  state)
virtual

Set the state of the current Resource.

Parameters
stateThe new state of the current Resource

Reimplemented from Resource.


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