X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f4ed74ca6d4a744d2956a4f2906c897e1886cefd..d2d941a9e68e4389cd4148ccbe1cb35da63e54e4:/src/surf/cpu_cas01.hpp diff --git a/src/surf/cpu_cas01.hpp b/src/surf/cpu_cas01.hpp index a763abf890..66dd3f7072 100644 --- a/src/surf/cpu_cas01.hpp +++ b/src/surf/cpu_cas01.hpp @@ -1,22 +1,29 @@ -/* Copyright (c) 2013-2014. The SimGrid Team. +/* Copyright (c) 2013-2015. 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 + #include "cpu_interface.hpp" /*********** * Classes * ***********/ -class CpuCas01Model; -class CpuCas01; -class CpuCas01Action; + +namespace simgrid { +namespace surf { + +class XBT_PRIVATE CpuCas01Model; +class XBT_PRIVATE CpuCas01; +class XBT_PRIVATE CpuCas01Action; /********* * Model * *********/ -class CpuCas01Model : public CpuModel { + +class CpuCas01Model : public simgrid::surf::CpuModel { public: CpuCas01Model(); ~CpuCas01Model(); @@ -24,12 +31,11 @@ public: double (CpuCas01Model::*shareResources)(double now); void (CpuCas01Model::*updateActionsState)(double now, double delta); - Cpu *createCpu(const char *name, xbt_dynar_t power_peak, int pstate, - double power_scale, - tmgr_trace_t power_trace, int core, + Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, int pstate, + double speedScale, + tmgr_trace_t speedTrace, int core, e_surf_resource_state_t state_initial, - tmgr_trace_t state_trace, - xbt_dict_t cpu_properties); + tmgr_trace_t state_trace); double shareResourcesFull(double now); void addTraces(); ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked; @@ -41,10 +47,9 @@ public: class CpuCas01 : public Cpu { public: - CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t power_peak, - int pstate, double powerScale, tmgr_trace_t powerTrace, int core, - e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace, - xbt_dict_t properties) ; + CpuCas01(CpuCas01Model *model, simgrid::Host *host, xbt_dynar_t speedPeak, + int pstate, double speedScale, tmgr_trace_t speedTrace, int core, + e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace) ; ~CpuCas01(); void updateState(tmgr_trace_event_t event_type, double value, double date); CpuAction *execute(double size); @@ -58,15 +63,15 @@ public: bool isUsed(); void setStateEvent(tmgr_trace_event_t stateEvent); void setPowerEvent(tmgr_trace_event_t stateEvent); - xbt_dynar_t getPowerPeakList(); + xbt_dynar_t getSpeedPeakList(); 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)*/ + tmgr_trace_event_t p_speedEvent; + xbt_dynar_t p_speedPeakList; /*< List of supported CPU capacities (pstate related) */ + int m_pstate; /*< Current pstate (index in the speedPeakList)*/ }; /********** @@ -76,8 +81,11 @@ class CpuCas01Action: public CpuAction { friend CpuAction *CpuCas01::execute(double size); friend CpuAction *CpuCas01::sleep(double duration); public: - CpuCas01Action(Model *model, double cost, bool failed, double power, + CpuCas01Action(Model *model, double cost, bool failed, double speed, lmm_constraint_t constraint); ~CpuCas01Action() {}; }; + +} +}