X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f89671e0bd7450461d70d5ced6079123e73c2a63..e4034f71c5d46dc5fc692d8d5c67fb47094026f4:/src/surf/ptask_L07.hpp diff --git a/src/surf/ptask_L07.hpp b/src/surf/ptask_L07.hpp index 2caab73a28..60cfda1113 100644 --- a/src/surf/ptask_L07.hpp +++ b/src/surf/ptask_L07.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2020. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -51,7 +51,7 @@ public: CpuL07Model(HostL07Model* hmodel, kernel::lmm::System* sys); CpuL07Model(const CpuL07Model&) = delete; CpuL07Model& operator=(const CpuL07Model&) = delete; - ~CpuL07Model(); + ~CpuL07Model() override; kernel::resource::Cpu* create_cpu(s4u::Host* host, const std::vector& speed_per_pstate, int core) override; HostL07Model *hostModel_; @@ -62,7 +62,7 @@ public: NetworkL07Model(HostL07Model* hmodel, kernel::lmm::System* sys); NetworkL07Model(const NetworkL07Model&) = delete; NetworkL07Model& operator=(const NetworkL07Model&) = delete; - ~NetworkL07Model(); + ~NetworkL07Model() override; kernel::resource::LinkImpl* create_link(const std::string& name, const std::vector& bandwidths, double latency, s4u::Link::SharingPolicy policy) override; @@ -112,6 +112,16 @@ public: * Action * **********/ class L07Action : public kernel::resource::CpuAction { + std::vector hostList_; + bool free_arrays_ = false; // By default, computationAmount_ and friends are freed by caller. But not for sequential + // exec and regular comms + const double* computationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if + * free_arrays */ + const double* communicationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if + * free_arrays */ + double latency_; + double rate_; + friend CpuAction* CpuL07::execution_start(double size); friend CpuAction* CpuL07::sleep(double duration); friend CpuAction* HostL07Model::execute_parallel(const std::vector& host_list, const double* flops_amount, @@ -123,21 +133,12 @@ public: const double* bytes_amount, double rate); L07Action(const L07Action&) = delete; L07Action& operator=(const L07Action&) = delete; - ~L07Action(); + ~L07Action() override; void updateBound(); - - std::vector hostList_; - const double* computationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if - * free_arrays */ - const double* communicationAmount_; /* pointer to the data that lives in s4u action -- do not free unless if - * free_arrays */ - double latency_; - double rate_; - -private: - bool free_arrays_ = false; // By default, computationAmount_ and friends are freed by caller. But not for sequential - // exec and regular comms + double get_latency() const { return latency_; } + void set_latency(double latency) { latency_ = latency; } + void update_latency(double delta, double precision) { double_update(&latency_, delta, precision); } }; } // namespace surf