X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/bb40307f3fde0e2802daaa98c9a6ea2739f290d4..ccc1670e4bf36086f1f524b5ef004d5210415488:/src/surf/host_ptask_L07.hpp diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index 6092bfa21e..7bc5f09010 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -4,6 +4,10 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include + +#include + #include #include "host_interface.hpp" @@ -11,6 +15,9 @@ #ifndef HOST_L07_HPP_ #define HOST_L07_HPP_ +namespace simgrid { +namespace surf { + /*********** * Classes * ***********/ @@ -38,27 +45,25 @@ public: double shareResources(double now); void updateActionsState(double now, double delta); - Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu); + Host *createHost(const char *name,RoutingEdge *netElm, Cpu *cpu, xbt_dict_t props) override; Action *executeParallelTask(int host_nb, sg_host_t *host_list, double *flops_amount, double *bytes_amount, - double rate); + double rate) override; xbt_dynar_t getRoute(Host *src, Host *dst); void addTraces(); - NetworkModel *p_networkModel; }; class CpuL07Model : public CpuModel { public: CpuL07Model(HostL07Model *hmodel) : CpuModel() {p_hostModel = hmodel;}; ~CpuL07Model() {surf_cpu_model_pm = NULL;}; - Cpu *createCpu(const char *name, xbt_dynar_t powerPeak, - int pstate, double power_scale, - tmgr_trace_t power_trace, int core, + Cpu *createCpu(const char *name, xbt_dynar_t speedPeak, + int pstate, double speedScale, + tmgr_trace_t speedTrace, int core, e_surf_resource_state_t state_initial, - tmgr_trace_t state_trace, - xbt_dict_t cpu_properties); + tmgr_trace_t state_trace) override; void addTraces() {DIE_IMPOSSIBLE;}; HostL07Model *p_hostModel; @@ -69,15 +74,14 @@ public: NetworkL07Model(HostL07Model *hmodel) : NetworkModel() {p_hostModel = hmodel;}; ~NetworkL07Model() {surf_network_model = NULL;}; Link* createLink(const char *name, - double bw_initial, - tmgr_trace_t bw_trace, - double lat_initial, - tmgr_trace_t lat_trace, - e_surf_resource_state_t - state_initial, - tmgr_trace_t state_trace, - e_surf_link_sharing_policy_t - policy, xbt_dict_t properties); + double bw_initial, + tmgr_trace_t bw_trace, + double lat_initial, + tmgr_trace_t lat_trace, + e_surf_resource_state_t state_initial, + tmgr_trace_t state_trace, + e_surf_link_sharing_policy_t policy, + xbt_dict_t properties) override; Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate); void addTraces() {DIE_IMPOSSIBLE;}; @@ -93,6 +97,7 @@ public: class HostL07 : public Host { public: HostL07(HostModel *model, const char* name, xbt_dict_t props, RoutingEdge *netElm, Cpu *cpu); + ~HostL07(); bool isUsed() {DIE_IMPOSSIBLE;}; void updateState(tmgr_trace_event_t /*event_type*/, double /*value*/, double /*date*/) {DIE_IMPOSSIBLE;}; Action *execute(double size) {return p_cpu->execute(size);}; @@ -103,11 +108,12 @@ public: class CpuL07 : public Cpu { friend void HostL07Model::addTraces(); tmgr_trace_event_t p_stateEvent; - tmgr_trace_event_t p_powerEvent; + tmgr_trace_event_t p_speedEvent; public: - CpuL07(CpuL07Model *model, const char* name, xbt_dict_t properties, + CpuL07(CpuL07Model *model, const char* name, double power_scale, double power_initial, tmgr_trace_t power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); + ~CpuL07(); bool isUsed(); void updateState(tmgr_trace_event_t event_type, double value, double date); Action *execute(double size); @@ -137,13 +143,9 @@ public: bool isUsed(); void updateState(tmgr_trace_event_t event_type, double value, double date); double getBandwidth(); - double getLatency(); - bool isShared(); void updateBandwidth(double value, double date=surf_get_clock()); void updateLatency(double value, double date=surf_get_clock()); - double m_latCurrent; - tmgr_trace_event_t p_latEvent; double m_bwCurrent; tmgr_trace_event_t p_bwEvent; }; @@ -175,11 +177,14 @@ public: void setPriority(double priority); double getRemains(); - vector * p_edgeList = new vector(); + std::vector * p_edgeList = new std::vector(); double *p_computationAmount; double *p_communicationAmount; double m_latency; double m_rate; }; +} +} + #endif /* HOST_L07_HPP_ */