X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6122eb73f603bfafd7fe5a71efdf3ed677be5a6a..c9197fe448d95724ea56119ac409e6460ed86b8a:/src/surf/cpu_interface.hpp diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 82763d40d3..4a3f3b26da 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -4,8 +4,19 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include + +#include +#include +#include + +#include +#include + +#include "surf/datatypes.h" #include "surf_interface.hpp" #include "maxmin_private.hpp" +#include "trace_mgr.hpp" #ifndef SURF_CPU_INTERFACE_HPP_ #define SURF_CPU_INTERFACE_HPP_ @@ -29,6 +40,7 @@ class CpuPlugin;// FIXME:DEADCODE XBT_PUBLIC_CLASS CpuModel : public Model { public: CpuModel() : Model() {}; + ~CpuModel() override; /** * @brief Create a Cpu @@ -39,9 +51,9 @@ public: */ virtual Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)=0; - void updateActionsStateLazy(double now, double delta); - void updateActionsStateFull(double now, double delta); - bool next_occuring_event_isIdempotent() {return true;} + void updateActionsStateLazy(double now, double delta) override; + void updateActionsStateFull(double now, double delta) override; + bool next_occuring_event_isIdempotent() override; }; /************ @@ -107,10 +119,9 @@ public: /** @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); + /** @brief Get the current Cpu computational speed */ + virtual double getPstateSpeedCurrent(); + virtual double getPstateSpeed(int pstate_index); virtual int getNbPStates(); virtual void setPState(int pstate_index); @@ -122,12 +133,12 @@ public: int coresAmount_ = 1; simgrid::s4u::Host* host_; - xbt_dynar_t speedPerPstate_ = NULL; /*< List of supported CPU capacities (pstate related) */ + xbt_dynar_t speedPerPstate_ = nullptr; /*< List of supported CPU capacities (pstate related) */ int pstate_ = 0; /*< Current pstate (index in the speedPeakList)*/ /* Note (hypervisor): */ - lmm_constraint_t *p_constraintCore=NULL; - void **p_constraintCoreId=NULL; + lmm_constraint_t *p_constraintCore=nullptr; + void **p_constraintCoreId=nullptr; public: virtual void setStateTrace(tmgr_trace_t trace); /*< setup the trace file with states events (ON or OFF). Trace must contain boolean values (0 or 1). */