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 {
28 ~CpuCas01Model() override;
30 Cpu *createCpu(simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core) override;
31 ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
38 class CpuCas01 : public Cpu {
40 CpuCas01(CpuCas01Model *model, simgrid::s4u::Host *host, std::vector<double> *speedPerPstate, int core);
42 void apply_event(tmgr_trace_iterator_t event, double value) override;
43 CpuAction *execution_start(double size) override;
44 CpuAction *sleep(double duration) override;
46 bool isUsed() override;
48 std::vector<double> * getSpeedPeakList(); // FIXME: killme to hide our internals
51 void onSpeedChange() override;
57 class CpuCas01Action: public CpuAction {
58 friend CpuAction *CpuCas01::execution_start(double size);
59 friend CpuAction *CpuCas01::sleep(double duration);
61 CpuCas01Action(Model *model, double cost, bool failed, double speed, lmm_constraint_t constraint);
62 ~CpuCas01Action() override;