Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
NetZone::get_netpoint: gets the netzone's netpoint
[simgrid.git] / include / simgrid / s4u / Comm.hpp
index 4509432..9fb2288 100644 (file)
@@ -37,6 +37,9 @@ class XBT_PUBLIC Comm : public Activity_T<Comm> {
 
   Comm() = default;
 
+protected:
+  void complete(Activity::State state) override;
+
 public:
 #ifndef DOXYGEN
   friend Mailbox; // Factory of comms
@@ -46,9 +49,20 @@ public:
 
   /*! 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 */
+  /** Do an asynchronous communication between two arbitrary hosts.
+   *
+   * This initializes a communication that completely bypass the mailbox and actors mechanism.
+   * There is really no limit on the hosts involved. In particular, the actor does not have to be on one of the involved
+   * hosts.
+   */
   static CommPtr sendto_async(Host* from, Host* to, double simulated_size_in_bytes);
+  /** Do a blocking communication between two arbitrary hosts.
+   *
+   * This starts a blocking communication right away, bypassing the mailbox and actors mechanism.
+   * The calling actor is blocked until the end of the communication; there is really no limit on the hosts involved.
+   * In particular, the actor does not have to be on one of the involved hosts. Enjoy the comfort of the simulator :)
+   */
+  static void sendto(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;
@@ -65,9 +79,7 @@ public:
   static int test_any(const std::vector<CommPtr>* comms);
 
   Comm* start() override;
-  Comm* wait() override;
   Comm* wait_for(double timeout) override;
-  Comm* cancel() override;
   bool test() override;
 
   /** Start the comm, and ignore its result. It can be completely forgotten after that. */