X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d662c9d9b90723961229e619d980e28d2d66ef6d..8d0b1f2f1840a16bb9551f1cfd74f2488599f95b:/src/kernel/activity/IoImpl.hpp diff --git a/src/kernel/activity/IoImpl.hpp b/src/kernel/activity/IoImpl.hpp index b1275e3ac3..6562f2e393 100644 --- a/src/kernel/activity/IoImpl.hpp +++ b/src/kernel/activity/IoImpl.hpp @@ -1,37 +1,48 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. 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. */ -#ifndef SIMIX_SYNCHRO_IO_HPP -#define SIMIX_SYNCHRO_IO_HPP +#ifndef SIMGRID_KERNEL_ACTIVITY_IO_HPP +#define SIMGRID_KERNEL_ACTIVITY_IO_HPP #include "src/kernel/activity/ActivityImpl.hpp" -#include "surf/surf.hpp" #include -namespace simgrid { -namespace kernel { -namespace activity { +namespace simgrid::kernel::activity { + +class XBT_PUBLIC IoImpl : public ActivityImpl_T { + s4u::Host* host_ = nullptr; + resource::DiskImpl* disk_ = nullptr; + s4u::Host* dst_host_ = nullptr; + resource::DiskImpl* dst_disk_ = nullptr; + double sharing_penalty_ = 1.0; + sg_size_t size_ = 0; + s4u::Io::OpType type_ = s4u::Io::OpType::READ; + sg_size_t performed_ioops_ = 0; -class XBT_PUBLIC IoImpl : public ActivityImpl { public: - ~IoImpl() override; - explicit IoImpl(std::string name, surf::StorageImpl* storage); - - void start(sg_size_t size, simgrid::s4u::Io::OpType type); - void post() override; - void cancel(); - double get_remaining(); - sg_size_t get_performed_ioops() { return performed_ioops_; } - - surf::StorageImpl* storage_ = nullptr; - sg_size_t performed_ioops_ = 0; - static simgrid::xbt::signal on_start; - static simgrid::xbt::signal on_completion; + IoImpl(); + + IoImpl& set_sharing_penalty(double sharing_penalty); + IoImpl& set_size(sg_size_t size); + IoImpl& set_type(s4u::Io::OpType type); + IoImpl& set_disk(resource::DiskImpl* disk); + IoImpl& set_host(s4u::Host* host); + s4u::Host* get_host() const { return host_; } + IoImpl& set_dst_disk(resource::DiskImpl* disk); + IoImpl& set_dst_host(s4u::Host* host); + s4u::Host* get_dst_host() const { return dst_host_; } + + IoImpl& update_sharing_penalty(double sharing_penalty); + + sg_size_t get_performed_ioops() const { return performed_ioops_; } + resource::DiskImpl* get_disk() const { return disk_; } + + IoImpl* start(); + void set_exception(actor::ActorImpl* issuer) override; + void finish() override; }; -} -} } // namespace simgrid::kernel::activity #endif