From: SUTER Frederic Date: Tue, 6 Apr 2021 12:23:08 +0000 (+0200) Subject: simplify kernel part of disk. It's really shallow now X-Git-Tag: v3.28~455^2~145 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/598bfe9997396ccd8aa7e30208e6ba68250732d4 simplify kernel part of disk. It's really shallow now --- diff --git a/src/kernel/resource/DiskImpl.hpp b/src/kernel/resource/DiskImpl.hpp index 1c2210880d..49a91d4fd6 100644 --- a/src/kernel/resource/DiskImpl.hpp +++ b/src/kernel/resource/DiskImpl.hpp @@ -102,9 +102,7 @@ class DiskAction : public Action { public: static xbt::signal on_state_change; - DiskAction(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type) - : Action(model, cost, failed), type_(type), disk_(disk){}; - + DiskAction(Model* model, double cost, bool failed) : Action(model, cost, failed){}; /** * @brief diskAction constructor * @@ -112,17 +110,10 @@ public: * @param cost The cost of this DiskAction in bytes * @param failed [description] * @param var The lmm variable associated to this DiskAction if it is part of a LMM component - * @param disk The Disk associated to this DiskAction - * @param type [description] */ - DiskAction(kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var, DiskImpl* disk, - s4u::Io::OpType type) - : Action(model, cost, failed, var), type_(type), disk_(disk){}; - + DiskAction(kernel::resource::Model* model, double cost, bool failed, kernel::lmm::Variable* var) + : Action(model, cost, failed, var){}; void set_state(simgrid::kernel::resource::Action::State state) override; - - s4u::Io::OpType type_; - DiskImpl* disk_; }; } // namespace resource diff --git a/src/surf/disk_s19.cpp b/src/surf/disk_s19.cpp index 4899708372..ae62d3fc9e 100644 --- a/src/surf/disk_s19.cpp +++ b/src/surf/disk_s19.cpp @@ -35,11 +35,6 @@ DiskImpl* DiskS19Model::create_disk(const std::string& name, double read_bandwid return (new DiskS19(name, read_bandwidth, write_bandwidth))->set_model(this); } -double DiskS19Model::next_occurring_event(double now) -{ - return DiskModel::next_occurring_event_full(now); -} - void DiskS19Model::update_actions_state(double /*now*/, double delta) { for (auto it = std::begin(*get_started_action_set()); it != std::end(*get_started_action_set());) { @@ -78,7 +73,7 @@ DiskAction* DiskS19::write(sg_size_t size) **********/ DiskS19Action::DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type) - : DiskAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3), disk, type) + : DiskAction(model, cost, failed, model->get_maxmin_system()->variable_new(this, 1.0, -1.0, 3)) { XBT_IN("(%s,%g", disk->get_cname(), cost); @@ -97,35 +92,6 @@ DiskS19Action::DiskS19Action(Model* model, double cost, bool failed, DiskImpl* d XBT_OUT(); } -void DiskS19Action::cancel() -{ - set_state(Action::State::FAILED); -} - -void DiskS19Action::suspend() -{ - XBT_IN("(%p)", this); - if (is_running()) { - get_model()->get_maxmin_system()->update_variable_penalty(get_variable(), 0.0); - set_suspend_state(Action::SuspendStates::SUSPENDED); - } - XBT_OUT(); -} - -void DiskS19Action::resume() -{ - THROW_UNIMPLEMENTED; -} - -void DiskS19Action::set_max_duration(double /*duration*/) -{ - THROW_UNIMPLEMENTED; -} - -void DiskS19Action::set_sharing_penalty(double) -{ - THROW_UNIMPLEMENTED; -} void DiskS19Action::update_remains_lazy(double /*now*/) { THROW_IMPOSSIBLE; diff --git a/src/surf/disk_s19.hpp b/src/surf/disk_s19.hpp index a6a9ef535b..845abcd7ff 100644 --- a/src/surf/disk_s19.hpp +++ b/src/surf/disk_s19.hpp @@ -30,7 +30,6 @@ class DiskS19Model : public DiskModel { public: using DiskModel::DiskModel; DiskImpl* create_disk(const std::string& name, double read_bandwidth, double write_bandwidth) override; - double next_occurring_event(double now) override; void update_actions_state(double now, double delta) override; }; @@ -40,7 +39,7 @@ public: class DiskS19 : public DiskImpl { public: - explicit DiskS19(const std::string& name, double read_bw, double write_bw): DiskImpl(name, read_bw, write_bw) {} + using DiskImpl::DiskImpl; DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) override; DiskAction* read(sg_size_t size) override; DiskAction* write(sg_size_t size) override; @@ -53,11 +52,6 @@ public: class DiskS19Action : public DiskAction { public: DiskS19Action(Model* model, double cost, bool failed, DiskImpl* disk, s4u::Io::OpType type); - void suspend() override; - void cancel() override; - void resume() override; - void set_max_duration(double duration) override; - void set_sharing_penalty(double sharing_penalty) override; void update_remains_lazy(double now) override; };