Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New functions: Comm::sendto_{init,async}
[simgrid.git] / include / simgrid / s4u / Comm.hpp
index a49d52a..86bbc5c 100644 (file)
@@ -20,8 +20,10 @@ namespace s4u {
  */
 class XBT_PUBLIC Comm : public Activity_T<Comm> {
   Mailbox* mailbox_                   = nullptr;
-  kernel::actor::ActorImpl* sender_   = nullptr;
+  kernel::actor::ActorImpl* sender_   = nullptr; /* specified for normal mailbox-based communications*/
   kernel::actor::ActorImpl* receiver_ = nullptr;
+  Host* from_                         = nullptr; /* specified only for direct host-to-host communications */
+  Host* to_                           = nullptr;
   double rate_                        = -1;
   void* dst_buff_                     = nullptr;
   size_t dst_buff_size_               = 0;
@@ -42,6 +44,12 @@ public:
 
   ~Comm() override;
 
+  /*! Creates a communication beween the two given hosts, bypassing the mailbox mechanism. */
+  static CommPtr sendto_init(Host* from, Host* to);
+  /*! Creates and start a communication of the given amount of bytes beween the two given hosts, bypassing the mailbox
+   * mechanism */
+  static CommPtr sendto_async(Host* from, Host* to, double simulated_size_in_bytes);
+
   static xbt::signal<void(Comm const&, bool is_sender)> on_start;
   static xbt::signal<void(Comm const&)> on_completion;