1 /* Copyright (c) 2013-2021. 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. */
6 #ifndef SIMGRID_SURF_CPUCAS01_HPP
7 #define SIMGRID_SURF_CPUCAS01_HPP
9 #include "cpu_interface.hpp"
20 class XBT_PRIVATE CpuCas01Model;
21 class XBT_PRIVATE CpuCas01;
22 class XBT_PRIVATE CpuCas01Action;
28 class CpuCas01Model : public CpuModel {
30 explicit CpuCas01Model(const std::string& name);
31 CpuCas01Model(const CpuCas01Model&) = delete;
32 CpuCas01Model& operator=(const CpuCas01Model&) = delete;
34 Cpu* create_cpu(s4u::Host* host, const std::vector<double>& speed_per_pstate) override;
41 class CpuCas01 : public Cpu {
44 CpuCas01(const CpuCas01&) = delete;
45 CpuCas01& operator=(const CpuCas01&) = delete;
46 void apply_event(profile::Event* event, double value) override;
47 CpuAction* execution_start(double size) override;
48 CpuAction* execution_start(double size, int requested_cores) override;
49 CpuAction* sleep(double duration) override;
51 bool is_used() const override;
54 void on_speed_change() override;
60 class CpuCas01Action : public CpuAction {
61 friend CpuAction* CpuCas01::execution_start(double size);
62 friend CpuAction* CpuCas01::sleep(double duration);
65 CpuCas01Action(Model* model, double cost, bool failed, double speed, lmm::Constraint* constraint,
66 int requested_core = 1);
67 CpuCas01Action(const CpuCas01Action&) = delete;
68 CpuCas01Action& operator=(const CpuCas01Action&) = delete;
69 int requested_core() const;
72 int requested_core_ = 1;
75 } // namespace resource
77 } // namespace simgrid