1 /* Copyright (c) 2013-2015. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
9 #include "cpu_interface.hpp"
14 class XBT_PRIVATE CpuCas01Model;
15 class XBT_PRIVATE CpuCas01;
16 class XBT_PRIVATE CpuCas01Action;
21 class CpuCas01Model : public CpuModel {
26 double (CpuCas01Model::*shareResources)(double now);
27 void (CpuCas01Model::*updateActionsState)(double now, double delta);
29 Cpu *createCpu(const char *name, xbt_dynar_t power_peak, int pstate,
31 tmgr_trace_t power_trace, int core,
32 e_surf_resource_state_t state_initial,
33 tmgr_trace_t state_trace,
34 xbt_dict_t cpu_properties);
35 double shareResourcesFull(double now);
37 ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
44 class CpuCas01 : public Cpu {
46 CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t power_peak,
47 int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
48 e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
49 xbt_dict_t properties) ;
51 void updateState(tmgr_trace_event_t event_type, double value, double date);
52 CpuAction *execute(double size);
53 CpuAction *sleep(double duration);
55 double getCurrentPowerPeak();
56 double getPowerPeakAt(int pstate_index);
58 void setPstate(int pstate_index);
61 void setStateEvent(tmgr_trace_event_t stateEvent);
62 void setPowerEvent(tmgr_trace_event_t stateEvent);
63 xbt_dynar_t getPowerPeakList();
68 tmgr_trace_event_t p_stateEvent;
69 tmgr_trace_event_t p_powerEvent;
70 xbt_dynar_t p_powerPeakList; /*< List of supported CPU capacities */
71 int m_pstate; /*< Current pstate (index in the power_peak_list)*/
77 class CpuCas01Action: public CpuAction {
78 friend CpuAction *CpuCas01::execute(double size);
79 friend CpuAction *CpuCas01::sleep(double duration);
81 CpuCas01Action(Model *model, double cost, bool failed, double power,
82 lmm_constraint_t constraint);