KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
|
A pool for storing multiple Request s and checking them for completion. More...
#include <request_pool.hpp>
Public Types | |
using | index_type = size_t |
The type used to index requests in the pool. | |
template<typename... Args> | |
using | default_container_type = DefaultContainerType<Args...> |
Type of the default container type to use for containers created inside operations of this request pool. | |
Public Member Functions | |
RequestPool () | |
Constructs a new empty RequestPool. | |
index_type | index_begin () const |
The first index value. The pool is empty if index_begin() == index_end() . | |
index_type | index_end () const |
The index value after the last one. The pool is empty if index_begin() == index_end() . | |
size_t | num_requests () const |
Returns the number of requests currently stored in the pool. | |
MPI_Request * | request_ptr () |
Returns a pointer to the underlying MPI_Request array. | |
PooledRequest< index_type > | get_request () |
Adds a new request to the pool and returns a PooledRequest encapsulating it. | |
template<typename StatusesParamObjectType = decltype(kamping::statuses(ignore<>))> | |
auto | wait_all (StatusesParamObjectType statuses_param=kamping::statuses(ignore<>)) |
Waits for all requests in the pool to complete by calling MPI_Waitall . | |
template<typename StatusesParamObjectType = decltype(kamping::statuses(ignore<>))> | |
auto | test_all (StatusesParamObjectType statuses_param=kamping::statuses(ignore<>)) |
Tests whether all requests in the pool have completed by calling MPI_Testall . | |
template<typename StatusParamObjectType = decltype(status(ignore<>))> | |
auto | wait_any (StatusParamObjectType status_param=kamping::status(ignore<>)) |
Waits any request in the pool to complete by calling MPI_Waitany . | |
template<typename StatusParamObjectType = decltype(status(ignore<>))> | |
auto | test_any (StatusParamObjectType status_param=kamping::status(ignore<>)) |
Tests if any request in the pool is completed by calling MPI_Testany . | |
A pool for storing multiple Request s and checking them for completion.
Requests are internally stored in a vector. The vector is resized as needed. New requests can be obtained by calling get_request.
DefaultContainerType | The default container type to use for containers created inside pool operations. Defaults to std::vector. |
using kamping::RequestPool< DefaultContainerType >::default_container_type = DefaultContainerType<Args...> |
Type of the default container type to use for containers created inside operations of this request pool.
Args | Arguments to the container type. |
|
inline |
Tests whether all requests in the pool have completed by calling MPI_Testall
.
statuses_param | A statuses parameter object to which the status information is written. Defaults to kamping::statuses(ignore<>) . |
bool
indicated completion, but if statuses
is an owning out parameter, returns a std::optional
containing the status information. resize_policy
, even if not all requests have completed yet. This is because MPI does not allow retrieving statuses after a test succeeded.
|
inline |
Tests if any request in the pool is completed by calling MPI_Testany
.
status_param | A status parameter object to which the status information about the completed operation is written. Defaults to kamping::status(ignore<>) . |
std::optional
containing information about the completed request. Otherwise, std::nullopt
. The value contained inside the optional depends on status
parameter and follows the same rules as for wait_any.
|
inline |
Waits for all requests in the pool to complete by calling MPI_Waitall
.
statuses_param | A statuses parameter object to which the status information is written. Defaults to kamping::statuses(ignore<>) . |
statuses
is an owning out parameter, returns the status information, otherwise returns nothing.
|
inline |
Waits any request in the pool to complete by calling MPI_Waitany
.
status_param | A status parameter object to which the status information about the completed operation is written. Defaults to kamping::status(ignore<>) . |
index_end()
. If status
is an owning out parameter, also returns the status alongside the index by returning a PoolAnyResult.