A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reindent
[simgrid.git]
/
src
/
surf
/
cpu_interface.hpp
diff --git
a/src/surf/cpu_interface.hpp
b/src/surf/cpu_interface.hpp
index
4f1b156
..
0ab1e48
100644
(file)
--- a/
src/surf/cpu_interface.hpp
+++ b/
src/surf/cpu_interface.hpp
@@
-74,10
+74,6
@@
public:
*/
XBT_PUBLIC_CLASS Cpu : public simgrid::surf::Resource {
public:
*/
XBT_PUBLIC_CLASS Cpu : public simgrid::surf::Resource {
public:
- static simgrid::xbt::Extension<simgrid::Host, Cpu> EXTENSION_ID;
- static void classInit();
- Cpu();
-
/**
* @brief Cpu constructor
*
/**
* @brief Cpu constructor
*
@@
-89,8
+85,9
@@
public:
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
* @param speedScale The speed scale of this Cpu in [0;1] (available amount)
* @param stateInitial whether it is created running or crashed
*/
- Cpu(simgrid::surf::Model *model, simgrid::Host *host,
- lmm_constraint_t constraint, int core, double speedPeak, double speedScale,
+ Cpu(simgrid::surf::Model *model, simgrid::Host *host, lmm_constraint_t constraint,
+ xbt_dynar_t speedPeakList, int pstate,
+ int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
/**
e_surf_resource_state_t stateInitial);
/**
@@
-104,14
+101,10
@@
public:
* @param stateInitial whether it is created running or crashed
*/
Cpu(simgrid::surf::Model *model, simgrid::Host *host,
* @param stateInitial whether it is created running or crashed
*/
Cpu(simgrid::surf::Model *model, simgrid::Host *host,
+ xbt_dynar_t speedPeakList, int pstate,
int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
int core, double speedPeak, double speedScale,
e_surf_resource_state_t stateInitial);
- Cpu(simgrid::surf::Model *model, simgrid::Host *host,
- lmm_constraint_t constraint, int core, double speedPeak, double speedScale);
- Cpu(simgrid::surf::Model *model, simgrid::Host *host,
- int core, double speedPeak, double speedScale);
-
~Cpu();
/**
~Cpu();
/**
@@
-136,17
+129,22
@@
public:
/** @brief Get the speed, accounting for the trace load and provided process load instead of the real current one */
virtual double getSpeed(double load);
/** @brief Get the speed, accounting for the trace load and provided process load instead of the real current one */
virtual double getSpeed(double load);
+protected:
+ /** @brief Take speed changes (either load or max) into account */
+ virtual void onSpeedChange();
+
+public:
/** @brief Get the available speed of the current Cpu */
virtual double getAvailableSpeed();
/** @brief Get the current Cpu power peak */
virtual double getCurrentPowerPeak();
/** @brief Get the available speed of the current Cpu */
virtual double getAvailableSpeed();
/** @brief Get the current Cpu power peak */
virtual double getCurrentPowerPeak();
- virtual double getPowerPeakAt(int pstate_index)
=0
;
+ virtual double getPowerPeakAt(int pstate_index);
- virtual int getNbP
states()=0
;
- virtual void setP
state(int pstate_index)=0
;
- virtual int getP
state()=0
;
+ virtual int getNbP
States()
;
+ virtual void setP
State(int pstate_index)
;
+ virtual int getP
State()
;
void addTraces(void);
simgrid::Host* getHost() { return m_host; }
void addTraces(void);
simgrid::Host* getHost() { return m_host; }
@@
-157,6
+155,9
@@
public:
double m_speedScale; /*< Percentage of CPU available according to the trace, in [O,1] */
simgrid::Host* m_host;
double m_speedScale; /*< Percentage of CPU available according to the trace, in [O,1] */
simgrid::Host* m_host;
+ xbt_dynar_t p_speedPeakList = NULL; /*< List of supported CPU capacities (pstate related) */
+ int m_pstate = 0; /*< Current pstate (index in the speedPeakList)*/
+
/* Note (hypervisor): */
lmm_constraint_t *p_constraintCore=NULL;
void **p_constraintCoreId=NULL;
/* Note (hypervisor): */
lmm_constraint_t *p_constraintCore=NULL;
void **p_constraintCoreId=NULL;