From: Arnaud Giersch Date: Thu, 6 Oct 2022 12:16:55 +0000 (+0200) Subject: Do not expose Activity::set_remaining publicly. X-Git-Tag: v3.34~805 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/206daeb1d282a6ec007938eb8755aed5f0ab91b4?ds=sidebyside Do not expose Activity::set_remaining publicly. Prevents confusion with Comm::set_payload_size. --- diff --git a/ChangeLog b/ChangeLog index 7314ace0cc..bebb7f5cc6 100644 --- 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. diff --git a/include/simgrid/s4u/Activity.hpp b/include/simgrid/s4u/Activity.hpp index 353fcdbaa0..d5d555aa4f 100644 --- a/include/simgrid/s4u/Activity.hpp +++ b/include/simgrid/s4u/Activity.hpp @@ -96,6 +96,11 @@ protected: static std::set* 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 on_veto; static xbt::signal 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; diff --git a/src/s4u/s4u_Comm.cpp b/src/s4u/s4u_Comm.cpp index 1dbfef19e3..2ab9660e3d 100644 --- a/src/s4u/s4u_Comm.cpp +++ b/src/s4u/s4u_Comm.cpp @@ -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(pimpl_)->set_size(bytes); } diff --git a/src/s4u/s4u_Exec.cpp b/src/s4u/s4u_Exec.cpp index a0e91821b6..286340f938 100644 --- a/src/s4u/s4u_Exec.cpp +++ b/src/s4u/s4u_Exec.cpp @@ -110,7 +110,7 @@ ExecPtr Exec::set_flops_amount(double flops_amount) kernel::actor::simcall_answered([this, flops_amount] { boost::static_pointer_cast(pimpl_)->set_flops_amount(flops_amount); }); - Activity::set_remaining(flops_amount); + set_remaining(flops_amount); return this; } diff --git a/src/s4u/s4u_Io.cpp b/src/s4u/s4u_Io.cpp index 71326434ad..906b0bee2d 100644 --- a/src/s4u/s4u_Io.cpp +++ b/src/s4u/s4u_Io.cpp @@ -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(pimpl_)->set_size(size); }); - Activity::set_remaining(size); + set_remaining(size); return this; }