19#include <initializer_list>
26#include "kamping/named_parameters_detail/status_parameters.hpp"
29#include "kamping/request.hpp"
30#include "kamping/serialization.hpp"
52template <
typename Data>
55 make_empty_data_buffer_builder<Data, internal::ParameterType::send_buf, internal::BufferType::ignore>();
67template <
typename Data,
typename Enable = std::enable_if_t<!
internal::is_serialization_buffer_v<Data>>>
71 internal::BufferModifiability::constant,
72 internal::BufferType::in_buffer,
81 std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>,
bool> =
true>
85 internal::BufferModifiability::modifiable,
86 internal::BufferType::in_buffer,
100 internal::BufferModifiability::constant,
101 internal::BufferType::in_buffer,
116template <
typename Data,
typename Enable = std::enable_if_t<std::is_rvalue_reference_v<Data&&>>>
120 internal::BufferModifiability::constant,
121 internal::BufferType::in_out_buffer,
138 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Data>>>
141 ? internal::BufferModifiability::constant
142 : internal::BufferModifiability::modifiable;
146 internal::BufferType::in_out_buffer,
147 resize_policy>(std::forward<Data>(data));
155 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
158 std::is_const_v<std::remove_reference_t<SerializationBufferType>> ? internal::BufferModifiability::constant
159 : internal::BufferModifiability::modifiable;
163 internal::BufferType::in_out_buffer,
171template <
typename Container>
175 internal::BufferModifiability::modifiable,
176 internal::BufferType::in_out_buffer,
186template <
typename ValueType>
190 internal::BufferModifiability::modifiable,
191 internal::BufferType::in_out_buffer,
204template <
typename Container>
208 internal::BufferModifiability::constant,
209 internal::BufferType::in_buffer,
211 int>(std::forward<Container>(
container));
224 internal::BufferModifiability::constant,
225 internal::BufferType::in_buffer,
246template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
250 internal::BufferModifiability::modifiable,
251 internal::BufferType::out_buffer,
253 int>(std::forward<Container>(
container));
269template <
typename Container>
273 internal::BufferModifiability::modifiable,
274 internal::BufferType::out_buffer,
293template <
template <
typename...>
typename Container>
297 internal::BufferModifiability::modifiable,
298 internal::BufferType::out_buffer,
314 internal::BufferModifiability::modifiable,
315 internal::BufferType::out_buffer,
326 internal::BufferModifiability::constant,
327 internal::BufferType::in_buffer,
329 int>(std::move(count));
339 internal::BufferModifiability::modifiable,
340 internal::BufferType::out_buffer,
352 internal::BufferModifiability::modifiable,
353 internal::BufferType::out_buffer,
367template <
typename Container>
371 internal::BufferModifiability::constant,
372 internal::BufferType::in_buffer,
374 int>(std::forward<Container>(
container));
387 internal::BufferModifiability::constant,
388 internal::BufferType::in_buffer,
396 make_empty_data_buffer_builder<int, internal::ParameterType::recv_counts, internal::BufferType::ignore>();
415template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
419 internal::BufferModifiability::modifiable,
420 internal::BufferType::out_buffer,
422 int>(std::forward<Container>(
container));
438template <
typename Data>
442 internal::BufferModifiability::modifiable,
443 internal::BufferType::out_buffer,
462template <
template <
typename...>
typename Data>
466 internal::BufferModifiability::modifiable,
467 internal::BufferType::out_buffer,
483 internal::BufferModifiability::modifiable,
484 internal::BufferType::out_buffer,
495 internal::BufferModifiability::constant,
496 internal::BufferType::in_buffer,
498 int>(std::move(count));
508 internal::BufferModifiability::modifiable,
509 internal::BufferType::out_buffer,
521 internal::BufferModifiability::modifiable,
522 internal::BufferType::out_buffer,
534 internal::BufferModifiability::constant,
535 internal::BufferType::in_buffer,
537 int>(std::move(count));
547 internal::BufferModifiability::modifiable,
548 internal::BufferType::out_buffer,
560 internal::BufferModifiability::modifiable,
561 internal::BufferType::out_buffer,
575template <
typename Container>
579 internal::BufferModifiability::constant,
580 internal::BufferType::in_buffer,
582 int>(std::forward<Container>(
container));
595 internal::BufferModifiability::constant,
596 internal::BufferType::in_buffer,
617template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
621 internal::BufferModifiability::modifiable,
622 internal::BufferType::out_buffer,
624 int>(std::forward<Container>(
container));
639template <
typename Container>
643 internal::BufferModifiability::modifiable,
644 internal::BufferType::out_buffer,
663template <
template <
typename...>
typename Container>
667 internal::BufferModifiability::modifiable,
668 internal::BufferType::out_buffer,
684 internal::BufferModifiability::modifiable,
685 internal::BufferType::out_buffer,
698template <
typename Container>
702 internal::BufferModifiability::constant,
703 internal::BufferType::in_buffer,
705 int>(std::forward<Container>(
container));
718 internal::BufferModifiability::constant,
719 internal::BufferType::in_buffer,
740template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
744 internal::BufferModifiability::modifiable,
745 internal::BufferType::out_buffer,
747 int>(std::forward<Container>(
container));
762template <
typename Container>
766 internal::BufferModifiability::modifiable,
767 internal::BufferType::out_buffer,
786template <
template <
typename...>
typename Container>
790 internal::BufferModifiability::modifiable,
791 internal::BufferType::out_buffer,
807 internal::BufferModifiability::modifiable,
808 internal::BufferType::out_buffer,
831 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Container>>>
835 internal::BufferModifiability::modifiable,
836 internal::BufferType::out_buffer,
837 resize_policy>(std::forward<Container>(
container));
860 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Container>>>
875 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
879 internal::BufferModifiability::modifiable,
880 internal::BufferType::out_buffer,
896 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
915template <
typename Container>
919 internal::BufferModifiability::modifiable,
920 internal::BufferType::out_buffer,
939template <
typename Container>
952template <
typename ValueType>
956 internal::BufferModifiability::modifiable,
957 internal::BufferType::out_buffer,
970template <
typename ValueType>
1084template <
typename EnumType,
typename = std::enable_if_t<std::is_enum_v<EnumType>>>
1087 std::is_convertible_v<std::underlying_type_t<EnumType>,
int>,
1088 "The underlying enum type must be implicitly convertible to int."
1090 return tag(
static_cast<int>(value));
1115template <
typename EnumType,
typename = std::enable_if_t<std::is_enum_v<EnumType>>>
1118 std::is_convertible_v<std::underlying_type_t<EnumType>,
int>,
1119 "The underlying enum type must be implicitly convertible to int."
1121 return send_tag(
static_cast<int>(value));
1146template <
typename EnumType,
typename = std::enable_if_t<std::is_enum_v<EnumType>>>
1149 std::is_convertible_v<std::underlying_type_t<EnumType>,
int>,
1150 "The underlying enum type must be implicitly convertible to int."
1152 return recv_tag(
static_cast<int>(value));
1163 internal::BufferModifiability::modifiable,
1164 internal::BufferType::out_buffer,
1173template <
typename IndexType>
1178 internal::BufferModifiability::modifiable,
1179 internal::BufferType::out_buffer,
1190 internal::BufferModifiability::modifiable,
1191 internal::BufferType::out_buffer,
1200template <
typename SendModeTag>
1217template <
typename Op,
typename Commutative = ops::
internal::undefined_commutative_tag>
1230template <
typename Container>
1234 internal::BufferModifiability::constant,
1235 internal::BufferType::in_buffer,
1245template <
typename T>
1249 internal::BufferModifiability::constant,
1250 internal::BufferType::in_buffer,
1262 internal::BufferModifiability::constant,
1263 internal::BufferType::in_buffer,
1276 internal::BufferModifiability::modifiable,
1277 internal::BufferType::out_buffer,
1291 internal::BufferModifiability::modifiable,
1292 internal::BufferType::out_buffer,
1305 internal::BufferModifiability::constant,
1306 internal::BufferType::in_buffer,
1319 internal::BufferModifiability::modifiable,
1320 internal::BufferType::out_buffer,
1334 internal::BufferModifiability::modifiable,
1335 internal::BufferType::out_buffer,
1349 internal::BufferModifiability::constant,
1350 internal::BufferType::in_buffer,
1364 internal::BufferModifiability::modifiable,
1365 internal::BufferType::out_buffer,
1380 internal::BufferModifiability::modifiable,
1381 internal::BufferType::out_buffer,
1388using namespace params;
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
Wrapper for MPI request handles (aka. MPI_Request).
Definition request.hpp:145
Parameter wrapping an operation passed to reduce-like MPI collectives. This wraps an MPI operation wi...
Definition operation_builder.hpp:38
Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like M...
Definition parameter_objects.hpp:358
Encapsulates a message tag.
Definition parameter_objects.hpp:514
constexpr BufferResizePolicy resize_to_fit
Definition data_buffer.hpp:305
BufferResizePolicy
Enum to specify in which cases a buffer is resized.
Definition data_buffer.hpp:291
@ no_resize
Policy indicating that the underlying buffer shall never be resized.
auto send_mode(SendModeTag)
Passes the send mode parameter for point to point communication to the underlying call....
Definition named_parameters.hpp:1201
auto recv_displs_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:804
auto recv_displs(Container &&container)
Passes a container as receive displacements to the underlying call, i.e. the container's storage must...
Definition named_parameters.hpp:699
auto request()
Internally allocate a request object and return it to the user.
Definition named_parameters.hpp:1186
auto send_displs(Container &&container)
Passes a container as send displacements to the underlying call, i.e. the container's storage must co...
Definition named_parameters.hpp:576
auto tag(internal::any_tag_t)
Indicates to use MPI_ANY_TAG as tag in the underlying call.
Definition named_parameters.hpp:1066
auto send_tag(internal::any_tag_t)
Indicates to use MPI_ANY_TAG as send tag in the underlying call.
Definition named_parameters.hpp:1097
auto root(int rank)
Passes rank as root rank to the underlying call. This parameter is needed in functions like MPI_Gathe...
Definition named_parameters.hpp:981
auto send_counts(Container &&container)
Passes a container as send counts to the underlying call, i.e. the container's storage must contain t...
Definition named_parameters.hpp:205
auto source(int rank)
Passes rank as source rank to the underlying call. This parameter is needed in point-to-point exchang...
Definition named_parameters.hpp:1030
auto send_recv_type_out()
Indicates to deduce the send/recv type in the underlying call and return it as part of underlying cal...
Definition named_parameters.hpp:1361
auto send_type_out()
Indicates to deduce the send type in the underlying call and return it as part of underlying call's r...
Definition named_parameters.hpp:1273
auto recv_type_out()
Indicates to deduce the receive type in the underlying call and return it as part of underlying call'...
Definition named_parameters.hpp:1316
auto send_recv_buf(Data &&data)
Passes a container/single value as a send or receive buffer to the underlying MPI call.
Definition named_parameters.hpp:139
auto send_count(int count)
Passes count as send count to the underlying call.
Definition named_parameters.hpp:323
auto send_displs_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:681
auto recv_buf_out(Container &&container)
Passes a container, into which the received elements will be written, to the underlying call....
Definition named_parameters.hpp:832
auto send_recv_count_out()
Indicates to deduce the send/recv count and return it to the caller as part of the underlying call's ...
Definition named_parameters.hpp:557
auto recv_count(int count)
Passes count as recv count to the underlying call.
Definition named_parameters.hpp:492
auto send_recv_type(MPI_Datatype send_recv_type)
Passes send_recv_type as send/recv type to the underlying call. (This parameter is in MPI routines su...
Definition named_parameters.hpp:1346
auto destination(int rank)
Passes rank as destination rank to the underlying call. This parameter is needed in point-to-point ex...
Definition named_parameters.hpp:1001
auto send_counts_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:311
auto recv_buf(Container &&container)
Passes a container, into which the received elements will be written, to the underlying call....
Definition named_parameters.hpp:861
auto recv_counts_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:480
internal::OperationBuilder< Op, Commutative > op(Op &&op, Commutative commute=ops::internal::undefined_commutative_tag{})
Passes a reduction operation to ther underlying call. Accepts function objects, lambdas,...
Definition named_parameters.hpp:1219
auto recv_type(MPI_Datatype recv_type)
Passes recv_type as recv type to the underlying call.
Definition named_parameters.hpp:1302
auto recv_counts(Container &&container)
Passes a container as recv counts to the underlying call, i.e. the container's storage must contain t...
Definition named_parameters.hpp:368
auto send_type(MPI_Datatype send_type)
Passes send_type as send type to the underlying call.
Definition named_parameters.hpp:1259
auto send_count_out()
Indicates to deduce the send count and return it to the caller as part of the underlying call's resul...
Definition named_parameters.hpp:349
auto send_buf_out(Data &&data)
Passes a container/single value as rvalue as a send buffer to the underlying MPI call....
Definition named_parameters.hpp:117
auto send_recv_count(int count)
Passes count as send/recv count to the underlying call.
Definition named_parameters.hpp:531
auto recv_count_out()
Indicates to deduce the recv count and return it to the caller as part of the underlying call's resul...
Definition named_parameters.hpp:518
auto values_on_rank_0(Container &&container)
Passes a container containing the value(s) to return on the first rank to kamping::Communicator::exsc...
Definition named_parameters.hpp:1231
auto recv_tag(internal::any_tag_t)
Indicates to use MPI_ANY_TAG as recv tag in the underlying call.
Definition named_parameters.hpp:1128
auto send_buf(internal::ignore_t< Data > ignore)
Generates a dummy send buf that wraps a nullptr.
Definition named_parameters.hpp:53
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
@ request
Tag used to represent an MPI_Request.
@ recv_count
Tag used to represent the number of elements to be received.
@ recv_type
Tag used to represent a recv type in an MPI call.
@ send_type
Tag used to represent a send type in an MPI call.
@ send_count
Tag used to represent the number of elements to be sent.
Definitions for builtin MPI operations.
File containing the parameter types used by the KaMPIng library.
RankDataBuffer< RankType::value, ParameterType::root > RootDataBuffer
Helper for roots;.
Definition parameter_objects.hpp:466
auto make_data_buffer_builder(Data &&data)
Factory method for constructing a DataBufferBuilder from the given Container Data.
Definition parameter_objects.hpp:225
BufferModifiability
Enum to specify whether a buffer is modifiable.
Definition data_buffer.hpp:275
auto make_data_buffer(Data &&data)
Creates a user allocated DataBuffer containing the supplied data (a container or a single element)
Definition data_buffer.hpp:798
Parameter objects return by named parameter factory functions.
Parameter object for send_mode encapsulating the send mode compile-time tag.
Definition parameter_objects.hpp:478
tag struct for message tag
Definition parameter_objects.hpp:502
Tag type for parameters that can be omitted on some PEs (e.g., root PE, or non-root PEs).
Definition parameter_objects.hpp:336
tag struct for MPI_ANY_SOURCE
Definition parameter_objects.hpp:345
tag struct for MPI_PROC_NULL
Definition parameter_objects.hpp:346
An unused template parameter.
Definition named_parameters.hpp:36
tag for a reduce operation without manually declared commutativity (this is only used internally for ...
Definition mpi_ops.hpp:194