- static xbt::signal<void(Actor const&)> on_sender_start;
- static xbt::signal<void(Actor const&)> on_receiver_start;
- static xbt::signal<void(Actor const&)> on_completion;
-
- /*! take a vector s4u::CommPtr and return when one of them is finished.
- * The return value is the rank of the first finished CommPtr. */
- static int wait_any(const std::vector<CommPtr>* comms) { return wait_any_for(comms, -1); }
- /*! Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.*/
- static int wait_any_for(const std::vector<CommPtr>* comms_in, double timeout);
-
- /*! take a vector s4u::CommPtr and return when all of them is finished. */
- static void wait_all(const std::vector<CommPtr>* comms);
- /*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
- 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. */
- Comm* detach();
- /** Start the comm, and ignore its result. It can be completely forgotten after that. */
- Comm* detach(void (*clean_function)(void*))
- {
- clean_fun_ = clean_function;
- return detach();
- }
-
- /** Sets the maximal communication rate (in byte/sec). Must be done before start */
- CommPtr set_rate(double rate);
+ static void send(kernel::actor::ActorImpl* sender, const Mailbox* mbox, double task_size, double rate, void* src_buff,
+ size_t src_buff_size,
+ const std::function<bool(void*, void*, simgrid::kernel::activity::CommImpl*)>& match_fun,
+ const std::function<void(simgrid::kernel::activity::CommImpl*, void*, size_t)>& copy_data_fun,
+ void* data, double timeout);
+ static void recv(kernel::actor::ActorImpl* receiver, const Mailbox* mbox, void* dst_buff, size_t* dst_buff_size,
+ const std::function<bool(void*, void*, simgrid::kernel::activity::CommImpl*)>& match_fun,
+ const std::function<void(simgrid::kernel::activity::CommImpl*, void*, size_t)>& copy_data_fun,
+ void* data, double timeout, double rate);
+
+ /* \static
+ * "One-sided" communications. This way of communicating bypasses the mailbox and actors mechanism. It creates a
+ * communication (vetoabled, asynchronous, or synchronous) directly between two hosts. There is really no limit on
+ * the hosts involved. In particular, the actor creating such a communication does not have to be on one of the
+ * involved hosts! Enjoy the comfort of the simulator :)
+ */
+ static CommPtr sendto_init(); /* Source and Destination hosts have to be set before the communication can start */
+ static CommPtr sendto_init(Host* from, Host* to);
+ static CommPtr sendto_async(Host* from, Host* to, uint64_t simulated_size_in_bytes);
+ static void sendto(Host* from, Host* to, uint64_t simulated_size_in_bytes);
+
+ CommPtr set_source(Host* from);
+ Host* get_source() const;
+ CommPtr set_destination(Host* to);
+ Host* get_destination() const;
+
+ /* Mailbox-based communications */
+ CommPtr set_mailbox(Mailbox* mailbox);
+ /** Retrieve the mailbox on which this comm acts */
+ Mailbox* get_mailbox() const { return mailbox_; }