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. */
13 #include "src/surf/HostImpl.hpp"
25 class XBT_PRIVATE HostL07Model;
26 class XBT_PRIVATE CpuL07Model;
27 class XBT_PRIVATE NetworkL07Model;
29 class XBT_PRIVATE CpuL07;
30 class XBT_PRIVATE LinkL07;
32 class XBT_PRIVATE L07Action;
40 class HostL07Model : public HostModel {
45 double next_occuring_event(double now) override;
46 void updateActionsState(double now, double delta) override;
47 Action *executeParallelTask(int host_nb, sg_host_t *host_list,
48 double *flops_amount, double *bytes_amount,
49 double rate) override;
52 class CpuL07Model : public CpuModel {
54 CpuL07Model(HostL07Model *hmodel,lmm_system_t sys);
57 Cpu *createCpu(simgrid::s4u::Host *host, xbt_dynar_t speedPeakList,
58 tmgr_trace_t speedTrace, int core,
59 tmgr_trace_t state_trace) override;
60 HostL07Model *p_hostModel;
63 class NetworkL07Model : public NetworkModel {
65 NetworkL07Model(HostL07Model *hmodel, lmm_system_t sys);
67 Link* createLink(const char *name,
69 tmgr_trace_t bw_trace,
71 tmgr_trace_t lat_trace,
72 e_surf_link_sharing_policy_t policy,
73 xbt_dict_t properties) override;
75 Action *communicate(NetCard *src, NetCard *dst, double size, double rate) override;
76 bool next_occuring_event_isIdempotent() override {return true;}
78 HostL07Model *p_hostModel;
85 class CpuL07 : public Cpu {
87 CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPeakList,
88 tmgr_trace_t power_trace, int core, tmgr_trace_t state_trace);
90 bool isUsed() override;
91 void apply_event(tmgr_trace_iterator_t event, double value) override;
92 Action *execution_start(double size) override;
93 Action *sleep(double duration) override;
95 void onSpeedChange() override;
98 class LinkL07 : public Link {
100 LinkL07(NetworkL07Model *model, const char* name, xbt_dict_t props,
101 double bw_initial, tmgr_trace_t bw_trace,
102 double lat_initial, tmgr_trace_t lat_trace,
103 e_surf_link_sharing_policy_t policy);
105 bool isUsed() override;
106 void apply_event(tmgr_trace_iterator_t event, double value) override;
107 void updateBandwidth(double value) override;
108 void updateLatency(double value) override;
114 class L07Action : public CpuAction {
115 friend Action *CpuL07::execution_start(double size);
116 friend Action *CpuL07::sleep(double duration);
117 friend Action *HostL07Model::executeParallelTask(int host_nb,
119 double *flops_amount,
120 double *bytes_amount,
123 L07Action(Model *model, int host_nb,
125 double *flops_amount,
126 double *bytes_amount,
132 int unref() override;
134 std::vector<NetCard*> * p_netcardList = new std::vector<NetCard*>();
135 double *p_computationAmount;
136 double *p_communicationAmount;
144 #endif /* HOST_L07_HPP_ */