X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c978b9fe22c4e00793169fbe9d5f22825b96f894..3af9dcb5714db015a7038a58701b2b453f52c6ca:/src/surf/cpu.hpp?ds=sidebyside diff --git a/src/surf/cpu.hpp b/src/surf/cpu.hpp index 15e0cec309..669578a9bf 100644 --- a/src/surf/cpu.hpp +++ b/src/surf/cpu.hpp @@ -46,11 +46,18 @@ public: virtual int getCore(); virtual double getSpeed(double load); virtual double getAvailableSpeed(); + + virtual double getCurrentPowerPeak()=0; + virtual double getPowerPeakAt(int pstate_index)=0; + virtual int getNbPstates()=0; + virtual void setPowerPeakAt(int pstate_index)=0; + virtual double getConsumedEnergy()=0; + void addTraces(void); double m_powerPeak; /*< CPU power peak */ double m_powerScale; /*< Percentage of CPU disponible */ -protected: int m_core; +protected: //virtual boost::shared_ptr execute(double size) = 0; //virtual boost::shared_ptr sleep(double duration) = 0; @@ -60,7 +67,8 @@ class CpuLmm : public ResourceLmm, public Cpu { public: CpuLmm(){}; CpuLmm(CpuModelPtr model, const char* name, xbt_dict_t properties) : ResourceLmm(), Cpu(model, name, properties) {}; - + /* Note (hypervisor): */ + lmm_constraint_t *p_constraintCore; }; /********** @@ -69,14 +77,20 @@ public: class CpuAction : virtual public Action { public: CpuAction(){}; - CpuAction(ModelPtr model, double cost, bool failed): Action(model, cost, failed) {}; + CpuAction(ModelPtr model, double cost, bool failed) + : Action(model, cost, failed) {}; }; class CpuActionLmm : public ActionLmm, public CpuAction { public: CpuActionLmm(){}; - CpuActionLmm(ModelPtr model, double cost, bool failed): ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {}; + CpuActionLmm(ModelPtr model, double cost, bool failed) + : Action(model, cost, failed), ActionLmm(model, cost, failed), CpuAction(model, cost, failed) {}; void updateRemainingLazy(double now); + virtual void updateEnergy()=0; + void setAffinity(CpuLmmPtr cpu, unsigned long mask); + void setBound(double bound); + double m_bound; };