Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define const is_used().
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 19:54:24 +0000 (21:54 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sun, 11 Oct 2020 21:10:32 +0000 (23:10 +0200)
14 files changed:
include/simgrid/kernel/resource/Resource.hpp
src/kernel/resource/DiskImpl.cpp
src/kernel/resource/DiskImpl.hpp
src/kernel/resource/profile/Profile_test.cpp
src/surf/StorageImpl.cpp
src/surf/StorageImpl.hpp
src/surf/cpu_cas01.cpp
src/surf/cpu_cas01.hpp
src/surf/cpu_ti.cpp
src/surf/cpu_ti.hpp
src/surf/network_interface.cpp
src/surf/network_interface.hpp
src/surf/ptask_L07.cpp
src/surf/ptask_L07.hpp

index f2b4fc1..8208360 100644 (file)
@@ -65,7 +65,7 @@ public:
   virtual void apply_event(profile::Event* event, double value) = 0;
 
   /** @brief Check if the current Resource is used (if it currently serves an action) */
-  virtual bool is_used() = 0;
+  virtual bool is_used() const = 0;
 
   /** @brief returns the current load due to activities (in flops per second, byte per second or similar)
    *
index 58efc3e..6e4ffcf 100644 (file)
@@ -66,7 +66,7 @@ void DiskImpl::destroy()
   }
 }
 
-bool DiskImpl::is_used()
+bool DiskImpl::is_used() const
 {
   THROW_UNIMPLEMENTED;
 }
index 9671f44..db59a0b 100644 (file)
@@ -75,7 +75,7 @@ public:
   lmm::Constraint* get_write_constraint() const { return constraint_write_; }
 
   /** @brief Check if the Storage is used (if an action currently uses its resources) */
-  bool is_used() override;
+  bool is_used() const override;
   void apply_event(profile::Event* event, double value) override;
   void turn_on() override;
   void turn_off() override;
index 591b46f..4c0aff2 100644 (file)
@@ -27,7 +27,7 @@ public:
     XBT_VERB("t=%.1f: Change value to %lg (idx: %u)", thedate, value, event->idx);
     tmgr_trace_event_unref(&event);
   }
-  bool is_used() override { return true; }
+  bool is_used() const override { return true; }
 };
 
 static std::vector<simgrid::kernel::profile::DatedValue> trace2vector(const char* str)
index 4db2a48..9a0c617 100644 (file)
@@ -69,7 +69,7 @@ void StorageImpl::destroy()
   }
 }
 
-bool StorageImpl::is_used()
+bool StorageImpl::is_used() const
 {
   THROW_UNIMPLEMENTED;
 }
index 6f98702..f126bbc 100644 (file)
@@ -88,7 +88,7 @@ public:
   lmm::Constraint* get_read_constraint() const { return constraint_read_; }
   lmm::Constraint* get_write_constraint() const { return constraint_write_; }
   /** @brief Check if the Storage is used (if an action currently uses its resources) */
-  bool is_used() override;
+  bool is_used() const override;
 
   void apply_event(profile::Event* event, double value) override;
 
index 9aae097..255ff2b 100644 (file)
@@ -94,7 +94,7 @@ CpuCas01::CpuCas01(CpuCas01Model* model, s4u::Host* host, const std::vector<doub
 
 CpuCas01::~CpuCas01() = default;
 
-bool CpuCas01::is_used()
+bool CpuCas01::is_used() const
 {
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
index 1621b1b..1543d60 100644 (file)
@@ -50,7 +50,7 @@ public:
   CpuAction* execution_start(double size, int requested_cores) override;
   CpuAction* sleep(double duration) override;
 
-  bool is_used() override;
+  bool is_used() const override;
 
 protected:
   void on_speed_change() override;
index 36f54ff..9b37aa1 100644 (file)
@@ -458,7 +458,7 @@ void CpuTi::update_actions_finish_time(double now)
   set_modified(false);
 }
 
-bool CpuTi::is_used()
+bool CpuTi::is_used() const
 {
   return not action_set_.empty();
 }
index ecb3575..860b5a9 100644 (file)
@@ -110,7 +110,7 @@ public:
   void update_actions_finish_time(double now);
   void update_remaining_amount(double now);
 
-  bool is_used() override;
+  bool is_used() const override;
   CpuAction* execution_start(double size) override;
   CpuAction* execution_start(double, int) override
   {
index 42902a4..949e071 100644 (file)
@@ -104,7 +104,7 @@ void LinkImpl::destroy()
   }
 }
 
-bool LinkImpl::is_used()
+bool LinkImpl::is_used() const
 {
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
index 435e70c..d68e492 100644 (file)
@@ -140,7 +140,7 @@ public:
   virtual s4u::Link::SharingPolicy get_sharing_policy() const;
 
   /** @brief Check if the Link is used */
-  bool is_used() override;
+  bool is_used() const override;
 
   void turn_on() override;
   void turn_off() override;
index fb4cb6e..7068377 100644 (file)
@@ -282,7 +282,7 @@ kernel::resource::CpuAction* CpuL07::sleep(double duration)
   return action;
 }
 
-bool CpuL07::is_used()
+bool CpuL07::is_used() const
 {
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
@@ -303,7 +303,7 @@ void CpuL07::on_speed_change()
   Cpu::on_speed_change();
 }
 
-bool LinkL07::is_used()
+bool LinkL07::is_used() const
 {
   return get_model()->get_maxmin_system()->constraint_used(get_constraint());
 }
index 60cfda1..19bc8a0 100644 (file)
@@ -81,7 +81,7 @@ public:
   CpuL07(const CpuL07&) = delete;
   CpuL07& operator=(const CpuL07&) = delete;
   ~CpuL07() override;
-  bool is_used() override;
+  bool is_used() const override;
   void apply_event(kernel::profile::Event* event, double value) override;
   kernel::resource::CpuAction* execution_start(double size) override;
   kernel::resource::CpuAction* execution_start(double, int) override
@@ -102,7 +102,7 @@ public:
   LinkL07(const LinkL07&) = delete;
   LinkL07& operator=(const LinkL07&) = delete;
   ~LinkL07() override;
-  bool is_used() override;
+  bool is_used() const override;
   void apply_event(kernel::profile::Event* event, double value) override;
   void set_bandwidth(double value) override;
   void set_latency(double value) override;