Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix Exec::get_start_time()
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Mon, 8 Feb 2021 22:15:04 +0000 (23:15 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 9 Feb 2021 08:16:59 +0000 (09:16 +0100)
include/simgrid/s4u/Exec.hpp
src/s4u/s4u_Exec.cpp

index 6cb7870..afc242f 100644 (file)
@@ -37,6 +37,8 @@ class XBT_PUBLIC Exec : public Activity_T<Exec> {
   std::vector<double> bytes_amounts_;
   std::vector<Host*> hosts_;
   bool parallel_ = false;
+  double start_time_ = -1.0;
+  double finish_time_ = -1.0;
   Exec();
 
 public:
@@ -77,7 +79,7 @@ public:
   Exec* cancel() override;
   Host* get_host() const;
   unsigned int get_host_number() const;
-  double get_start_time() const;
+  double get_start_time() const { return start_time_; }
   double get_finish_time() const;
   double get_cost() const;
   bool is_parallel() const { return parallel_; }
index bc50765..731631f 100644 (file)
@@ -116,10 +116,6 @@ unsigned int Exec::get_host_number() const
 {
   return static_cast<kernel::activity::ExecImpl*>(pimpl_.get())->get_host_number();
 }
-double Exec::get_start_time() const
-{
-  return (pimpl_->surf_action_ == nullptr) ? -1 : pimpl_->surf_action_->get_start_time();
-}
 double Exec::get_finish_time() const
 {
   return (pimpl_->surf_action_ == nullptr) ? -1 : pimpl_->surf_action_->get_finish_time();
@@ -205,6 +201,7 @@ Exec* Exec::start()
     pimpl_->suspend();
 
   state_ = State::STARTED;
+  start_time_ = pimpl_->surf_action_->get_start_time();
   on_start(*this);
   return this;
 }