X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45d7d1ab9ae1e9a941dd34440467f25e6d337970..b9684d3607aa558c95b7185ddf147b478a7e367f:/src/surf/cpu_interface.hpp?ds=sidebyside diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 5e9e7a0246..032df194e0 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_ @@ -20,16 +31,7 @@ namespace surf { class CpuModel; class Cpu; class CpuAction; -class CpuPlugin; - -/************* - * Callbacks * - *************/ -XBT_PUBLIC(std::list) getActionCpus(CpuAction *action); - -/********* - * Model * - *********/ +class CpuPlugin;// FIXME:DEADCODE /** @ingroup SURF_cpu_interface * @brief SURF cpu model interface class @@ -38,6 +40,7 @@ XBT_PUBLIC(std::list) getActionCpus(CpuAction *action); XBT_PUBLIC_CLASS CpuModel : public Model { public: CpuModel() : Model() {}; + ~CpuModel() override; /** * @brief Create a Cpu @@ -48,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; }; /************ @@ -116,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); @@ -157,9 +159,9 @@ XBT_PUBLIC_CLASS CpuAction : public simgrid::surf::Action { friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action); public: /** @brief Callbacks handler which emit the callbacks after CpuAction State changed * - * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t previous)` + * @details Callback functions have the following signature: `void(CpuAction *action, simgrid::surf::Action::State previous)` */ - static simgrid::xbt::signal onStateChange; + static simgrid::xbt::signal onStateChange; CpuAction(simgrid::surf::Model *model, double cost, bool failed) : Action(model, cost, failed) {} //FIXME:DEADCODE? @@ -169,9 +171,10 @@ public: /** @brief Set the affinity of the current CpuAction */ virtual void setAffinity(Cpu *cpu, unsigned long mask); - void setState(e_surf_action_state_t state); + void setState(simgrid::surf::Action::State state) override; - void updateRemainingLazy(double now); + void updateRemainingLazy(double now) override; + std::list cpus(); }; }