10 #include <unordered_map>
13 #include <rapidsmpf/buffer/buffer.hpp>
14 #include <rapidsmpf/buffer/resource.hpp>
15 #include <rapidsmpf/communicator/communicator.hpp>
16 #include <rapidsmpf/config.hpp>
39 ~
Future() noexcept
override =
default;
49 ~
Single() noexcept override = default;
54 [[nodiscard]] constexpr Rank
rank()
const override {
61 [[nodiscard]] constexpr Rank
nranks()
const override {
68 [[nodiscard]] std::unique_ptr<Communicator::Future>
send(
69 std::unique_ptr<std::vector<uint8_t>> msg, Rank
rank,
Tag tag
79 [[nodiscard]] std::unique_ptr<Communicator::Future>
send(
80 std::unique_ptr<Buffer> msg, Rank
rank,
Tag tag
89 [[nodiscard]] std::unique_ptr<Communicator::Future>
recv(
90 Rank
rank,
Tag tag, std::unique_ptr<Buffer> recv_buffer
102 Rank
rank,
Tag tag, std::unique_ptr<std::vector<uint8_t>> synced_buffer
111 [[nodiscard]] std::pair<std::unique_ptr<std::vector<uint8_t>>, Rank>
recv_any(
121 [[nodiscard]] std::unique_ptr<std::vector<uint8_t>>
recv_from(
132 std::vector<std::unique_ptr<Communicator::Future>>,
133 std::vector<std::size_t>>
134 test_some(std::vector<std::unique_ptr<Communicator::Future>>& future_vector)
override;
144 std::unordered_map<std::size_t, std::unique_ptr<Communicator::Future>>
const&
154 [[nodiscard]] std::unique_ptr<Buffer>
wait(
155 std::unique_ptr<Communicator::Future> future
165 std::unique_ptr<Communicator::Future> future
175 std::unique_ptr<Communicator::Future> future
188 [[nodiscard]] std::string
str()
const override;
Abstract base class for asynchronous operation within the communicator.
A logger base class for handling different levels of log messages.
Abstract base class for a communication mechanism between nodes.
Represents the future result of an operation.
Single process communicator class that implements the Communicator interface.
std::string str() const override
Provides a string representation of the communicator.
Single(config::Options options)
Construct a single process communicator.
constexpr Rank rank() const override
Retrieves the rank of the current node.
std::unique_ptr< Communicator::Future > recv(Rank rank, Tag tag, std::unique_ptr< Buffer > recv_buffer) override
Receives a message from a specific rank to a buffer. Use release_data to extract the data out of the ...
std::unique_ptr< std::vector< uint8_t > > release_sync_host_data(std::unique_ptr< Communicator::Future > future) override
Retrieves synchronized host data associated with a completed future. When the future is completed,...
constexpr Rank nranks() const override
Retrieves the total number of ranks.
std::pair< std::vector< std::unique_ptr< Communicator::Future > >, std::vector< std::size_t > > test_some(std::vector< std::unique_ptr< Communicator::Future >> &future_vector) override
Tests for completion of multiple futures.
std::unique_ptr< Communicator::Future > recv_sync_host_data(Rank rank, Tag tag, std::unique_ptr< std::vector< uint8_t >> synced_buffer) override
Receives a message from a specific rank to an allocated (synchronized) host buffer....
std::unique_ptr< Buffer > wait(std::unique_ptr< Communicator::Future > future) override
Wait for a future to complete and return the data buffer.
std::vector< std::size_t > test_some(std::unordered_map< std::size_t, std::unique_ptr< Communicator::Future >> const &future_map) override
Tests for completion of multiple futures in a map.
std::unique_ptr< Buffer > release_data(std::unique_ptr< Communicator::Future > future) override
Retrieves data associated with a completed future.
std::unique_ptr< Communicator::Future > send(std::unique_ptr< Buffer > msg, Rank rank, Tag tag) override
Sends a message (device or host) to a specific rank.
std::unique_ptr< Communicator::Future > send(std::unique_ptr< std::vector< uint8_t >> msg, Rank rank, Tag tag) override
Sends a host message to a specific rank.
std::pair< std::unique_ptr< std::vector< uint8_t > >, Rank > recv_any(Tag tag) override
Receives a message from any rank (blocking).
Logger & logger() override
Retrieves the logger associated with this communicator.
std::unique_ptr< std::vector< uint8_t > > recv_from(Rank src, Tag tag) override
Receives a message from a specific rank (blocking).
A tag used for identifying messages in a communication operation.
Manages configuration options for RapidsMPF operations.