Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
A canceled Activity is a completed Activity too
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 9 Mar 2021 15:50:46 +0000 (16:50 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Tue, 9 Mar 2021 15:54:38 +0000 (16:54 +0100)
src/s4u/s4u_Exec.cpp
src/s4u/s4u_Io.cpp

index 7267df2..223cf5b 100644 (file)
@@ -64,6 +64,7 @@ Exec* Exec::cancel()
 {
   kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::ExecImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
+  on_completion(*this);
   return this;
 }
 
@@ -178,7 +179,6 @@ ExecPtr Exec::set_hosts(const std::vector<Host*>& hosts)
   return this;
 }
 
-///////////// SEQUENTIAL EXECUTIONS ////////
 Exec* Exec::start()
 {
   if (is_parallel())
@@ -236,6 +236,7 @@ double Exec::get_remaining_ratio() const
 
 } // namespace s4u
 } // namespace simgrid
+
 /* **************************** Public C interface *************************** */
 void sg_exec_set_bound(sg_exec_t exec, double bound)
 {
index dd45f7a..926f269 100644 (file)
@@ -47,6 +47,7 @@ Io* Io::cancel()
 {
   simgrid::kernel::actor::simcall([this] { boost::static_pointer_cast<kernel::activity::IoImpl>(pimpl_)->cancel(); });
   state_ = State::CANCELED;
+  on_completion(*this);
   return this;
 }