WRENCH  1.11
Cyberinfrastructure Simulation Workbench
Overview Installation Getting Started WRENCH 101 WRENCH 102
S4U_PendingCommunication.h
1 
11 #ifndef WRENCH_S4U_PENDINGCOMMUNICATION_H
12 #define WRENCH_S4U_PENDINGCOMMUNICATION_H
13 
14 
15 #include <vector>
16 #include <simgrid/s4u/Comm.hpp>
17 #include "wrench/util/MessageManager.h"
18 
19 //#include "S4U_PendingCommunication.h"
20 
21 namespace wrench {
22 
23  class SimulationMessage;
24 
25  /*******************/
27  /*******************/
28 
31  public:
32 
37  SENDING,
38  RECEIVING
39  };
40 
48 
49  std::unique_ptr<SimulationMessage> wait();
50  std::unique_ptr<SimulationMessage> wait(double timeout);
51 
52  static unsigned long waitForSomethingToHappen(
53  std::vector<std::shared_ptr<S4U_PendingCommunication>> pending_comms,
54  double timeout);
55 
56  static unsigned long waitForSomethingToHappen(
57  std::vector<S4U_PendingCommunication*> pending_comms,
58  double timeout);
59 
60 // ~S4U_PendingCommunication() default;
61 
63  simgrid::s4u::CommPtr comm_ptr;
65  std::unique_ptr<SimulationMessage> simulation_message;
67  simgrid::s4u::Mailbox *mailbox;
70  };
71 
72  /*******************/
74  /*******************/
75 
76 };
77 
78 
79 #endif //WRENCH_S4U_PENDINGCOMMUNICATION_H
wrench::S4U_PendingCommunication::comm_ptr
simgrid::s4u::CommPtr comm_ptr
The SimGrid communication handle.
Definition: S4U_PendingCommunication.h:63
wrench::S4U_PendingCommunication::simulation_message
std::unique_ptr< SimulationMessage > simulation_message
The message.
Definition: S4U_PendingCommunication.h:65
wrench::S4U_PendingCommunication::operation_type
OperationType operation_type
The operation type.
Definition: S4U_PendingCommunication.h:69
wrench::S4U_PendingCommunication::S4U_PendingCommunication
S4U_PendingCommunication(simgrid::s4u::Mailbox *mailbox, OperationType operation_type)
Constructor.
Definition: S4U_PendingCommunication.h:47
wrench::S4U_PendingCommunication
This is a simple wrapper class around S4U asynchronous communication checking methods.
Definition: S4U_PendingCommunication.h:30
wrench
Definition: Action.cpp:28
wrench::S4U_PendingCommunication::waitForSomethingToHappen
static unsigned long waitForSomethingToHappen(std::vector< std::shared_ptr< S4U_PendingCommunication >> pending_comms, double timeout)
Wait for any pending communication completion.
Definition: S4U_PendingCommunication.cpp:96
wrench::S4U_PendingCommunication::mailbox
simgrid::s4u::Mailbox * mailbox
The mailbox.
Definition: S4U_PendingCommunication.h:67
wrench::S4U_PendingCommunication::OperationType
OperationType
The communication operation's type.
Definition: S4U_PendingCommunication.h:36
wrench::S4U_PendingCommunication::wait
std::unique_ptr< SimulationMessage > wait()
Wait for the pending communication to complete.
Definition: S4U_PendingCommunication.cpp:35