X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ad2e588c6af6cf84b18ba7c1c96f4f9785d93c28..7b02515baed02f4f6b8808eb16b0e0175eb53395:/src/surf/cpu_interface.hpp diff --git a/src/surf/cpu_interface.hpp b/src/surf/cpu_interface.hpp index 7e2c9cda37..c72e0f5a40 100644 --- a/src/surf/cpu_interface.hpp +++ b/src/surf/cpu_interface.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2013. The SimGrid Team. +/* Copyright (c) 2004-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -32,21 +32,27 @@ CpuPtr getActionCpu(CpuActionPtr action); /** @ingroup SURF_callbacks * @brief Callbacks handler which emit the callbacks after Cpu creation * - * @detail Callback functions have the following signature: `void(CpuPtr)` + * @details Callback functions have the following signature: `void(CpuPtr)` */ -extern surf_callback(void, CpuPtr) createCpuCallbacks; +extern surf_callback(void, CpuPtr) cpuCreatedCallbacks; /** @ingroup SURF_callbacks * @brief Callbacks handler which emit the callbacks after Cpu destruction * - * @detail Callback functions have the following signature: `void(CpuPtr)` + * @details Callback functions have the following signature: `void(CpuPtr)` */ -extern surf_callback(void, CpuPtr) deleteCpuCallbacks; +extern surf_callback(void, CpuPtr) cpuDestructedCallbacks; /** @ingroup SURF_callbacks - * @brief Callbacks handler which emit the callbacks after CpuAction update * - * @detail Callback functions have the following signature: `void(CpuActionPtr)` + * @brief Callbacks handler which emit the callbacks after Cpu State changed * + * @details Callback functions have the following signature: `void(CpuActionPtr)` */ -extern surf_callback(void, CpuActionPtr) updateCpuActionCallbacks; +extern surf_callback(void, CpuPtr) cpuStateChangedCallbacks; + +/** @ingroup SURF_callbacks + * @brief Callbacks handler which emit the callbacks after CpuAction State changed * + * @details Callback functions have the following signature: `void(CpuActionPtr)` + */ +extern surf_callback(void, CpuActionPtr) cpuActionStateChangedCallbacks; /********* * Model * @@ -74,6 +80,7 @@ public: */ CpuPtr createResource(string name); + void setState(e_surf_resource_state_t state); void updateActionsStateLazy(double now, double delta); void updateActionsStateFull(double now, double delta); @@ -124,7 +131,7 @@ public: int core, double powerPeak, double powerScale); /** - * @brieaf Cpu destructor + * @brief Cpu destructor */ ~Cpu(); @@ -183,6 +190,8 @@ public: virtual void setPowerPeakAt(int pstate_index)=0; + void setState(e_surf_resource_state_t state); + void addTraces(void); int m_core; double m_powerPeak; /*< CPU power peak */ @@ -207,7 +216,7 @@ public: /** * @brief CpuAction constructor */ - CpuAction(){}; + CpuAction() {}; /** * @brief CpuAction constructor @@ -217,7 +226,7 @@ public: * @param failed [TODO] */ CpuAction(ModelPtr model, double cost, bool failed) - : Action(model, cost, failed) {} //FIXME:REMOVE + : Action(model, cost, failed) {} //FIXME:REMOVE /** * @brief CpuAction constructor @@ -228,27 +237,21 @@ public: * @param var The lmm variable associated to this CpuAction if it is part of a LMM component */ CpuAction(ModelPtr 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] * * @param cpu [TODO] - * @param long [TODO] + * @param mask [TODO] */ virtual void setAffinity(CpuPtr cpu, unsigned long mask); - /** - * @brief Set the bound of current CpuAction - * @details [TODO] - * - * @param bound [TODO] - */ - virtual void setBound(double bound); + void setState(e_surf_action_state_t state); void updateRemainingLazy(double now); - double m_bound; + }; #endif /* SURF_CPU_INTERFACE_HPP_ */