Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not expose Activity::set_remaining publicly.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Oct 2022 12:16:55 +0000 (14:16 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 6 Oct 2022 12:24:13 +0000 (14:24 +0200)
Prevents confusion with Comm::set_payload_size.

ChangeLog
include/simgrid/s4u/Activity.hpp
src/s4u/s4u_Comm.cpp
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Io.cpp

index 7314ace..bebb7f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 SimGrid (3.32.1) not released yet (target december 22)
 
+S4U:
+ - Activity::set_remaining() is not public anymore. Use for example
+   Comm::set_payload_size() to change the size of the simulated data.
+
 ----------------------------------------------------------------------------
 
 SimGrid (3.32) October 3. 2022.
index 353fcdb..d5d555a 100644 (file)
@@ -96,6 +96,11 @@ protected:
 
   static std::set<Activity*>* vetoed_activities_;
 
+  /** Set the [remaining] amount of work that this Activity will entail
+   *
+   * It is forbidden to change the amount of work once the Activity is started */
+  Activity* set_remaining(double remains);
+
 private:
   static xbt::signal<void(Activity&)> on_veto;
   static xbt::signal<void(Activity const&)> on_completion;
@@ -186,10 +191,6 @@ public:
 
   /** Get the remaining amount of work that this Activity entails. When it's 0, it's done. */
   virtual double get_remaining() const;
-  /** Set the [remaining] amount of work that this Activity will entail
-   *
-   * It is forbidden to change the amount of work once the Activity is started */
-  Activity* set_remaining(double remains);
 
   double get_start_time() const;
   double get_finish_time() const;
index 1dbfef1..2ab9660 100644 (file)
@@ -272,7 +272,7 @@ CommPtr Comm::set_dst_data(void** buff, size_t size)
 
 CommPtr Comm::set_payload_size(uint64_t bytes)
 {
-  Activity::set_remaining(bytes);
+  set_remaining(bytes);
   if (pimpl_) {
     boost::static_pointer_cast<kernel::activity::CommImpl>(pimpl_)->set_size(bytes);
   }
index a0e9182..286340f 100644 (file)
@@ -110,7 +110,7 @@ ExecPtr Exec::set_flops_amount(double flops_amount)
   kernel::actor::simcall_answered([this, flops_amount] {
     boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->set_flops_amount(flops_amount);
   });
-  Activity::set_remaining(flops_amount);
+  set_remaining(flops_amount);
   return this;
 }
 
index 7132643..906b0be 100644 (file)
@@ -75,7 +75,7 @@ IoPtr Io::set_size(sg_size_t size)
   xbt_assert(state_ == State::INITED || state_ == State::STARTING, "Cannot set size once the Io is started");
   kernel::actor::simcall_answered(
       [this, size] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->set_size(size); });
-  Activity::set_remaining(size);
+  set_remaining(size);
   return this;
 }