19#include <initializer_list>
26#include "kamping/named_parameters_detail/status_parameters.hpp"
29#include "kamping/request.hpp"
30#include "kamping/serialization.hpp"
50template <
typename Data>
53 make_empty_data_buffer_builder<Data, internal::ParameterType::send_buf, internal::BufferType::ignore>();
65template <
typename Data,
typename Enable = std::enable_if_t<!
internal::is_serialization_buffer_v<Data>>>
69 internal::BufferModifiability::constant,
70 internal::BufferType::in_buffer,
78 typename SerializationBufferType,
79 std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>,
bool> =
true>
83 internal::BufferModifiability::modifiable,
84 internal::BufferType::in_buffer,
98 internal::BufferModifiability::constant,
99 internal::BufferType::in_buffer,
114template <
typename Data,
typename Enable = std::enable_if_t<std::is_rvalue_reference_v<Data&&>>>
118 internal::BufferModifiability::constant,
119 internal::BufferType::in_out_buffer,
136 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Data>>>
139 ? internal::BufferModifiability::constant
140 : internal::BufferModifiability::modifiable;
144 internal::BufferType::in_out_buffer,
145 resize_policy>(std::forward<Data>(data));
152 typename SerializationBufferType,
153 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
156 std::is_const_v<std::remove_reference_t<SerializationBufferType>> ? internal::BufferModifiability::constant
157 : internal::BufferModifiability::modifiable;
161 internal::BufferType::in_out_buffer,
169template <
typename Container>
173 internal::BufferModifiability::modifiable,
174 internal::BufferType::in_out_buffer,
184template <
typename ValueType>
188 internal::BufferModifiability::modifiable,
189 internal::BufferType::in_out_buffer,
202template <
typename Container>
206 internal::BufferModifiability::constant,
207 internal::BufferType::in_buffer,
209 int>(std::forward<Container>(
container));
222 internal::BufferModifiability::constant,
223 internal::BufferType::in_buffer,
244template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
248 internal::BufferModifiability::modifiable,
249 internal::BufferType::out_buffer,
251 int>(std::forward<Container>(
container));
267template <
typename Container>
271 internal::BufferModifiability::modifiable,
272 internal::BufferType::out_buffer,
291template <
template <
typename...>
typename Container>
295 internal::BufferModifiability::modifiable,
296 internal::BufferType::out_buffer,
312 internal::BufferModifiability::modifiable,
313 internal::BufferType::out_buffer,
324 internal::BufferModifiability::constant,
325 internal::BufferType::in_buffer,
327 int>(std::move(count));
337 internal::BufferModifiability::modifiable,
338 internal::BufferType::out_buffer,
350 internal::BufferModifiability::modifiable,
351 internal::BufferType::out_buffer,
365template <
typename Container>
369 internal::BufferModifiability::constant,
370 internal::BufferType::in_buffer,
372 int>(std::forward<Container>(
container));
385 internal::BufferModifiability::constant,
386 internal::BufferType::in_buffer,
394 make_empty_data_buffer_builder<int, internal::ParameterType::recv_counts, internal::BufferType::ignore>();
413template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
417 internal::BufferModifiability::modifiable,
418 internal::BufferType::out_buffer,
420 int>(std::forward<Container>(
container));
436template <
typename Data>
440 internal::BufferModifiability::modifiable,
441 internal::BufferType::out_buffer,
460template <
template <
typename...>
typename Data>
464 internal::BufferModifiability::modifiable,
465 internal::BufferType::out_buffer,
481 internal::BufferModifiability::modifiable,
482 internal::BufferType::out_buffer,
493 internal::BufferModifiability::constant,
494 internal::BufferType::in_buffer,
496 int>(std::move(count));
506 internal::BufferModifiability::modifiable,
507 internal::BufferType::out_buffer,
519 internal::BufferModifiability::modifiable,
520 internal::BufferType::out_buffer,
532 internal::BufferModifiability::constant,
533 internal::BufferType::in_buffer,
535 int>(std::move(count));
545 internal::BufferModifiability::modifiable,
546 internal::BufferType::out_buffer,
558 internal::BufferModifiability::modifiable,
559 internal::BufferType::out_buffer,
573template <
typename Container>
577 internal::BufferModifiability::constant,
578 internal::BufferType::in_buffer,
580 int>(std::forward<Container>(
container));
593 internal::BufferModifiability::constant,
594 internal::BufferType::in_buffer,
615template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
619 internal::BufferModifiability::modifiable,
620 internal::BufferType::out_buffer,
622 int>(std::forward<Container>(
container));
637template <
typename Container>
641 internal::BufferModifiability::modifiable,
642 internal::BufferType::out_buffer,
661template <
template <
typename...>
typename Container>
665 internal::BufferModifiability::modifiable,
666 internal::BufferType::out_buffer,
682 internal::BufferModifiability::modifiable,
683 internal::BufferType::out_buffer,
696template <
typename Container>
700 internal::BufferModifiability::constant,
701 internal::BufferType::in_buffer,
703 int>(std::forward<Container>(
container));
716 internal::BufferModifiability::constant,
717 internal::BufferType::in_buffer,
738template <BufferResizePolicy resize_policy = BufferResizePolicy::no_resize,
typename Container>
742 internal::BufferModifiability::modifiable,
743 internal::BufferType::out_buffer,
745 int>(std::forward<Container>(
container));
760template <
typename Container>
764 internal::BufferModifiability::modifiable,
765 internal::BufferType::out_buffer,
784template <
template <
typename...>
typename Container>
788 internal::BufferModifiability::modifiable,
789 internal::BufferType::out_buffer,
805 internal::BufferModifiability::modifiable,
806 internal::BufferType::out_buffer,
829 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Container>>>
833 internal::BufferModifiability::modifiable,
834 internal::BufferType::out_buffer,
835 resize_policy>(std::forward<Container>(
container));
858 typename Enable = std::enable_if_t<!internal::is_serialization_buffer_v<Container>>>
872 typename SerializationBufferType,
873 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
877 internal::BufferModifiability::modifiable,
878 internal::BufferType::out_buffer,
893 typename SerializationBufferType,
894 typename Enable = std::enable_if_t<internal::is_serialization_buffer_v<SerializationBufferType>>>
913template <
typename Container>
917 internal::BufferModifiability::modifiable,
918 internal::BufferType::out_buffer,
937template <
typename Container>
950template <
typename ValueType>
954 internal::BufferModifiability::modifiable,
955 internal::BufferType::out_buffer,
968template <
typename ValueType>
1082template <
typename EnumType,
typename = std::enable_if_t<std::is_enum_v<EnumType>>>
1085 std::is_convertible_v<std::underlying_type_t<EnumType>,
int>,
1086 "The underlying enum type must be implicitly convertible to int."
1088 return tag(
static_cast<int>(value));
1099 internal::BufferModifiability::modifiable,
1100 internal::BufferType::out_buffer,
1109template <
typename IndexType>
1114 internal::BufferModifiability::modifiable,
1115 internal::BufferType::out_buffer,
1126 internal::BufferModifiability::modifiable,
1127 internal::BufferType::out_buffer,
1136template <
typename SendModeTag>
1153template <
typename Op,
typename Commutative = ops::
internal::undefined_commutative_tag>
1154internal::OperationBuilder<Op, Commutative>
1156 return internal::OperationBuilder<Op, Commutative>(std::forward<Op>(
op), commute);
1166template <
typename Container>
1170 internal::BufferModifiability::constant,
1171 internal::BufferType::in_buffer,
1181template <
typename T>
1185 internal::BufferModifiability::constant,
1186 internal::BufferType::in_buffer,
1198 internal::BufferModifiability::constant,
1199 internal::BufferType::in_buffer,
1212 internal::BufferModifiability::modifiable,
1213 internal::BufferType::out_buffer,
1227 internal::BufferModifiability::modifiable,
1228 internal::BufferType::out_buffer,
1241 internal::BufferModifiability::constant,
1242 internal::BufferType::in_buffer,
1255 internal::BufferModifiability::modifiable,
1256 internal::BufferType::out_buffer,
1270 internal::BufferModifiability::modifiable,
1271 internal::BufferType::out_buffer,
1285 internal::BufferModifiability::constant,
1286 internal::BufferType::in_buffer,
1300 internal::BufferModifiability::modifiable,
1301 internal::BufferType::out_buffer,
1316 internal::BufferModifiability::modifiable,
1317 internal::BufferType::out_buffer,
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
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:513
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 tag(internal::any_tag_t)
Indicates to use MPI_ANY_TAG as tag in the underlying call.
Definition named_parameters.hpp:1064
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:999
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:979
auto send_mode(SendModeTag)
Passes the send mode parameter for point to point communication to the underlying call....
Definition named_parameters.hpp:1137
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:1167
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:1155
auto send_count(int count)
Passes count as send count to the underlying call.
Definition named_parameters.hpp:321
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:366
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:1252
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:1028
auto request()
Internally allocate a request object and return it to the user.
Definition named_parameters.hpp:1122
auto send_type(MPI_Datatype send_type)
Passes send_type as send type to the underlying call.
Definition named_parameters.hpp:1195
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:830
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:115
auto recv_buf(Container &&container)
Passes a container, into which the received elements will be written, to the underlying call....
Definition named_parameters.hpp:859
auto send_buf(internal::ignore_t< Data > ignore)
Generates a dummy send buf that wraps a nullptr.
Definition named_parameters.hpp:51
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:1297
auto send_counts_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:309
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:347
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:137
auto recv_counts_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:478
auto recv_displs_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:802
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:203
auto send_recv_count(int count)
Passes count as send/recv count to the underlying call.
Definition named_parameters.hpp:529
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:697
auto recv_count(int count)
Passes count as recv count to the underlying call.
Definition named_parameters.hpp:490
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:1209
auto send_displs_out()
Indicates to construct a container with type kamping::Communicator::default_container_type<int>,...
Definition named_parameters.hpp:679
auto recv_type(MPI_Datatype recv_type)
Passes recv_type as recv type to the underlying call.
Definition named_parameters.hpp:1238
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:574
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:1282
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:516
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:555
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