Public Member Functions | List of all members
rapidsmpf::streaming::AllReduce Class Reference

Asynchronous (coroutine) interface to coll::AllReduce. More...

#include <allreduce.hpp>

Public Member Functions

 AllReduce (std::shared_ptr< Context > ctx, std::shared_ptr< Communicator > comm, std::unique_ptr< Buffer > input, std::unique_ptr< Buffer > output, OpID op_id, coll::ReduceOperator reduce_operator)
 Construct an asynchronous allreduce. More...
 
 AllReduce (AllReduce const &)=delete
 
AllReduceoperator= (AllReduce const &)=delete
 
 AllReduce (AllReduce &&)=delete
 
AllReduceoperator= (AllReduce &&)=delete
 
std::shared_ptr< Context > const & ctx () const noexcept
 Gets the streaming context associated with this AllReduce object. More...
 
std::shared_ptr< Communicator > const & comm () const noexcept
 Gets the communicator associated with this AllReduce. More...
 
coro::task< std::pair< std::unique_ptr< Buffer >, std::unique_ptr< Buffer > > > extract ()
 Wait for completion and extract the reduced data. More...
 

Detailed Description

Asynchronous (coroutine) interface to coll::AllReduce.

A single extraction task must await extract() to obtain the result and ensure that the reduction completes.

Definition at line 25 of file allreduce.hpp.

Constructor & Destructor Documentation

◆ AllReduce()

rapidsmpf::streaming::AllReduce::AllReduce ( std::shared_ptr< Context ctx,
std::shared_ptr< Communicator comm,
std::unique_ptr< Buffer input,
std::unique_ptr< Buffer output,
OpID  op_id,
coll::ReduceOperator  reduce_operator 
)

Construct an asynchronous allreduce.

Parameters
ctxStreaming context
commThe communicator for communication.
inputLocal data to contribute to the reduction.
outputAllocated buffer in which to place reduction result. Must be the same size and memory type as input. Overwritten with the reduction result (values already in the buffer are ignored).
op_idUnique operation identifier for this allreduce.
reduce_operatorType-erased reduction operator to use. See ReduceOperator.

Member Function Documentation

◆ comm()

std::shared_ptr<Communicator> const& rapidsmpf::streaming::AllReduce::comm ( ) const
noexcept

Gets the communicator associated with this AllReduce.

Returns
Shared pointer to communicator.

◆ ctx()

std::shared_ptr<Context> const& rapidsmpf::streaming::AllReduce::ctx ( ) const
noexcept

Gets the streaming context associated with this AllReduce object.

Returns
Shared pointer to context.

◆ extract()

coro::task<std::pair<std::unique_ptr<Buffer>, std::unique_ptr<Buffer> > > rapidsmpf::streaming::AllReduce::extract ( )

Wait for completion and extract the reduced data.

Returns
Coroutine that completes when the result is available and returns a pair of the two Buffers passed to the constructor. The first Buffer contains an implementation-defined value, the second Buffer contains the final reduced result.

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