Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
give access to disk's read and write (nomimal) bandwidth values
[simgrid.git] / src / kernel / resource / DiskImpl.hpp
index 8645dd0..269a360 100644 (file)
@@ -6,6 +6,7 @@
 #include "simgrid/kernel/resource/Action.hpp"
 #include "simgrid/kernel/resource/Model.hpp"
 #include "simgrid/kernel/resource/Resource.hpp"
+#include "simgrid/s4u/Disk.hpp"
 #include "simgrid/s4u/Io.hpp"
 #include "src/surf/PropertyHolder.hpp"
 #include "src/surf/surf_interface.hpp"
@@ -48,6 +49,10 @@ public:
  ************/
 class DiskImpl : public Resource, public surf::PropertyHolder {
   bool currently_destroying_ = false;
+  s4u::Host* host_           = nullptr;
+  s4u::Disk piface_;
+  double read_bw_;
+  double write_bw_;
 
 public:
   DiskImpl(Model* model, const std::string& name, kernel::lmm::System* maxmin_system, double read_bw, double bwrite_bw);
@@ -57,7 +62,9 @@ public:
   ~DiskImpl() override;
 
   /** @brief Public interface */
-  // FIXME s4u::Storage piface_;
+  s4u::Disk* get_iface() { return &piface_; }
+  double get_read_bandwidth() { return read_bw_; }
+  double get_write_bandwidth() { return write_bw_; }
 
   /** @brief Check if the Storage is used (if an action currently uses its resources) */
   bool is_used() override;
@@ -67,6 +74,9 @@ public:
   void turn_on() override;
   void turn_off() override;
 
+  s4u::Host* get_host() { return host_; }
+  void set_host(s4u::Host* host) { host_ = host; }
+
   void destroy(); // Must be called instead of the destructor
   virtual DiskAction* io_start(sg_size_t size, s4u::Io::OpType type) = 0;
   virtual DiskAction* read(sg_size_t size)                           = 0;