1 #include "workstation.hpp"
3 #ifndef WORKSTATION_L07_HPP_
4 #define WORKSTATION_L07_HPP_
10 class WorkstationL07Model;
11 typedef WorkstationL07Model *WorkstationL07ModelPtr;
14 typedef CpuL07Model *CpuL07ModelPtr;
16 class NetworkL07Model;
17 typedef NetworkL07Model *NetworkL07ModelPtr;
20 typedef WorkstationL07 *WorkstationL07Ptr;
23 typedef CpuL07 *CpuL07Ptr;
26 typedef LinkL07 *LinkL07Ptr;
28 class WorkstationL07ActionLmm;
29 typedef WorkstationL07ActionLmm *WorkstationL07ActionLmmPtr;
31 /*FIXME:class WorkstationActionLmm;
32 typedef WorkstationActionLmm *WorkstationActionLmmPtr;*/
41 class WorkstationL07Model : public WorkstationModel {
43 WorkstationL07Model();
44 ~WorkstationL07Model();
46 double shareResources(double now);
47 void updateActionsState(double now, double delta);
48 ResourcePtr createResource(const char *name, double power_scale,
50 tmgr_trace_t power_trace,
51 e_surf_resource_state_t state_initial,
52 tmgr_trace_t state_trace,
53 xbt_dict_t cpu_properties);
54 ActionPtr executeParallelTask(int workstation_nb,
55 void **workstation_list,
56 double *computation_amount,
57 double *communication_amount,
59 xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst);
60 ActionPtr communicate(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst, double size, double rate);
62 CpuL07ModelPtr p_cpuModel;
63 NetworkL07ModelPtr p_networkModel;
66 class CpuL07Model : public CpuModel {
68 CpuL07Model() : CpuModel("cpuL07") {};
69 ~CpuL07Model() {surf_cpu_model_pm = NULL;};
70 ResourcePtr createResource(const char *name, double power_scale,
72 tmgr_trace_t power_trace,
73 e_surf_resource_state_t state_initial,
74 tmgr_trace_t state_trace,
75 xbt_dict_t cpu_properties);
76 void addTraces() {DIE_IMPOSSIBLE;};
77 WorkstationL07ModelPtr p_workstationModel;
80 class NetworkL07Model : public NetworkCm02Model {
82 NetworkL07Model() : NetworkCm02Model(0) {};
83 ~NetworkL07Model() {surf_network_model = NULL;};
84 ResourcePtr createResource(const char *name,
86 tmgr_trace_t bw_trace,
88 tmgr_trace_t lat_trace,
89 e_surf_resource_state_t
91 tmgr_trace_t state_trace,
92 e_surf_link_sharing_policy_t
93 policy, xbt_dict_t properties);
95 xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst) {DIE_IMPOSSIBLE;};
96 ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) {DIE_IMPOSSIBLE;};
97 void addTraces() {DIE_IMPOSSIBLE;};
98 WorkstationL07ModelPtr p_workstationModel;
105 class WorkstationL07 : public WorkstationCLM03Lmm {
107 WorkstationL07(WorkstationModelPtr model, const char* name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu);
109 bool isUsed() {DIE_IMPOSSIBLE;};
110 void updateState(tmgr_trace_event_t event_type, double value, double date) {DIE_IMPOSSIBLE;};
111 ActionPtr execute(double size);
112 ActionPtr sleep(double duration);
113 e_surf_resource_state_t getState();
114 double getPowerPeakAt(int pstate_index);
116 void setPowerPeakAt(int pstate_index);
117 double getConsumedEnergy();
120 class CpuL07 : public CpuLmm {
122 CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t properties);
124 //bool isUsed() {DIE_IMPOSSIBLE;};
125 void updateState(tmgr_trace_event_t event_type, double value, double date);
126 e_surf_resource_state_t getState();
127 double getSpeed(double load);
128 double getAvailableSpeed();
129 ActionPtr execute(double size) {DIE_IMPOSSIBLE;};
130 ActionPtr sleep(double duration) {DIE_IMPOSSIBLE;};
132 double getCurrentPowerPeak() {};
133 double getPowerPeakAt(int pstate_index) {};
134 int getNbPstates() {};
135 void setPowerPeakAt(int pstate_index) {};
136 double getConsumedEnergy() {};
138 double m_powerCurrent;
141 class LinkL07 : public NetworkCm02LinkLmm {
143 LinkL07(NetworkL07ModelPtr model, const char* name, xbt_dict_t props);
145 void updateState(tmgr_trace_event_t event_type, double value, double date);
146 double getBandwidth();
151 tmgr_trace_event_t p_latEvent;
153 tmgr_trace_event_t p_bwEvent;
159 class WorkstationL07ActionLmm : public WorkstationActionLmm {
161 WorkstationL07ActionLmm(ModelPtr model, double cost, bool failed)
162 : Action(model, cost, failed), WorkstationActionLmm(model, cost, failed) {};
163 ~WorkstationL07ActionLmm();
172 void setMaxDuration(double duration);
173 void setPriority(double priority);
177 WorkstationCLM03Ptr *p_workstationList;
178 double *p_computationAmount;
179 double *p_communicationAmount;
184 #endif /* WORKSTATION_L07_HPP_ */