|
SimGrid
3.14.159
Versatile Simulation of Distributed Systems
|
Communication async.
Represents all asynchronous communications, that you can test or wait onto.
#include <comm.hpp>
Public Member Functions | |
| ~Comm () override | |
| void | start () override |
| Starts a previously created activity. More... | |
| void | wait () override |
| Tests whether the given activity is terminated yet. More... | |
| void | wait (double timeout) override |
| Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception. More... | |
| void | setRate (double rate) |
| Sets the maximal communication rate (in byte/sec). More... | |
| void | setSrcData (void *buff) |
| Specify the data to send. More... | |
| void | setSrcDataSize (size_t size) |
| Specify the size of the data to send. More... | |
| void | setSrcData (void *buff, size_t size) |
| Specify the data to send and its size. More... | |
| void | setDstData (void **buff) |
| Specify where to receive the data. More... | |
| void | 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 () |
Public Member Functions inherited from simgrid::s4u::Activity | |
| Activity (Activity const &)=delete | |
| Activity & | operator= (Activity const &)=delete |
| e_s4u_activity_state_t | getState () |
| Cancel that activity. More... | |
| double | getRemains () |
| Get the remaining amount of work that this Activity entails. More... | |
| void | setRemains (double remains) |
| Set the [remaining] amount of work that this Activity will entail. More... | |
| void | 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 | |
| template<class I > | |
| static I | wait_any (I first, I last) |
| template<class I > | |
| static I | wait_any_for (I first, I last, double timeout) |
| static Comm & | send_init (MailboxPtr dest) |
Creates (but don't start) an async send to the mailbox dest. More... | |
| static Comm & | send_async (MailboxPtr dest, void *data, int simulatedByteAmount) |
Creates and start an async send to the mailbox dest. More... | |
| static Comm & | recv_init (MailboxPtr from) |
Creates (but don't start) an async recv onto the mailbox from. More... | |
| static Comm & | recv_async (MailboxPtr from, void **data) |
Creates and start an async recv to the mailbox from. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from simgrid::s4u::Activity | |
| Activity () | |
| virtual | ~Activity () |
|
override |
|
inlinestatic |
take a range of s4u::Comm* (last excluded) and return when one of them is finished. The return value is an iterator on the finished Comms.
|
inlinestatic |
Same as wait_any, but with a timeout. If wait_any_for return because of the timeout last is returned.
|
static |
Creates (but don't start) an async send to the mailbox dest.
|
static |
Creates and start an async send to the mailbox dest.
|
static |
Creates (but don't start) an async recv onto the mailbox from.
|
static |
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 |
Tests whether the given activity is terminated yet.
This is a pure function. Blocks until the activity is terminated
Implements simgrid::s4u::Activity.
|
overridevirtual |
Blocks until the activity is terminated, or until the timeout is elapsed Raises: timeout exception.
Implements simgrid::s4u::Activity.
| void simgrid::s4u::Comm::setRate | ( | double | rate | ) |
Sets the maximal communication rate (in byte/sec).
Must be done before start
| void 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 | ( | ) |