SimGrid
3.18
Versatile Simulation of Distributed Systems
|
Communication async.
Represents all asynchronous communications, that you can test or wait onto.
#include <Comm.hpp>
Public Member Functions | |
virtual | ~Comm () |
XBT_ATTRIB_DEPRECATED_v320 ("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr send_init(MailboxPtr dest) | |
Creates (but don't start) an async send to the mailbox dest . More... | |
XBT_ATTRIB_DEPRECATED_v320 ("Use Mailbox::put_init(): v3.20 will turn this warning into an error.") static CommPtr send_init(MailboxPtr dest | |
Creates (but don't start) an async send to the mailbox dest . More... | |
XBT_ATTRIB_DEPRECATED_v320 ("Use Mailbox::put_async(): v3.20 will turn this warning into an error.") static CommPtr send_async(MailboxPtr dest | |
Creates and start an async send to the mailbox dest . More... | |
XBT_ATTRIB_DEPRECATED_v320 ("Use Mailbox::get_init(): v3.20 will turn this warning into an error.") static CommPtr recv_init(MailboxPtr from) | |
Creates (but don't start) an async recv onto the mailbox from . More... | |
XBT_ATTRIB_DEPRECATED_v320 ("Use Mailbox::get_async(): v3.20 will turn this warning into an error.") static CommPtr recv_async(MailboxPtr from | |
Creates and start an async recv to the mailbox from . More... | |
Activity * | start () override |
Starts a previously created activity. More... | |
Activity * | wait () override |
Block the calling actor until the communication is finished. More... | |
Activity * | wait (double timeout) override |
Block the calling actor until the communication is finished, or until timeout. More... | |
Activity * | detach () |
Start the comm, and ignore its result. More... | |
Activity * | detach (void(*cleanFunction)(void *)) |
Start the comm, and ignore its result. More... | |
Activity * | setRate (double rate) |
Sets the maximal communication rate (in byte/sec). More... | |
Activity * | setSrcData (void *buff) |
Specify the data to send. More... | |
Activity * | setSrcDataSize (size_t size) |
Specify the size of the data to send. More... | |
Activity * | setSrcData (void *buff, size_t size) |
Specify the data to send and its size. More... | |
Activity * | setDstData (void **buff) |
Specify where to receive the data. More... | |
Activity * | setDstData (void **buff, size_t size) |
Specify the buffer in which the data should be received. More... | |
size_t | getDstDataSize () |
Retrieve the size of the received data. More... | |
bool | test () |
Activity * | cancel () |
MailboxPtr | getMailbox () |
Retrieve the mailbox on which this comm acts. More... | |
![]() | |
Activity (Activity const &)=delete | |
Activity & | operator= (Activity const &)=delete |
e_s4u_activity_state_t | getState () |
Cancel that activity. More... | |
virtual double | getRemains () |
Get the remaining amount of work that this Activity entails. More... | |
Activity * | setRemains (double remains) |
Set the [remaining] amount of work that this Activity will entail. More... | |
Activity * | setUserData (void *data) |
Put some user data onto the Activity. More... | |
void * | getUserData () |
Retrieve the user data of the Activity. More... | |
Static Public Member Functions | |
static int | wait_any (std::vector< CommPtr > *comms) |
static int | wait_any_for (std::vector< CommPtr > *comms_in, double timeout) |
static void | wait_all (std::vector< CommPtr > *comms) |
Public Attributes | |
friend | Mailbox |
void * | data |
void int | simulatedByteAmount |
void ** | data |
Friends | |
void | intrusive_ptr_release (simgrid::s4u::Comm *c) |
void | intrusive_ptr_add_ref (simgrid::s4u::Comm *c) |
Additional Inherited Members | |
![]() | |
Activity ()=default | |
virtual | ~Activity ()=default |
|
virtual |
|
inlinestatic |
take a vector s4u::CommPtr and return when one of them is finished. The return value is the rank of the first finished CommPtr.
|
inlinestatic |
Same as wait_any, but with a timeout. If the timeout occurs, parameter last is returned.
take a vector s4u::CommPtr and return when all of them is finished.
|
inline |
Creates (but don't start) an async send to the mailbox dest
.
simgrid::s4u::Comm::XBT_ATTRIB_DEPRECATED_v320 | ( | "Use Mailbox::put_init(): v3.20 will turn this warning into an error." | ) |
Creates (but don't start) an async send to the mailbox dest
.
simgrid::s4u::Comm::XBT_ATTRIB_DEPRECATED_v320 | ( | "Use Mailbox::put_async(): v3.20 will turn this warning into an error." | ) |
Creates and start an async send to the mailbox dest
.
|
inline |
Creates (but don't start) an async recv onto the mailbox from
.
simgrid::s4u::Comm::XBT_ATTRIB_DEPRECATED_v320 | ( | "Use Mailbox::get_async(): v3.20 will turn this warning into an error." | ) |
Creates and start an async recv to the mailbox from
.
|
overridevirtual |
Starts a previously created activity.
This function is optional: you can call wait() even if you didn't call start()
Implements simgrid::s4u::Activity.
|
overridevirtual |
Block the calling actor until the communication is finished.
Implements simgrid::s4u::Activity.
|
overridevirtual |
Block the calling actor until the communication is finished, or until timeout.
On timeout, an exception is thrown.
timeout | the amount of seconds to wait for the comm termination. Negative values denote infinite wait times. 0 as a timeout returns immediately. |
Implements simgrid::s4u::Activity.
Activity * simgrid::s4u::Comm::detach | ( | ) |
Start the comm, and ignore its result.
It can be completely forgotten after that.
Start the comm, and ignore its result.
It can be completely forgotten after that.
Activity * simgrid::s4u::Comm::setRate | ( | double | rate | ) |
Sets the maximal communication rate (in byte/sec).
Must be done before start
Activity * simgrid::s4u::Comm::setSrcDataSize | ( | size_t | size | ) |
Specify the size of the data to send.
Specify the data to send and its size.
Specify the buffer in which the data should be received.
size_t simgrid::s4u::Comm::getDstDataSize | ( | ) |
Retrieve the size of the received data.
bool simgrid::s4u::Comm::test | ( | ) |
Activity * simgrid::s4u::Comm::cancel | ( | ) |
MailboxPtr simgrid::s4u::Comm::getMailbox | ( | ) |
Retrieve the mailbox on which this comm acts.
|
friend |
|
friend |
friend simgrid::s4u::Comm::Mailbox |
void * simgrid::s4u::Comm::data |
void int simgrid::s4u::Comm::simulatedByteAmount |