X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f0a4750df69ffc8154f013462ae5fe459cfbc599..b9684d3607aa558c95b7185ddf147b478a7e367f:/src/surf/cpu_interface.hpp diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index f8c4092118..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); @@ -151,35 +153,28 @@ public: **********/ /** @ingroup SURF_cpu_interface - * @brief SURF Cpu action interface class - * @details A CpuAction represent the execution of code on a Cpu + * @brief A CpuAction represents the execution of code on one or several Cpus */ 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)` - */ - static simgrid::xbt::signal onStateChange; + /** @brief Callbacks handler which emit the callbacks after CpuAction State changed * + * @details Callback functions have the following signature: `void(CpuAction *action, simgrid::surf::Action::State previous)` + */ + static simgrid::xbt::signal onStateChange; - /** @brief CpuAction constructor */ CpuAction(simgrid::surf::Model *model, double cost, bool failed) - : Action(model, cost, failed) {} //FIXME:DEADCODE? - - /** @brief CpuAction constructor */ + : Action(model, cost, failed) {} //FIXME:DEADCODE? CpuAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var) - : Action(model, cost, failed, var) {} + : Action(model, cost, failed, var) {} - /** - * @brief Set the affinity of the current CpuAction - * @details [TODO] - */ + /** @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 updateRemainingLazy(double now); + void setState(simgrid::surf::Action::State state) override; + void updateRemainingLazy(double now) override; + std::list cpus(); }; }