25#include "kamping/named_parameter_filtering.hpp"
28#include "kamping/named_parameters_detail/status_parameters.hpp"
47template <
typename Buffer>
48inline constexpr bool is_extractable = Buffer::is_owning&& Buffer::is_out_buffer;
66template <
typename...
Args>
70 static constexpr bool is_empty = (
sizeof...(Args) == 0);
78 "We cannot have a recv and a send_recv buffer contained in the result object."
94 typename T = std::tuple<
Args...>,
95 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::status, T>(),
bool> =
true>
97 return internal::select_parameter_type_in_tuple<internal::ParameterType::status>(_data).underlying();
108 typename T = std::tuple<
Args...>,
109 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::status, T>(),
bool> =
true>
111 return internal::select_parameter_type_in_tuple<internal::ParameterType::status>(_data).underlying();
122 typename T = std::tuple<
Args...>,
123 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::status, T>(),
bool> =
true>
125 return internal::select_parameter_type_in_tuple<internal::ParameterType::status>(_data).extract();
136 typename T = std::tuple<
Args...>,
137 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
139 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_buf>(_data).underlying();
150 typename T = std::tuple<
Args...>,
151 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
164 typename T = std::tuple<
Args...>,
165 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
167 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_buf>(_data).underlying();
178 typename T = std::tuple<
Args...>,
179 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
192 typename T = std::tuple<
Args...>,
193 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_buf, T>(),
bool> =
true>
195 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_buf>(_data).underlying();
206 typename T = std::tuple<
Args...>,
207 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_buf, T>(),
bool> =
true>
220 typename T = std::tuple<
Args...>,
221 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_buf, T>(),
bool> =
true>
223 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_buf>(_data).extract();
234 typename T = std::tuple<
Args...>,
235 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
237 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_buf>(_data).extract();
248 typename T = std::tuple<
Args...>,
249 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_buf, T>(),
bool> =
true>
262 typename T = std::tuple<
Args...>,
263 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
266 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_buf>(_data).underlying();
278 typename T = std::tuple<
Args...>,
279 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
293 typename T = std::tuple<
Args...>,
294 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
297 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_buf>(_data).underlying();
309 typename T = std::tuple<
Args...>,
310 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
324 typename T = std::tuple<
Args...>,
325 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
328 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_buf>(_data).extract();
340 typename T = std::tuple<
Args...>,
341 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_buf, T>(),
bool> =
354 typename T = std::tuple<
Args...>,
355 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_counts, T>(),
bool> =
true>
357 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_counts>(_data).underlying();
367 typename T = std::tuple<
Args...>,
368 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_counts, T>(),
bool> =
true>
370 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_counts>(_data).underlying();
380 typename T = std::tuple<
Args...>,
381 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_counts, T>(),
bool> =
true>
383 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_counts>(_data).extract();
393 typename T = std::tuple<
Args...>,
394 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_count, T>(),
bool> =
true>
396 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_count>(_data).underlying();
406 typename T = std::tuple<
Args...>,
407 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_count, T>(),
bool> =
true>
409 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_count>(_data).underlying();
419 typename T = std::tuple<
Args...>,
420 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_count, T>(),
bool> =
true>
422 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_count>(_data).extract();
432 typename T = std::tuple<
Args...>,
433 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_displs, T>(),
bool> =
true>
435 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_displs>(_data).underlying();
445 typename T = std::tuple<
Args...>,
446 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_displs, T>(),
bool> =
true>
448 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_displs>(_data).underlying();
458 typename T = std::tuple<
Args...>,
459 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_displs, T>(),
bool> =
true>
461 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_displs>(_data).extract();
471 typename T = std::tuple<
Args...>,
472 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_counts, T>(),
bool> =
true>
474 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_counts>(_data).underlying();
484 typename T = std::tuple<
Args...>,
485 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_counts, T>(),
bool> =
true>
487 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_counts>(_data).underlying();
497 typename T = std::tuple<
Args...>,
498 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_counts, T>(),
bool> =
true>
500 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_counts>(_data).extract();
510 typename T = std::tuple<
Args...>,
511 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_count, T>(),
bool> =
true>
513 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_count>(_data).underlying();
523 typename T = std::tuple<
Args...>,
524 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_count, T>(),
bool> =
true>
526 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_count>(_data).underlying();
536 typename T = std::tuple<
Args...>,
537 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_count, T>(),
bool> =
true>
539 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_count>(_data).extract();
549 typename T = std::tuple<
Args...>,
550 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_displs, T>(),
bool> =
true>
552 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_displs>(_data).underlying();
562 typename T = std::tuple<
Args...>,
563 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_displs, T>(),
bool> =
true>
565 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_displs>(_data).underlying();
575 typename T = std::tuple<
Args...>,
576 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_displs, T>(),
bool> =
true>
578 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_displs>(_data).extract();
588 typename T = std::tuple<
Args...>,
589 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_count, T>(),
bool> =
592 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_count>(_data).underlying();
602 typename T = std::tuple<
Args...>,
603 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_count, T>(),
bool> =
606 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_count>(_data).underlying();
616 typename T = std::tuple<
Args...>,
617 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_count, T>(),
bool> =
620 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_count>(_data).extract();
630 typename T = std::tuple<
Args...>,
631 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_type, T>(),
bool> =
true>
633 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_type>(_data).underlying();
643 typename T = std::tuple<
Args...>,
644 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_type, T>(),
bool> =
true>
646 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_type>(_data).underlying();
656 typename T = std::tuple<
Args...>,
657 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_type, T>(),
bool> =
true>
659 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_type>(_data).extract();
669 typename T = std::tuple<
Args...>,
670 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_type, T>(),
bool> =
true>
672 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_type>(_data).underlying();
682 typename T = std::tuple<
Args...>,
683 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_type, T>(),
bool> =
true>
685 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_type>(_data).underlying();
695 typename T = std::tuple<
Args...>,
696 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::recv_type, T>(),
bool> =
true>
698 return internal::select_parameter_type_in_tuple<internal::ParameterType::recv_type>(_data).extract();
708 typename T = std::tuple<
Args...>,
709 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_type, T>(),
bool> =
712 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_type>(_data).underlying();
722 typename T = std::tuple<
Args...>,
723 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_type, T>(),
bool> =
726 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_type>(_data).underlying();
736 typename T = std::tuple<
Args...>,
737 std::enable_if_t<internal::has_parameter_type_in_tuple<internal::ParameterType::send_recv_type, T>(),
bool> =
740 return internal::select_parameter_type_in_tuple<internal::ParameterType::send_recv_type>(_data).extract();
752 typename T = std::tuple<
Args...>,
753 std::enable_if_t<internal::has_parameter_type_in_tuple<ptype, T>(),
bool> =
true>
755 return internal::select_parameter_type_in_tuple<ptype>(_data).underlying();
767 typename T = std::tuple<
Args...>,
768 std::enable_if_t<internal::has_parameter_type_in_tuple<ptype, T>(),
bool> =
true>
770 return internal::select_parameter_type_in_tuple<ptype>(_data).underlying();
778 template <std::
size_t i>
780 return std::get<i>(_data).underlying();
788 template <std::
size_t i>
790 return std::get<i>(_data).underlying();
794 std::tuple<
Args...> _data;
802template <
typename...
Args>
811template <
typename...
Args>
826template <
typename... Args>
827struct tuple_size<kamping::MPIResult<Args...>> {
828 static constexpr size_t value =
sizeof...(Args);
836template <
size_t index,
typename... Args>
837struct tuple_element<index, kamping::MPIResult<Args...>> {
851template <
typename CallerProv
idedOwningOutBuffers>
873 constexpr bool has_send_recv_buffer =
875 static_assert(has_recv_buffer ^ has_send_recv_buffer,
"either a recv or a send_recv buffer must be present");
876 if constexpr (has_recv_buffer) {
904 template <
typename BufferType>
907 if constexpr (parameter_types_to_ignore_for_result_object::contains<ptype_entry>) {
910 return !BufferType::is_owning
911 || !BufferType::is_out_buffer;
917template <
typename,
typename =
void>
936 template <
typename BufferType>
938 if (PredicateForResultObject::discard<BufferType>()) {
962 constexpr bool has_send_recv_buffer =
964 return has_recv_buffer || has_send_recv_buffer;
982template <ParameterType ptype,
typename Tuple>
1025 std::tuple_size_v<CallerProvidedOwningOutParametersWithoutSerializationBuffers>;
1027 auto&
send_buffer = internal::select_parameter_type<ParameterType::send_buf>(
buffers...);
1079 std::tuple<Buffers...>&
buffers, std::index_sequence<i...>
1093 constexpr std::size_t
num_buffers =
sizeof...(Buffers);
1094 return impl::make_mpi_result_from_tuple<CallerProvidedArgs>(
buffers, std::make_index_sequence<num_buffers>{});
1107template <
typename CallerProvidedArgs,
typename RequestDataBuffer,
typename... Buffers>
1123 static constexpr bool owns_request = internal::has_extract_v<RequestDataBuffer>;
1142 return _request.extract();
1147 return std::pair(_request.extract(), std::move(
result));
1153 return extract_result();
1178 typename std::enable_if<NonBlockingResulType_::owns_request, bool>::type =
true>
1182 "Only status parameters are allowed."
1184 kassert_not_extracted(
"The result of this request has already been extracted.");
1185 constexpr bool return_status = internal::is_extractable<StatusParamObjectType>;
1186 using result_type = std::remove_reference_t<
decltype(extract_result())>;
1190 return std::make_pair(extract_result(), std::move(
status_return));
1192 _request.underlying().wait(std::move(
status));
1193 return extract_result();
1196 return _request.underlying().wait(std::move(
status));
1218 typename std::enable_if<NonBlockingResulType_::owns_request, bool>::type =
true>
1222 "Only status parameters are allowed."
1224 kassert_not_extracted(
"The result of this request has already been extracted.");
1225 constexpr bool return_status = internal::is_extractable<StatusParamObjectType>;
1226 using result_type = std::remove_reference_t<
decltype(extract_result())>;
1231 return std::optional{std::pair{extract_result(), std::move(*
status_return)}};
1236 if (_request.underlying().test(std::move(
status))) {
1237 return std::optional{extract_result()};
1239 return std::optional<result_type>{};
1243 return _request.underlying().test(std::move(
status));
1249 return _request.underlying().request_ptr();
1254 auto extract_result() {
1255 kassert_not_extracted(
"The result of this request has already been extracted.");
1257 return internal::make_mpi_result_from_tuple<CallerProvidedArgs>(*_buffers_on_heap.get());
1260 void set_extracted() {
1261#if KASSERT_ENABLED(KAMPING_ASSERTION_LEVEL_NORMAL)
1262 is_extracted =
true;
1269 void kassert_not_extracted(std::string
const message [[maybe_unused]])
const {
1270#if KASSERT_ENABLED(KAMPING_ASSERTION_LEVEL_NORMAL)
1274 std::unique_ptr<std::tuple<Buffers...>> _buffers_on_heap;
1275 RequestDataBuffer _request;
1276#if KASSERT_ENABLED(KAMPING_ASSERTION_LEVEL_NORMAL)
1277 bool is_extracted =
false;
1288template <
typename... Buffers>
1290 using BufferTuple = std::tuple<std::remove_reference_t<Buffers>...>;
1291 return std::make_unique<BufferTuple>(std::move(
buffers)...);
1325template <
typename RequestDataBuffer>
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
MPIResult contains the result of a MPI call wrapped by KaMPIng.
Definition result.hpp:67
auto const & get_recv_count() const
Gets the recv_count from the MPIResult object.
Definition result.hpp:408
auto extract_recv_buffer()
Extracts the recv_buffer from the MPIResult object. Alias for extract_recv_buf().
Definition result.hpp:250
auto & get_send_type()
Gets the send_type from the MPIResult object.
Definition result.hpp:632
auto const & get_recv_type() const
Gets the recv_type from the MPIResult object.
Definition result.hpp:684
auto & get_send_recv_type()
Gets the send_recv_type from the MPIResult object.
Definition result.hpp:711
auto & get_status()
Get the kamping::Status from the MPIResult object.
Definition result.hpp:96
auto & get_recv_buffer()
Get the recv_buffer from the MPIResult object. Alias for get_recv_buf().
Definition result.hpp:152
auto const & get_recv_displs() const
Gets the recv_displs from the MPIResult object.
Definition result.hpp:447
auto extract_send_counts()
Extracts the send_counts from the MPIResult object.
Definition result.hpp:499
auto const & get_status() const
Get the kamping::Status from the MPIResult object.
Definition result.hpp:110
auto extract_recv_counts()
Extracts the recv_counts from the MPIResult object.
Definition result.hpp:382
auto extract_recv_count()
Extracts the recv_count from the MPIResult object.
Definition result.hpp:421
auto const & get_send_type() const
Gets the send_type from the MPIResult object.
Definition result.hpp:645
auto extract_send_count()
Extracts the send_count from the MPIResult object.
Definition result.hpp:538
auto & get_send_count()
Gets the send_count from the MPIResult object.
Definition result.hpp:512
auto & get_recv_counts()
Get the recv_counts from the MPIResult object.
Definition result.hpp:356
auto extract_recv_displs()
Extracts the recv_displs from the MPIResult object.
Definition result.hpp:460
auto const & get_send_counts() const
Gets the send_counts from the MPIResult object.
Definition result.hpp:486
auto & get_recv_displs()
Gets the recv_displs from the MPIResult object.
Definition result.hpp:434
auto & get()
Gets the parameter with given parameter type from the MPIResult object.
Definition result.hpp:754
auto & get_send_displs()
Gets the send_displs from the MPIResult object.
Definition result.hpp:551
auto const & get() const
Get the underlying data from the i-th buffer in the result object. This method is part of the structu...
Definition result.hpp:789
auto & get_recv_count()
Gets the recv_count from the MPIResult object.
Definition result.hpp:395
auto const & get_recv_buffer() const
Get the recv_buffer from the MPIResult object. Alias for get_recv_buf().
Definition result.hpp:180
static constexpr bool has_send_recv_buffer
true, if the result encapsulates a send_recv_buf.
Definition result.hpp:74
auto const & get_send_buf() const
Get the send_buffer from the MPIResult object.
Definition result.hpp:194
auto const & get_recv_buf() const
Get the recv_buffer from the MPIResult object.
Definition result.hpp:166
auto extract_send_recv_type()
Extracts the send_recv_type from the MPIResult object.
Definition result.hpp:739
auto extract_recv_buf()
Extracts the recv_buffer from the MPIResult object.
Definition result.hpp:236
auto extract_send_recv_count()
Extracts the send_recv_count from the MPIResult object.
Definition result.hpp:619
auto const & get_send_recv_count() const
Gets the send_recv_count from the MPIResult object.
Definition result.hpp:605
auto extract_recv_type()
Extracts the recv_type from the MPIResult object.
Definition result.hpp:697
auto & get_send_counts()
Gets the send_counts from the MPIResult object.
Definition result.hpp:473
auto const & get_send_buffer() const
Get the send_buffer from the MPIResult object. Alias for get_send_buf().
Definition result.hpp:208
auto & get_recv_type()
Gets the recv_type from the MPIResult object.
Definition result.hpp:671
auto extract_send_type()
Extracts the send_type from the MPIResult object.
Definition result.hpp:658
auto extract_send_displs()
Extracts the send_displs from the MPIResult object.
Definition result.hpp:577
auto const & get_recv_counts() const
Get the recv_counts from the MPIResult object.
Definition result.hpp:369
auto const & get() const
Gets the parameter with given parameter type from the MPIResult object.
Definition result.hpp:769
auto extract_status()
Extracts the kamping::Status from the MPIResult object.
Definition result.hpp:124
auto & get_send_recv_count()
Gets the send_recv_count from the MPIResult object.
Definition result.hpp:591
auto const & get_send_displs() const
Gets the send_displs from the MPIResult object.
Definition result.hpp:564
auto & get_recv_buf()
Get the recv_buffer from the MPIResult object.
Definition result.hpp:138
static constexpr bool is_empty
true, if the result does not encapsulate any data.
Definition result.hpp:70
auto & get()
Get the underlying data from the i-th buffer in the result object. This method is part of the structu...
Definition result.hpp:779
auto const & get_send_recv_type() const
Gets the send_recv_type from the MPIResult object.
Definition result.hpp:725
auto const & get_send_count() const
Gets the send_count from the MPIResult object.
Definition result.hpp:525
MPIResult(std::tuple< Args... > &&data)
Constructor for MPIResult.
Definition result.hpp:84
auto extract_send_buf()
Extracts the send_buffer from the MPIResult object.
Definition result.hpp:222
static constexpr bool has_recv_buffer
true, if the result encapsulates a recv_buf.
Definition result.hpp:72
NonBlockingResult contains the result of a non-blocking MPI call wrapped by KaMPIng....
Definition result.hpp:1108
auto test(StatusParamObjectType status=kamping::status(ignore<>))
Tests the underlying Request for completion by calling Request::test() and returns a value convertibl...
Definition result.hpp:1219
static constexpr bool owns_request
true if the result object owns the underlying kamping::Request.
Definition result.hpp:1123
NonBlockingResult(std::unique_ptr< std::tuple< Buffers... > > buffers_on_heap, RequestDataBuffer request)
Constructor for NonBlockingResult.
Definition result.hpp:1114
auto wait(StatusParamObjectType status=kamping::status(ignore<>))
Waits for the underlying Request to complete by calling Request::wait() and upon completion returns:
Definition result.hpp:1179
MPI_Request * get_request_ptr()
Returns a pointer to the underlying request.
Definition result.hpp:1248
NonBlockingResult(RequestDataBuffer request)
Constructor for NonBlockingResult.
Definition result.hpp:1120
auto extract()
Extracts the components of this results, leaving the user responsible.
Definition result.hpp:1139
constexpr int normal
Default assertion level. This level is used if no assertion level is specified.
Definition assertion_levels.hpp:19
auto status(internal::ignore_t< void >)
pass MPI_STATUS_IGNORE to the underlying MPI call.
Definition status_parameters.hpp:52
auto request()
Internally allocate a request object and return it to the user.
Definition named_parameters.hpp:1122
ParameterType
Each input parameter to one of the MPI calls wrapped by KaMPIng needs to has one of the following tag...
Definition named_parameter_types.hpp:33
constexpr bool has_parameter_type()
Checks if parameter with requested parameter type exists.
Definition named_parameter_selection.hpp:186
@ status
Tag used to represent the status in a MPI call.
Macros for generating concept-like type traits to check for member functions of objects.
#define KAMPING_MAKE_HAS_MEMBER(Member)
Macro for generating has_member_xxx and has_member_xxx_v templates. They return true if the type give...
Definition has_member.hpp:91
Template magic to check named parameters passed to wrappers at compile time.
Template magic to implement named parameters in cpp.
File containing the parameter types used by the KaMPIng library.
Internal namespace marking the code that is not user-facing.
Definition collectives_helpers.hpp:20
constexpr bool is_extractable
Helper for implementing the extract_* functions in MPIResult. Is true if the passed buffer type owns ...
Definition result.hpp:48
constexpr bool return_recv_or_send_recv_buffer_only()
Determines whether only the recv (send_recv) buffer or multiple different buffers will be returned.
Definition result.hpp:852
constexpr bool return_send_buf_out_only()
Determines whether only the send buffer should be returned. This may happen if ownership of the send ...
Definition result.hpp:970
constexpr bool has_extract_v
has_extract_v is true iff type T has a member function extract().
Definition result.hpp:40
auto move_buffer_to_heap(Buffers &&... buffers)
Moves given buffers into a std::tuple wrapped with an std::unique_ptr on the heap.
Definition result.hpp:1289
constexpr bool has_data_buffer_type_member
Helper to check if a type T has a member type T::DataBufferType.
Definition result.hpp:918
auto make_mpi_result(Buffers &&... buffers)
Construct result object for a wrapped MPI call. Four different cases are handled: a) The recv_buffer ...
Definition result.hpp:1017
constexpr bool has_recv_or_send_recv_buf()
Returns True iff only a recv or send_recv buffer is present. Communicator::ibarrier()).
Definition result.hpp:960
constexpr ParameterType determine_recv_buffer_type()
Checks whether a buffer with parameter type recv_buf or a buffer with type send_recv_buf is present a...
Definition result.hpp:871
auto make_mpi_result_from_tuple(std::tuple< Buffers... > &buffers)
Wrapper function to enable the construction of an MPIResult object also if the buffers are stored ins...
Definition result.hpp:1092
auto make_nonblocking_result(RequestDataBuffer &&request, std::unique_ptr< std::tuple< Buffers... > > buffers_on_heap)
Factory for creating a kamping::NonBlockingResult.
Definition result.hpp:1308
auto make_mpi_result_from_tuple(std::tuple< Buffers... > &buffers, std::index_sequence< i... >)
Implementation helper function to enable the construction of an MPIResult object also if the buffers ...
Definition result.hpp:1078
constexpr bool is_mpi_result_v
Trait for checking whether a type is an MPIResult.
Definition result.hpp:799
constexpr bool is_result_empty_v
Primary template for result trait indicates whether the result object is empty.
Definition result.hpp:807
Predicate to check whether a buffer provided to make_mpi_result() shall be discard or returned in the...
Definition result.hpp:926
static constexpr bool discard()
Discard function to check whether a buffer provided to make_mpi_result() shall be discard or returned...
Definition result.hpp:937
Base template used to filter a list of types and only keep those whose types meet specified criteria....
Definition named_parameter_filtering.hpp:46
Predicate to check whether a buffer provided to make_mpi_result() shall be discard or returned in the...
Definition result.hpp:897
static constexpr bool discard()
Discard function to check whether a buffer provided to make_mpi_result() shall be discard or returned...
Definition result.hpp:905
Template class to prepend the ParameterTypeEntry<ParameterType::ptype> type to a given std::tuple.
Definition result.hpp:983
typename PrependType< std::integral_constant< internal::ParameterType, ptype >, Tuple >:: type type
Concatenated tuple, i.e. type = std::tuple<TypeToPrepend, (Type contained in Tuple)....
Definition result.hpp:984
Use this type if one of the template parameters of MPIResult is not used for a specific wrapped MPI c...
Definition result.hpp:43
Helper type for representing a type list.
Definition parameter_objects.hpp:326
std::remove_reference_t< decltype(declval< kamping::MPIResult< Args... > >().template get< index >())> type
Type of the underlying data of the i-th data buffer in the result object.
Definition result.hpp:838