KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
|
NonBlockingResult contains the result of a non-blocking MPI
call wrapped by KaMPIng. It encapsulates a kamping::Request and stores the buffers associated with the non-blocking call. Upon completion the owning out-buffers among all associated buffers are returned wrappend in an MPIResult object.
More...
#include <result.hpp>
Public Member Functions | |
NonBlockingResult (std::unique_ptr< std::tuple< Buffers... > > buffers_on_heap, RequestDataBuffer request) | |
Constructor for NonBlockingResult . | |
NonBlockingResult (RequestDataBuffer request) | |
Constructor for NonBlockingResult . | |
auto | extract () |
Extracts the components of this results, leaving the user responsible. | |
template<typename StatusParamObjectType = decltype(status(ignore<>)), typename NonBlockingResulType_ = NonBlockingResult<CallerProvidedArgs, RequestDataBuffer, Buffers...>, typename std::enable_if< NonBlockingResulType_::owns_request, bool >::type = true> | |
auto | wait (StatusParamObjectType status=kamping::status(ignore<>)) |
Waits for the underlying Request to complete by calling Request::wait() and upon completion returns: | |
template<typename StatusParamObjectType = decltype(status(ignore<>)), typename NonBlockingResulType_ = NonBlockingResult<CallerProvidedArgs, RequestDataBuffer, Buffers...>, typename std::enable_if< NonBlockingResulType_::owns_request, bool >::type = true> | |
auto | test (StatusParamObjectType status=kamping::status(ignore<>)) |
Tests the underlying Request for completion by calling Request::test() and returns a value convertible to bool indicating if the request is complete. | |
MPI_Request * | get_request_ptr () |
Returns a pointer to the underlying request. | |
Static Public Attributes | |
static constexpr bool | owns_request = internal::has_extract_v<RequestDataBuffer> |
true if the result object owns the underlying kamping::Request. | |
NonBlockingResult contains the result of a non-blocking MPI
call wrapped by KaMPIng. It encapsulates a kamping::Request and stores the buffers associated with the non-blocking call. Upon completion the owning out-buffers among all associated buffers are returned wrappend in an MPIResult object.
CallerProvidedArgs | Types of arguments passed to the wrapped MPI call. |
RequestDataBuffer | Container encapsulating the underlying request. |
Buffers | Types of buffers associated with the underlying non-blocking MPI call. |
|
inline |
Constructor for NonBlockingResult
.
buffers_on_heap | Buffers stored on the heap which are required by the non-blocking mpi operation associated with the given request upon completition. |
request | A kamping::internal::DataBuffer containing the associated kamping::Request. |
|
inline |
Constructor for NonBlockingResult
.
request | A kamping::internal::DataBuffer containing the associated kamping::Request. |
|
inline |
Extracts the components of this results, leaving the user responsible.
If this result owns the underlying request:
std::pair
containing the Request and MPIResult if the result object contains owning out buffers.If the request is owned by the user
Note that the result may be in an undefined state because the associated operations is still underway and it is the user's responsibilty to ensure that the corresponding request has been completed before accessing the result.
|
inline |
Tests the underlying Request for completion by calling Request::test() and returns a value convertible to bool
indicating if the request is complete.
The type of the return value depends on the encapsulated result and the status
parameter and follows the same semantics as wait(), but its return value is wrapped in an std::optional
. The optional only contains a value if the request is complete, i.e. test()
succeeded.
If both the result is empty and no status returned, returns a bool
indicating completion instead of an std::optional
.
This method is only available if this result owns the underlying request. If this is not the case, the user must manually test the request that they own and manually obtain the result via extract().
status | A parameter created by kamping::status() or kamping::status_out(). Defaults to kamping::status(ignore<>) . |
|
inline |
Waits for the underlying Request to complete by calling Request::wait() and upon completion returns:
If status
is an out-parameter:
std::pair
containing an MPIResult and the status.If is
kamping::status(ignore<>)
, or not an out-paramter:
This method is only available if this result owns the underlying request. If this is not the case, the user must manually wait on the request that they own and manually obtain the result via extract().
status | A parameter created by kamping::status() or kamping::status_out(). Defaults to kamping::status(ignore<>) . |