- /** Creates (but don't start) an async send to the mailbox @p dest */
- static Comm& send_init(MailboxPtr dest);
- /** Creates and start an async send to the mailbox @p dest */
- static Comm& send_async(MailboxPtr dest, void* data, int simulatedByteAmount);
- /** Creates (but don't start) an async recv onto the mailbox @p from */
- static Comm& recv_init(MailboxPtr from);
- /** Creates and start an async recv to the mailbox @p from */
- static Comm& recv_async(MailboxPtr from, void** data);
-
- void start() override;
- void wait() override;
- void wait(double timeout) override;
+ /*! take a vector s4u::CommPtr and return the rank of the first finished one (or -1 if none is done). */
+ static int test_any(std::vector<CommPtr> * comms);
+
+ Activity* start() override;
+ Activity* wait() override;
+ Activity* wait(double timeout) override;
+
+ /** Start the comm, and ignore its result. It can be completely forgotten after that. */
+ Activity* detach();
+ /** Start the comm, and ignore its result. It can be completely forgotten after that. */
+ Activity* detach(void (*cleanFunction)(void*))
+ {
+ cleanFunction_ = cleanFunction;
+ return detach();
+ }