X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5faf49cdf3f8ad8751317b857a6d3134fe07eda3..dc4066f005c4827b8169f71ea0c500b6dc311721:/src/surf/workstation_ptask_L07.hpp diff --git a/src/surf/workstation_ptask_L07.hpp b/src/surf/workstation_ptask_L07.hpp index 38a6e9e498..c195fdf787 100644 --- a/src/surf/workstation_ptask_L07.hpp +++ b/src/surf/workstation_ptask_L07.hpp @@ -10,6 +10,15 @@ class WorkstationL07Model; typedef WorkstationL07Model *WorkstationL07ModelPtr; +class CpuL07Model; +typedef CpuL07Model *CpuL07ModelPtr; + +class NetworkL07Model; +typedef NetworkL07Model *NetworkL07ModelPtr; + +class WorkstationL07; +typedef WorkstationL07 *WorkstationL07Ptr; + class CpuL07; typedef CpuL07 *CpuL07Ptr; @@ -32,14 +41,44 @@ typedef WorkstationActionLmm *WorkstationActionLmmPtr;*/ class WorkstationL07Model : public WorkstationModel { public: WorkstationL07Model(); - void parseInit(sg_platf_host_cbarg_t host); - WorkstationCLM03Ptr createCpuResource(const char *name, double power_scale, + + double shareResources(double now); + void updateActionsState(double now, double delta); + ResourcePtr createResource(const char *name, double power_scale, + double power_initial, + tmgr_trace_t power_trace, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + xbt_dict_t cpu_properties); + ActionPtr executeParallelTask(int workstation_nb, + void **workstation_list, + double *computation_amount, + double *communication_amount, + double rate); + xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst); + ActionPtr communicate(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst, double size, double rate); + void addTraces(); + CpuL07ModelPtr p_cpuModel; + NetworkL07ModelPtr p_networkModel; +}; + +class CpuL07Model : public CpuModel { +public: + CpuL07Model() : CpuModel("cpuL07") {}; + ResourcePtr createResource(const char *name, double power_scale, double power_initial, tmgr_trace_t power_trace, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace, xbt_dict_t cpu_properties); - WorkstationCLM03Ptr createLinkResource(const char *name, + void addTraces() {DIE_IMPOSSIBLE;}; + WorkstationL07ModelPtr p_workstationModel; +}; + +class NetworkL07Model : public NetworkCm02Model { +public: + NetworkL07Model() : NetworkCm02Model(0) {}; + ResourcePtr createResource(const char *name, double bw_initial, tmgr_trace_t bw_trace, double lat_initial, @@ -49,50 +88,44 @@ public: tmgr_trace_t state_trace, e_surf_link_sharing_policy_t policy, xbt_dict_t properties); - double shareResources(double now); - void updateActionsState(double now, double delta); - void addTraces(); - - ActionPtr executeParallelTask(int workstation_nb, - void **workstation_list, - double *computation_amount, - double *communication_amount, - double rate); - xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst); - ActionPtr communicate(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst, double size, double rate); -}; -class NetworkL07Model : public NetworkCm02Model { -public: - NetworkL07Model(): NetworkCm02Model() {}; xbt_dynar_t getRoute(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst) {DIE_IMPOSSIBLE;}; - ActionPtr communicate(WorkstationCLM03Ptr src, WorkstationCLM03Ptr dst, double size, double rate) {DIE_IMPOSSIBLE;}; + ActionPtr communicate(RoutingEdgePtr src, RoutingEdgePtr dst, double size, double rate) {DIE_IMPOSSIBLE;}; void addTraces() {DIE_IMPOSSIBLE;}; + WorkstationL07ModelPtr p_workstationModel; }; /************ * Resource * ************/ -class CpuL07 : public WorkstationCLM03Lmm { +class WorkstationL07 : public WorkstationCLM03Lmm { public: - CpuL07(WorkstationL07ModelPtr model, const char* name, xbt_dict_t properties); + WorkstationL07(WorkstationModelPtr model, const char* name, xbt_dict_t props, RoutingEdgePtr netElm, CpuPtr cpu); bool isUsed(); + void updateState(tmgr_trace_event_t event_type, double value, double date) {DIE_IMPOSSIBLE;}; + ActionPtr execute(double size); + ActionPtr sleep(double duration); + e_surf_resource_state_t getState(); +}; + +class CpuL07 : public CpuLmm { +public: + CpuL07(CpuL07ModelPtr model, const char* name, xbt_dict_t properties); + bool isUsed() {DIE_IMPOSSIBLE;}; void updateState(tmgr_trace_event_t event_type, double value, double date); e_surf_resource_state_t getState(); double getSpeed(double load); double getAvailableSpeed(); - ActionPtr execute(double size); - ActionPtr sleep(double duration); - + ActionPtr execute(double size) {DIE_IMPOSSIBLE;}; + ActionPtr sleep(double duration) {DIE_IMPOSSIBLE;}; double m_powerCurrent; - RoutingEdgePtr p_info; }; -class LinkL07 : public WorkstationCLM03Lmm { +class LinkL07 : public NetworkCm02LinkLmm { public: - LinkL07(WorkstationL07ModelPtr model, const char* name, xbt_dict_t props); - bool isUsed(); + LinkL07(NetworkL07ModelPtr model, const char* name, xbt_dict_t props); + bool isUsed() {DIE_IMPOSSIBLE;}; void updateState(tmgr_trace_event_t event_type, double value, double date); double getBandwidth(); double getLatency(); @@ -109,7 +142,8 @@ public: **********/ class WorkstationL07ActionLmm : public WorkstationActionLmm { public: - WorkstationL07ActionLmm(ModelPtr model, double cost, bool failed): WorkstationActionLmm(model, cost, failed) {}; + WorkstationL07ActionLmm(ModelPtr model, double cost, bool failed) + : Action(model, cost, failed), WorkstationActionLmm(model, cost, failed) {}; ~WorkstationL07ActionLmm(); void updateBound();