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. */
7 #include "cpu_interface.hpp"
19 class CpuCas01Model : public CpuModel {
24 double (CpuCas01Model::*shareResources)(double now);
25 void (CpuCas01Model::*updateActionsState)(double now, double delta);
27 Cpu *createCpu(const char *name, xbt_dynar_t power_peak, int pstate,
29 tmgr_trace_t power_trace, int core,
30 e_surf_resource_state_t state_initial,
31 tmgr_trace_t state_trace,
32 xbt_dict_t cpu_properties);
33 double shareResourcesFull(double now);
35 ActionList *p_cpuRunningActionSetThatDoesNotNeedBeingChecked;
42 class CpuCas01 : public Cpu {
44 CpuCas01(CpuCas01Model *model, const char *name, xbt_dynar_t power_peak,
45 int pstate, double powerScale, tmgr_trace_t powerTrace, int core,
46 e_surf_resource_state_t stateInitial, tmgr_trace_t stateTrace,
47 xbt_dict_t properties) ;
49 void updateState(tmgr_trace_event_t event_type, double value, double date);
50 CpuAction *execute(double size);
51 CpuAction *sleep(double duration);
53 double getCurrentPowerPeak();
54 double getPowerPeakAt(int pstate_index);
56 void setPstate(int pstate_index);
59 void setStateEvent(tmgr_trace_event_t stateEvent);
60 void setPowerEvent(tmgr_trace_event_t stateEvent);
61 xbt_dynar_t getPowerPeakList();
66 tmgr_trace_event_t p_stateEvent;
67 tmgr_trace_event_t p_powerEvent;
68 xbt_dynar_t p_powerPeakList; /*< List of supported CPU capacities */
69 int m_pstate; /*< Current pstate (index in the power_peak_list)*/
75 class CpuCas01Action: public CpuAction {
76 friend CpuAction *CpuCas01::execute(double size);
77 friend CpuAction *CpuCas01::sleep(double duration);
79 CpuCas01Action(Model *model, double cost, bool failed, double power,
80 lmm_constraint_t constraint);