KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
|
NonBlockingResult contains the result of a non-blocking MPI
call wrapped by KaMPIng. It encapsulates a kamping::MPIResult and a kamping::Request.
More...
#include <result.hpp>
Public Member Functions | |
NonBlockingResult (std::unique_ptr< MPIResultType > result, 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<MPIResultType, RequestDataBuffer>, 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<MPIResultType, RequestDataBuffer>, 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. | |
MPIResultType & | get_result () |
Provides access to the underlying result object. | |
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::MPIResult and a kamping::Request.
MPIResultType | The underlying result type. |
RequestDataBuffer | Container encapsulating the underlying request. |
|
inline |
Constructor for NonBlockingResult
.
result | The underlying kamping::MPIResult. |
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<>) . |