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

Context for nodes (coroutines) in rapidsmpf. More...

#include <context.hpp>

Public Member Functions

 Context (config::Options options, std::shared_ptr< Communicator > comm, std::shared_ptr< ProgressThread > progress_thread, std::unique_ptr< coro::thread_pool > executor, std::shared_ptr< BufferResource > br, std::shared_ptr< Statistics > statistics)
 Full constructor for the Context. More...
 
 Context (config::Options options, std::shared_ptr< Communicator > comm, std::shared_ptr< BufferResource > br, std::shared_ptr< Statistics > statistics=Statistics::disabled())
 Convenience constructor with minimal configuration. More...
 
config::Options get_options () const noexcept
 Returns the configuration options. More...
 
std::shared_ptr< Communicatorcomm () const noexcept
 Returns the communicator. More...
 
std::shared_ptr< ProgressThreadprogress_thread () const noexcept
 Returns the progress thread. More...
 
std::unique_ptr< coro::thread_pool > & executor () noexcept
 Returns the coroutine thread pool. More...
 
BufferResourcebr () const noexcept
 Returns the buffer resource. More...
 
std::shared_ptr< Statisticsstatistics () const noexcept
 Returns the statistics collector. More...
 
std::shared_ptr< Channelcreate_channel () const noexcept
 Create a new channel associated with this context. More...
 
std::shared_ptr< SpillableMessagesspillable_messages () const
 Returns the spillable messages collection. More...
 
std::shared_ptr< BoundedQueuecreate_bounded_queue (std::size_t buffer_size) const noexcept
 Create a new bounded queue associated with this context. More...
 

Detailed Description

Context for nodes (coroutines) in rapidsmpf.

Definition at line 25 of file context.hpp.

Constructor & Destructor Documentation

◆ Context() [1/2]

rapidsmpf::streaming::Context::Context ( config::Options  options,
std::shared_ptr< Communicator comm,
std::shared_ptr< ProgressThread progress_thread,
std::unique_ptr< coro::thread_pool >  executor,
std::shared_ptr< BufferResource br,
std::shared_ptr< Statistics statistics 
)

Full constructor for the Context.

All provided pointers must be non-null.

Parameters
optionsConfiguration options.
commShared pointer to a communicator.
progress_threadShared pointer to a progress thread.
executorUnique pointer to a coroutine thread pool.
brShared pointer to a buffer resource.
statisticsShared pointer to a statistics collector.

◆ Context() [2/2]

rapidsmpf::streaming::Context::Context ( config::Options  options,
std::shared_ptr< Communicator comm,
std::shared_ptr< BufferResource br,
std::shared_ptr< Statistics statistics = Statistics::disabled() 
)

Convenience constructor with minimal configuration.

Creates a default ProgressThread and coroutine thread pool.

Parameters
optionsConfiguration options.
commShared pointer to a communicator.
brBuffer resource used to reserve host memory and perform the move.
statisticsThe statistics instance to use (disabled by default).

Member Function Documentation

◆ br()

BufferResource* rapidsmpf::streaming::Context::br ( ) const
noexcept

Returns the buffer resource.

Returns
Raw pointer to the buffer resource.

◆ comm()

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

Returns the communicator.

Returns
Shared pointer to the communicator.

◆ create_bounded_queue()

std::shared_ptr<BoundedQueue> rapidsmpf::streaming::Context::create_bounded_queue ( std::size_t  buffer_size) const
noexcept

Create a new bounded queue associated with this context.

Parameters
buffer_sizeMaximum size of the queue.
Returns
A shared pointer to the newly created bounded queue.

◆ create_channel()

std::shared_ptr<Channel> rapidsmpf::streaming::Context::create_channel ( ) const
noexcept

Create a new channel associated with this context.

Returns
A shared pointer to the newly created channel.

◆ executor()

std::unique_ptr<coro::thread_pool>& rapidsmpf::streaming::Context::executor ( )
noexcept

Returns the coroutine thread pool.

Returns
Reference to unique pointer to the thread pool.

◆ get_options()

config::Options rapidsmpf::streaming::Context::get_options ( ) const
noexcept

Returns the configuration options.

Returns
The Options instance.

◆ progress_thread()

std::shared_ptr<ProgressThread> rapidsmpf::streaming::Context::progress_thread ( ) const
noexcept

Returns the progress thread.

Returns
Shared pointer to the progress thread.

◆ spillable_messages()

std::shared_ptr<SpillableMessages> rapidsmpf::streaming::Context::spillable_messages ( ) const
inline

Returns the spillable messages collection.

Returns
A shared pointer to the collection.

Definition at line 121 of file context.hpp.

◆ statistics()

std::shared_ptr<Statistics> rapidsmpf::streaming::Context::statistics ( ) const
noexcept

Returns the statistics collector.

Returns
Shared pointer to the statistics instance.

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