Classes | Public Member Functions | List of all members
rapidsmpf::communicator::MetadataPayloadExchange Class Referenceabstract

Interface for exchanging serialized metadata and payload between ranks. More...

#include <core.hpp>

Inheritance diagram for rapidsmpf::communicator::MetadataPayloadExchange:
rapidsmpf::communicator::TagMetadataPayloadExchange

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 bool is_idle () const =0
 Check if the communication layer is currently idle. More...
 

Detailed Description

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.

Note
This class is not thread-safe. All methods must be called from the same thread.
All concrete implementations are expected to provide a constructor with the following signature:
DerivedMetadataPayloadExchange(
std::shared_ptr<Communicator> comm,
OpID op_id,
std::function<std::unique_ptr<Buffer>(std::size_t)> allocate_buffer_fn,
std::shared_ptr<Statistics> statistics
);
std::int32_t OpID
Operation ID defined by the user. This allows users to concurrently execute multiple operations,...

Definition at line 47 of file core.hpp.

Member Function Documentation

◆ is_idle()

virtual bool rapidsmpf::communicator::MetadataPayloadExchange::is_idle ( ) const
pure virtual

Check if the communication layer is currently idle.

Indicates whether there are any active or pending communication operations. A return value of true means the exchange is idling, i.e. no operations are currently in progress. However, new send/receive requests may still be submitted in the future; this does not imply that all communication has been fully finalized or globally synchronized.

Returns
true if the communication layer is idle; false if activity is ongoing.

Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.

◆ progress()

virtual void rapidsmpf::communicator::MetadataPayloadExchange::progress ( )
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.

◆ recv()

virtual std::vector<std::unique_ptr<Message> > rapidsmpf::communicator::MetadataPayloadExchange::recv ( )
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.

Returns
Vector of completed messages ready for local processing.

Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.

◆ send() [1/2]

virtual void rapidsmpf::communicator::MetadataPayloadExchange::send ( std::unique_ptr< Message message)
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.

Parameters
messageMessage ready to be sent to a remote rank.

Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.

◆ send() [2/2]

virtual void rapidsmpf::communicator::MetadataPayloadExchange::send ( std::vector< std::unique_ptr< Message >> &&  messages)
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.

Parameters
messagesVector of messages ready to be sent to remote ranks.

Implemented in rapidsmpf::communicator::TagMetadataPayloadExchange.


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