Interface for exchanging serialized metadata and payload between ranks. More...
#include <core.hpp>
Classes | |
| class | Message |
| Message class for communication. More... | |
Public Member Functions | |
| virtual void | send (std::unique_ptr< Message > message)=0 |
| Send a single message to a remote rank. More... | |
| virtual void | send (std::vector< std::unique_ptr< Message >> &&messages)=0 |
| Send messages to remote ranks. More... | |
| virtual void | progress ()=0 |
| Progress the communication state machine. More... | |
| virtual std::vector< std::unique_ptr< Message > > | recv ()=0 |
| Receive messages from remote ranks. More... | |
| virtual void | finish ()=0 |
| Signal that no more messages will be sent. More... | |
| virtual bool | is_idle () const =0 |
| Check if the communication layer is currently idle. More... | |
Interface for exchanging serialized metadata and payload between ranks.
The MetadataPayloadExchange class defines an abstract interface for transmitting messages that contain both serialized metadata and a data payload. This abstraction simplifies scenarios where metadata and payload must be exchanged together as a single logical unit.
Concrete implementations, such as TagMetadataPayloadExchange, use the Communicator to implement this interface. In the future, other implementations may leverage specialized features beyond the basic Communicator API to further optimize this communication pattern.
|
pure virtual |
Signal that no more messages will be sent.
After calling this method, no further calls to send() are permitted. The implementation sends protocol-level termination markers to all peers so that each receiver knows the exact number of application messages to expect. This enables safe reuse of operation IDs: once all termination markers have been received and all expected messages processed, the communication layer considers itself idle and the tag/op_id can be reused.
| std::logic_error | If called more than once. |
Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.
|
pure virtual |
Check if the communication layer is currently idle.
Indicates whether there are any active or pending communication operations. Before finish() is called, a return value of true means no I/O operations are in progress. After finish() is called, true additionally requires that all peers have sent their termination markers and all expected messages have been received, meaning the op_id can safely be reused.
true if the communication layer is idle; false if activity is ongoing. Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.
|
pure virtual |
Progress the communication state machine.
Advances the internal state of the communication layer by processing pending operations such as receiving metadata, setting up data transfers, completing data transfers, and cleaning up completed operations. Completed messages are stored internally and can be retrieved via recv().
This method should be called periodically to make progress on communication.
Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.
|
pure virtual |
Receive messages from remote ranks.
The messages received by the calling process are guaranteed to be received in the same order as they were sent by the source remote rank. No ordering is guaranteed between messages received from different remote ranks.
Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.
|
pure virtual |
Send a single message to a remote rank.
Takes ownership of a ready message and manages its transmission, including metadata sending and coordination of data transfer.
The messages sent from the calling process to a destination remote rank are guaranteed to be received in the same order as they were sent. No ordering is guaranteed between messages sent to different remote ranks.
| message | Message ready to be sent to a remote rank. |
Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.
|
pure virtual |
Send messages to remote ranks.
Takes ownership of ready messages and manages their transmission, including metadata sending and coordination of data transfer.
The messages sent from the calling process to a destination remote rank are guaranteed to be received in the same order as they were sent. No ordering is guaranteed between messages sent to different remote ranks.
| messages | Vector of messages ready to be sent to remote ranks. |
Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.