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

This is a simple wrapper class around S4U asynchronous communication checking methods. More...

#include <S4U_PendingCommunication.h>

Public Types

enum  OperationType { SENDING, RECEIVING }
 The communication operation's type.
 

Public Member Functions

 S4U_PendingCommunication (simgrid::s4u::Mailbox *mailbox, OperationType operation_type)
 Constructor. More...
 
std::unique_ptr< SimulationMessagewait ()
 Wait for the pending communication to complete. More...
 
std::unique_ptr< SimulationMessagewait (double timeout)
 Wait for the pending communication to complete with a timeout. More...
 

Static Public Member Functions

static unsigned long waitForSomethingToHappen (std::vector< S4U_PendingCommunication * > pending_comms, double timeout)
 Wait for any pending communication completion. More...
 
static unsigned long waitForSomethingToHappen (std::vector< std::shared_ptr< S4U_PendingCommunication >> pending_comms, double timeout)
 Wait for any pending communication completion. More...
 

Public Attributes

simgrid::s4u::CommPtr comm_ptr
 The SimGrid communication handle.
 
simgrid::s4u::Mailbox * mailbox
 The mailbox.
 
OperationType operation_type
 The operation type.
 
std::unique_ptr< SimulationMessagesimulation_message
 The message.
 

Detailed Description

This is a simple wrapper class around S4U asynchronous communication checking methods.

Constructor & Destructor Documentation

◆ S4U_PendingCommunication()

wrench::S4U_PendingCommunication::S4U_PendingCommunication ( simgrid::s4u::Mailbox *  mailbox,
OperationType  operation_type 
)
inline

Constructor.

Parameters
mailboxthe mailbox
operation_typethe operation type

Member Function Documentation

◆ wait() [1/2]

std::unique_ptr< SimulationMessage > wrench::S4U_PendingCommunication::wait ( )

Wait for the pending communication to complete.

Returns
A (unique pointer to a) simulation message
Exceptions
std::shared_ptr<NetworkError>

◆ wait() [2/2]

std::unique_ptr< SimulationMessage > wrench::S4U_PendingCommunication::wait ( double  timeout)

Wait for the pending communication to complete with a timeout.

Parameters
timeouta timeout in seconds
Returns
A (unique pointer to a) simulation message
Exceptions
std::shared_ptr<NetworkError>

◆ waitForSomethingToHappen() [1/2]

unsigned long wrench::S4U_PendingCommunication::waitForSomethingToHappen ( std::vector< S4U_PendingCommunication * >  pending_comms,
double  timeout 
)
static

Wait for any pending communication completion.

Parameters
pending_commsa list of pending communications
timeouttimeout value in seconds (-1 means no timeout)
Returns
the index of the comm to which something happened (success or failure), or ULONG_MAX if nothing happened before the timeout expired
Exceptions
std::invalid_argument

◆ waitForSomethingToHappen() [2/2]

unsigned long wrench::S4U_PendingCommunication::waitForSomethingToHappen ( std::vector< std::shared_ptr< S4U_PendingCommunication >>  pending_comms,
double  timeout 
)
static

Wait for any pending communication completion.

Parameters
pending_commsa list of pending communications
timeouttimeout value in seconds (-1 means no timeout)
Returns
the index of the comm to which something happened (success or failure)
Exceptions
std::invalid_argument

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