Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
factor surf_action_ in ActivityImpl
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Feb 2019 19:42:25 +0000 (20:42 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Fri, 1 Feb 2019 19:42:25 +0000 (20:42 +0100)
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/ExecImpl.hpp
src/kernel/activity/IoImpl.hpp
src/kernel/activity/SleepImpl.hpp
src/kernel/activity/SynchroRaw.hpp

index 1da043f..8f1267f 100644 (file)
@@ -23,10 +23,12 @@ class XBT_PUBLIC ActivityImpl {
 public:
   ActivityImpl() = default;
   explicit ActivityImpl(std::string name) : name_(name) {}
 public:
   ActivityImpl() = default;
   explicit ActivityImpl(std::string name) : name_(name) {}
+  explicit ActivityImpl(std::string name, resource::Action* surf_action) : name_(name), surf_action_(surf_action) {}
   virtual ~ActivityImpl() = default;
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
   std::string name_;                    /* Activity name if any */
   std::list<smx_simcall_t> simcalls_;   /* List of simcalls waiting for this activity */
   virtual ~ActivityImpl() = default;
   e_smx_state_t state_ = SIMIX_WAITING; /* State of the activity */
   std::string name_;                    /* Activity name if any */
   std::list<smx_simcall_t> simcalls_;   /* List of simcalls waiting for this activity */
+  resource::Action* surf_action_ = nullptr;
 
   virtual void suspend() = 0;
   virtual void resume()  = 0;
 
   virtual void suspend() = 0;
   virtual void resume()  = 0;
index b959baa..0edc385 100644 (file)
@@ -17,7 +17,7 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_process);
 
 simgrid::kernel::activity::ExecImpl::ExecImpl(std::string name, resource::Action* surf_action,
                                               resource::Action* timeout_detector, s4u::Host* host)
 
 simgrid::kernel::activity::ExecImpl::ExecImpl(std::string name, resource::Action* surf_action,
                                               resource::Action* timeout_detector, s4u::Host* host)
-    : ActivityImpl(name), host_(host), surf_action_(surf_action), timeout_detector_(timeout_detector)
+    : ActivityImpl(name, surf_action), host_(host), timeout_detector_(timeout_detector)
 {
   this->state_ = SIMIX_RUNNING;
 
 {
   this->state_ = SIMIX_RUNNING;
 
index 00e0b85..9ad4b5e 100644 (file)
@@ -32,7 +32,6 @@ public:
 
   /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
   s4u::Host* host_ = nullptr;
 
   /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
   s4u::Host* host_ = nullptr;
-  resource::Action* surf_action_; /* The Surf execution action encapsulated */
 private:
   resource::Action* timeout_detector_ = nullptr;
 
 private:
   resource::Action* timeout_detector_ = nullptr;
 
index 55619bf..e61d9ea 100644 (file)
@@ -17,7 +17,7 @@ namespace activity {
 class XBT_PUBLIC IoImpl : public ActivityImpl {
 public:
   ~IoImpl() override;
 class XBT_PUBLIC IoImpl : public ActivityImpl {
 public:
   ~IoImpl() override;
-  explicit IoImpl(std::string name, simgrid::surf::StorageImpl* storage);
+  explicit IoImpl(std::string name, surf::StorageImpl* storage);
 
   void start(sg_size_t size, simgrid::s4u::Io::OpType type);
   void suspend() override;
 
   void start(sg_size_t size, simgrid::s4u::Io::OpType type);
   void suspend() override;
@@ -27,8 +27,7 @@ public:
   double get_remaining();
   sg_size_t get_performed_ioops() { return performed_ioops_; }
 
   double get_remaining();
   sg_size_t get_performed_ioops() { return performed_ioops_; }
 
-  simgrid::surf::StorageImpl* storage_            = nullptr;
-  simgrid::kernel::resource::Action* surf_action_ = nullptr;
+  surf::StorageImpl* storage_                     = nullptr;
   sg_size_t performed_ioops_                      = 0;
   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_start;
   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_completion;
   sg_size_t performed_ioops_                      = 0;
   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_start;
   static simgrid::xbt::signal<void(kernel::activity::IoImplPtr)> on_completion;
index 76fa036..9128912 100644 (file)
@@ -20,7 +20,6 @@ public:
   void post() override;
 
   sg_host_t host                 = nullptr;
   void post() override;
 
   sg_host_t host                 = nullptr;
-  resource::Action* surf_action_ = nullptr;
 };
 }
 }
 };
 }
 }
index 2459efe..c96dd4a 100644 (file)
@@ -20,10 +20,7 @@ public:
   void suspend() override;
   void resume() override;
   void post() override;
   void suspend() override;
   void resume() override;
   void post() override;
-
-  resource::Action* surf_action_ = nullptr;
-  };
-
+};
 }}} // namespace simgrid::kernel::activity
 
 #endif
 }}} // namespace simgrid::kernel::activity
 
 #endif