WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
Static Public Member Functions | Static Public Attributes | List of all members
wrench::S4U_Mailbox Class Reference

Wrappers around S4U's communication methods. More...

#include <S4U_Mailbox.h>

Static Public Member Functions

static void createMailboxPool (unsigned long num_mailboxes)
 Create the pool of mailboxes to use. More...
 
static void dputMessage (simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg)
 Asynchronously send a message to a mailbox in a "fire and forget" fashion. More...
 
static simgrid::s4u::Mailbox * generateUniqueMailbox (std::string prefix)
 Generate a unique (non-temporary) mailbox. More...
 
static unsigned long generateUniqueSequenceNumber ()
 Generate a unique sequence number. More...
 
static std::unique_ptr< SimulationMessagegetMessage (simgrid::s4u::Mailbox *mailbox)
 Synchronously receive a message from a mailbox. More...
 
static std::unique_ptr< SimulationMessagegetMessage (simgrid::s4u::Mailbox *mailbox, double timeout)
 Synchronously receive a message from a mailbox, with a timeout. More...
 
static simgrid::s4u::Mailbox * getTemporaryMailbox ()
 Get a temporary mailbox. More...
 
static std::shared_ptr< S4U_PendingCommunicationigetMessage (simgrid::s4u::Mailbox *mailbox)
 Asynchronously receive a message from a mailbox. More...
 
static std::shared_ptr< S4U_PendingCommunicationiputMessage (simgrid::s4u::Mailbox *mailbox, SimulationMessage *msg)
 Asynchronously send a message to a mailbox. More...
 
static void putMessage (simgrid::s4u::Mailbox *mailbox, SimulationMessage *m)
 Synchronously send a message to a mailbox. More...
 
static void retireTemporaryMailbox (simgrid::s4u::Mailbox *mailbox)
 Retire a temporary mailbox. More...
 

Static Public Attributes

static unsigned long mailbox_pool_size
 

Detailed Description

Wrappers around S4U's communication methods.

Member Function Documentation

◆ createMailboxPool()

void wrench::S4U_Mailbox::createMailboxPool ( unsigned long  num_mailboxes)
static

Create the pool of mailboxes to use.

Parameters
num_mailboxesnumb mailboxes in pool

◆ dputMessage()

void wrench::S4U_Mailbox::dputMessage ( simgrid::s4u::Mailbox *  mailbox,
SimulationMessage msg 
)
static

Asynchronously send a message to a mailbox in a "fire and forget" fashion.

Parameters
mailboxthe mailbox
msgthe SimulationMessage

◆ generateUniqueMailbox()

simgrid::s4u::Mailbox * wrench::S4U_Mailbox::generateUniqueMailbox ( std::string  prefix)
static

Generate a unique (non-temporary) mailbox.

Parameters
prefixmailbox name prefix
Returns

◆ generateUniqueSequenceNumber()

unsigned long wrench::S4U_Mailbox::generateUniqueSequenceNumber ( )
static

Generate a unique sequence number.

Returns
a unique sequence number

◆ getMessage() [1/2]

std::unique_ptr< SimulationMessage > wrench::S4U_Mailbox::getMessage ( simgrid::s4u::Mailbox *  mailbox)
static

Synchronously receive a message from a mailbox.

Parameters
mailboxthe mailbox
Returns
the message, or nullptr (in which case it's likely a brutal termination)
Exceptions
std::shared_ptr<NetworkError>

◆ getMessage() [2/2]

std::unique_ptr< SimulationMessage > wrench::S4U_Mailbox::getMessage ( simgrid::s4u::Mailbox *  mailbox,
double  timeout 
)
static

Synchronously receive a message from a mailbox, with a timeout.

Parameters
mailboxthe mailbox
timeouta timeout value in seconds (<0 means never timeout)
Returns
the message, or nullptr (in which case it's likely a brutal termination)
Exceptions
std::shared_ptr<NetworkError>

◆ getTemporaryMailbox()

simgrid::s4u::Mailbox * wrench::S4U_Mailbox::getTemporaryMailbox ( )
static

Get a temporary mailbox.

Returns
a temporary mailbox

◆ igetMessage()

std::shared_ptr< S4U_PendingCommunication > wrench::S4U_Mailbox::igetMessage ( simgrid::s4u::Mailbox *  mailbox)
static

Asynchronously receive a message from a mailbox.

Parameters
mailboxthe mailbox
Returns
a pending communication handle
Exceptions
std::shared_ptr<NetworkError>

◆ iputMessage()

std::shared_ptr< S4U_PendingCommunication > wrench::S4U_Mailbox::iputMessage ( simgrid::s4u::Mailbox *  mailbox,
SimulationMessage msg 
)
static

Asynchronously send a message to a mailbox.

Parameters
mailboxthe mailbox
msgthe SimulationMessage
Returns
a pending communication handle
Exceptions
std::shared_ptr<NetworkError>

◆ putMessage()

void wrench::S4U_Mailbox::putMessage ( simgrid::s4u::Mailbox *  mailbox,
SimulationMessage msg 
)
static

Synchronously send a message to a mailbox.

Parameters
mailboxthe mailbox
msgthe SimulationMessage
Exceptions
std::shared_ptr<NetworkError>

◆ retireTemporaryMailbox()

void wrench::S4U_Mailbox::retireTemporaryMailbox ( simgrid::s4u::Mailbox *  mailbox)
static

Retire a temporary mailbox.

Parameters
mailboxthe mailbox to retire

The documentation for this class was generated from the following files: