X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f1c7080d6a6cf2d444dc724d08dc568969aa145..5f9b13c6302e914a514168da8ff54818c0ee6787:/src/surf/cpu_ti.hpp diff --git a/src/surf/cpu_ti.hpp b/src/surf/cpu_ti.hpp index 02b630b7f8..1f8bb91298 100644 --- a/src/surf/cpu_ti.hpp +++ b/src/surf/cpu_ti.hpp @@ -6,8 +6,8 @@ #include -#include "cpu_interface.hpp" -#include "trace_mgr_private.h" +#include "src/surf/cpu_interface.hpp" +#include "src/surf/trace_mgr.hpp" #include "surf/surf_routing.h" /* Epsilon */ @@ -55,7 +55,7 @@ class CpuTiTgmr { public: CpuTiTgmr(trace_type type, double value) : m_type(type), m_value(value) - {}; + {}; CpuTiTgmr(tmgr_trace_t speedTrace, double value); ~CpuTiTgmr(); @@ -113,31 +113,31 @@ typedef boost::intrusive::list< ************/ class CpuTi : public Cpu { public: - CpuTi(CpuTiModel *model, simgrid::Host *host, xbt_dynar_t speedPeak, + CpuTi(CpuTiModel *model, simgrid::s4u::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) ; + int initiallyOn, tmgr_trace_t stateTrace) ; ~CpuTi(); - void updateState(tmgr_trace_event_t event_type, double value, double date) override; + void set_speed_trace(tmgr_trace_t trace) override; + + void apply_event(tmgr_trace_iterator_t event, double value) override; void updateActionsFinishTime(double now); + void updateRemainingAmount(double now); + bool isUsed() override; - void printCpuTiModel(); - CpuAction *execute(double size) override; + CpuAction *execution_start(double size) override; CpuAction *sleep(double duration) override; double getAvailableSpeed() override; void modified(bool modified); CpuTiTgmr *p_availTrace; /*< Structure with data needed to integrate trace file */ - tmgr_trace_event_t p_stateEvent = NULL; /*< trace file with states events (ON or OFF) */ - tmgr_trace_event_t p_speedEvent = NULL; /*< trace file with availability events */ ActionTiList *p_actionSet; /*< set with all actions running on cpu */ double m_sumPriority; /*< the sum of actions' priority that are running on cpu */ double m_lastUpdate = 0; /*< last update of actions' remaining amount done */ double current_frequency; - void updateRemainingAmount(double now); public: boost::intrusive::list_member_hook<> cpu_ti_hook; }; @@ -153,14 +153,12 @@ class CpuTiModel : public CpuModel { public: CpuTiModel(); ~CpuTiModel(); - Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeak, + Cpu *createCpu(simgrid::s4u::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); - double shareResources(double now) override; + int initiallyOn, tmgr_trace_t state_trace) override; + double next_occuring_event(double now) override; void updateActionsState(double now, double delta) override; - void addTraces() override; ActionList *p_runningActionSetThatDoesNotNeedBeingChecked; CpuTiList *p_modifiedCpu;