X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c39f643b5bfb0e99887c209a94e49f841a2daae4..6211c588d514efac018d071c4304df3f7bace3bd:/src/surf/cpu_cas01.hpp diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index 7f54163030..685cd4cbc2 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -1,3 +1,9 @@ +/* Copyright (c) 2013-2014. The SimGrid Team. + * All rights reserved. */ + +/* 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 "cpu_interface.hpp" /*********** @@ -38,18 +44,8 @@ public: /************ * Resource * ************/ -/* - * Energy-related properties for the cpu_cas01 model - */ -typedef struct energy_cpu_cas01 { - xbt_dynar_t power_range_watts_list; /*< List of (min_power,max_power) pairs corresponding to each cpu pstate */ - double total_energy; /*< Total energy consumed by the host */ - double last_updated; /*< Timestamp of the last energy update event*/ -} s_energy_cpu_cas01_t, *energy_cpu_cas01_t; class CpuCas01 : public Cpu { -public://FIXME: - tmgr_trace_event_t p_stateEvent; public: CpuCas01(CpuCas01ModelPtr model, const char *name, xbt_dynar_t power_peak, int pstate, double powerScale, tmgr_trace_t powerTrace, int core, @@ -60,22 +56,22 @@ public: CpuActionPtr execute(double size); CpuActionPtr sleep(double duration); - xbt_dynar_t getWattsRangeList(); - double getCurrentWattsValue(double cpu_load); - void updateEnergy(double cpu_load); - double getCurrentPowerPeak(); double getPowerPeakAt(int pstate_index); int getNbPstates(); void setPowerPeakAt(int pstate_index); - double getConsumedEnergy(); - bool isUsed(); + void setStateEvent(tmgr_trace_event_t stateEvent); + void setPowerEvent(tmgr_trace_event_t stateEvent); + xbt_dynar_t getPowerPeakList(); + + int getPState(); +private: + tmgr_trace_event_t p_stateEvent; tmgr_trace_event_t p_powerEvent; xbt_dynar_t p_powerPeakList; /*< List of supported CPU capacities */ int m_pstate; /*< Current pstate (index in the power_peak_list)*/ - energy_cpu_cas01_t p_energy; /*< Structure with energy-consumption data */ }; /********** @@ -89,5 +85,4 @@ public: CpuCas01Action(ModelPtr model, double cost, bool failed, double power, lmm_constraint_t constraint); ~CpuCas01Action() {}; - void updateEnergy(); };