1 /* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
3 /* This program is free software; you can redistribute it and/or modify it
4 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "cpu_interface.hpp"
17 class XBT_PRIVATE CpuCas01Model;
18 class XBT_PRIVATE CpuCas01;
19 class XBT_PRIVATE CpuCas01Action;
25 class CpuCas01Model : public simgrid::surf::CpuModel {
30 Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeak, int pstate,
32 tmgr_trace_t speedTrace, int core,
34 tmgr_trace_t state_trace) override;
35 double shareResourcesFull(double now) override;
36 void addTraces() override;
37 ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
44 class CpuCas01 : public Cpu {
47 CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeak,
48 int pstate, double speedScale, tmgr_trace_t speedTrace, int core,
49 int initiallyOn, tmgr_trace_t stateTrace) ;
51 void updateState(tmgr_trace_iterator_t event_type, double value, double date) override;
52 CpuAction *execute(double size) override;
53 CpuAction *sleep(double duration) override;
55 bool isUsed() override;
57 xbt_dynar_t getSpeedPeakList(); // FIXME: killme to hide our internals
60 void onSpeedChange() override;
64 tmgr_trace_iterator_t p_stateEvent = nullptr;
65 tmgr_trace_iterator_t p_speedEvent = nullptr;
71 class CpuCas01Action: public CpuAction {
72 friend CpuAction *CpuCas01::execute(double size);
73 friend CpuAction *CpuCas01::sleep(double duration);
75 CpuCas01Action(Model *model, double cost, bool failed, double speed,
76 lmm_constraint_t constraint);