]> AND Public Git Repository - simgrid.git/blobdiff - src/kernel/activity/CommImpl.hpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix ExecImpl::get_remaining to return the right value when not started
[simgrid.git] / src / kernel / activity / CommImpl.hpp
index 54ca57aa18ecd48667870e5394e8b4a81262b027..a71052f3de0b4e8cd7cc7383737a732519fbcc2a 100644 (file)
@@ -8,8 +8,6 @@
 
 #include "src/kernel/activity/ActivityImpl.hpp"
 #include "src/kernel/actor/ActorImpl.hpp"
-#include "surf/surf.hpp"
-
 
 namespace simgrid {
 namespace kernel {
@@ -19,6 +17,8 @@ class XBT_PUBLIC CommImpl : public ActivityImpl_T<CommImpl> {
   ~CommImpl() override;
   void cleanup_surf();
 
+  static void (*copy_data_callback_)(CommImpl*, void*, size_t);
+
   double rate_       = 0.0;
   double size_       = 0.0;
   bool detached_     = false;   /* If detached or not */
@@ -30,6 +30,8 @@ class XBT_PUBLIC CommImpl : public ActivityImpl_T<CommImpl> {
 public:
   enum class Type { SEND, RECEIVE };
 
+  static void set_copy_data_callback(void (*callback)(CommImpl*, void*, size_t));
+
   explicit CommImpl(Type type) : type_(type) {}
   CommImpl(s4u::Host* from, s4u::Host* to, double bytes);
 
@@ -44,13 +46,20 @@ public:
   MailboxImpl* get_mailbox() const { return mbox_; }
   bool detached() const { return detached_; }
 
+  std::vector<s4u::Link*> get_traversed_links() const;
   void copy_data();
 
+  bool test() override;
+  void wait_for(actor::ActorImpl* issuer, double timeout) override;
+  static ssize_t test_any(const actor::ActorImpl* issuer, const std::vector<CommImpl*>& comms);
+  static void wait_any_for(actor::ActorImpl* issuer, const std::vector<CommImpl*>& comms, double timeout);
+
   CommImpl* start();
   void suspend() override;
   void resume() override;
   void cancel() override;
   void post() override;
+  void set_exception(actor::ActorImpl* issuer) override;
   void finish() override;
 
   const Type type_ = Type::SEND; /* Type of the communication (SEND or RECEIVE) */
@@ -81,6 +90,8 @@ expectations of the other side, too. See  */
 
   void* src_data_ = nullptr; /* User data associated to the communication */
   void* dst_data_ = nullptr;
+  static xbt::signal<void(CommImpl const&)> on_start;
+  static xbt::signal<void(CommImpl const&)> on_completion;
 };
 } // namespace activity
 } // namespace kernel