X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e5e8d36b6983bd96ff5a1291cd06105273060c4b..23a00833ef66ff4383394e3cac558a5232d4bd62:/src/surf/host_ptask_L07.hpp diff --git a/src/surf/host_ptask_L07.hpp b/src/surf/host_ptask_L07.hpp index 15fb2ad023..89ab7c8061 100644 --- a/src/surf/host_ptask_L07.hpp +++ b/src/surf/host_ptask_L07.hpp @@ -44,22 +44,20 @@ public: ~HostL07Model(); double shareResources(double now) override; - void updateActionsState(double now, double delta); - 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, + void updateActionsState(double now, double delta) override; + Action *executeParallelTask(int host_nb, sg_host_t *host_list, + double *flops_amount, double *bytes_amount, double rate) override; + void addTraces() override; }; class CpuL07Model : public CpuModel { public: - CpuL07Model(HostL07Model *hmodel) : CpuModel() {p_hostModel = hmodel;}; - ~CpuL07Model() {surf_cpu_model_pm = NULL;}; + CpuL07Model(HostL07Model *hmodel,lmm_system_t sys); + ~CpuL07Model(); - Cpu *createCpu(const char *name, xbt_dynar_t speedPeak, + Cpu *createCpu(simgrid::Host *host, xbt_dynar_t speedPeakList, int pstate, double speedScale, tmgr_trace_t speedTrace, int core, e_surf_resource_state_t state_initial, @@ -71,8 +69,8 @@ public: class NetworkL07Model : public NetworkModel { public: - NetworkL07Model(HostL07Model *hmodel) : NetworkModel() {p_hostModel = hmodel;}; - ~NetworkL07Model() {surf_network_model = NULL;}; + NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys); + ~NetworkL07Model(); Link* createLink(const char *name, double bw_initial, tmgr_trace_t bw_trace, @@ -83,7 +81,7 @@ public: e_surf_link_sharing_policy_t policy, xbt_dict_t properties) override; - Action *communicate(RoutingEdge *src, RoutingEdge *dst, double size, double rate) override; + Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override; void addTraces() override {DIE_IMPOSSIBLE;}; bool shareResourcesIsIdempotent() override {return true;} @@ -99,20 +97,14 @@ class CpuL07 : public Cpu { tmgr_trace_event_t p_stateEvent; tmgr_trace_event_t p_speedEvent; public: - CpuL07(CpuL07Model *model, const char* name, - double power_scale, double power_initial, tmgr_trace_t power_trace, + CpuL07(CpuL07Model *model, simgrid::Host *host, xbt_dynar_t speedPeakList, int pstate, + double power_scale, tmgr_trace_t power_trace, int core, e_surf_resource_state_t state_initial, tmgr_trace_t state_trace); ~CpuL07(); bool isUsed() override; void updateState(tmgr_trace_event_t event_type, double value, double date) override; Action *execute(double size) override; Action *sleep(double duration) override; - - double getCurrentPowerPeak() override {THROW_UNIMPLEMENTED;}; - double getPowerPeakAt(int /*pstate_index*/) override {THROW_UNIMPLEMENTED;}; - int getNbPstates() override {THROW_UNIMPLEMENTED;}; - void setPstate(int /*pstate_index*/) override {THROW_UNIMPLEMENTED;}; - int getPstate() override {THROW_UNIMPLEMENTED;}; }; class LinkL07 : public Link { @@ -140,7 +132,7 @@ public: /********** * Action * **********/ -class L07Action : public HostAction { +class L07Action : public CpuAction { friend Action *CpuL07::execute(double size); friend Action *CpuL07::sleep(double duration); friend Action *HostL07Model::executeParallelTask(int host_nb, @@ -149,22 +141,23 @@ class L07Action : public HostAction { double *bytes_amount, double rate); public: - L07Action(Model *model, double cost, bool failed) - : HostAction(model, cost, failed) {}; + L07Action(Model *model, int host_nb, + sg_host_t*host_list, + double *flops_amount, + double *bytes_amount, + double rate); ~L07Action(); void updateBound(); int unref() override; - void cancel() override; void suspend() override; void resume() override; - bool isSuspended() override; void setMaxDuration(double duration) override; void setPriority(double priority) override; double getRemains() override; - std::vector * p_edgeList = new std::vector(); + std::vector * p_netcardList = new std::vector(); double *p_computationAmount; double *p_communicationAmount; double m_latency;