Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Activity refactoring
[simgrid.git] / include / simgrid / s4u / Exec.hpp
index 3aa1400..09af6ea 100644 (file)
@@ -32,6 +32,7 @@ namespace s4u {
 class XBT_PUBLIC Exec : public Activity_T<Exec> {
 #ifndef DOXYGEN
   friend kernel::activity::ExecImpl;
+  friend kernel::EngineImpl; // Auto-completes the execs of maestro (in simDAG)
 #endif
 
   bool parallel_ = false;
@@ -39,15 +40,15 @@ class XBT_PUBLIC Exec : public Activity_T<Exec> {
 protected:
   explicit Exec(kernel::activity::ExecImplPtr pimpl);
 
-  void complete(Activity::State state) override;
+  void reset();
 
 public:
 #ifndef DOXYGEN
   Exec(Exec const&) = delete;
   Exec& operator=(Exec const&) = delete;
 #endif
+  /*! Signal fired each time that an execution actually starts (no veto) */
   static xbt::signal<void(Exec const&)> on_start;
-  static xbt::signal<void(Exec const&)> on_completion;
 
   static ExecPtr init();
   Exec* start() override;
@@ -71,6 +72,8 @@ public:
   double get_remaining_ratio() const;
   ExecPtr set_host(Host* host);
   ExecPtr set_hosts(const std::vector<Host*>& hosts);
+  ExecPtr unset_host();
+  ExecPtr unset_hosts() { return unset_host(); }
 
   ExecPtr set_flops_amount(double flops_amount);
   ExecPtr set_flops_amounts(const std::vector<double>& flops_amounts);