KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
parameter_objects.hpp
Go to the documentation of this file.
1// This file is part of KaMPIng.
2//
3// Copyright 2021-2024 The KaMPIng Authors
4//
5// KaMPIng is free software : you can redistribute it and/or modify it under the
6// terms of the GNU Lesser General Public License as published by the Free
7// Software Foundation, either version 3 of the License, or (at your option) any
8// later version. KaMPIng is distributed in the hope that it will be useful, but
9// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
11// for more details.
12//
13// You should have received a copy of the GNU Lesser General Public License
14// along with KaMPIng. If not, see <https://www.gnu.org/licenses/>.
15/// @file
16/// @brief Parameter objects return by named parameter factory functions
17
18#pragma once
19
20#include <cstddef>
21
22#include <mpi.h>
23
27#include "kamping/serialization.hpp"
28#include "kamping/status.hpp"
29
30namespace kamping::internal {
31
32/// @brief Dummy template for representing the absence of a container to rebind to.
33/// @see AllocNewDataBufferBuilder::construct_buffer_or_rebind()
34template <typename>
36
37/// @brief Parameter object representing a data buffer. This is an intermediate object which only holds the data and
38/// parameters. The actual buffer is created by calling the \c construct_buffer_or_rebind() method.
39/// @tparam Data The data type.
40/// @tparam parameter_type_param The parameter type.
41/// @tparam modifiability The modifiability of the buffer.
42/// @tparam buffer_type The type of the buffer.
43/// @tparam buffer_resize_policy The resize policy of the buffer.
44/// @tparam ValueType The value type of the buffer. Defaults to \ref default_value_type_tag, indicating that this buffer
45/// does not enforce a specific value type.
46template <
47 typename Data,
50 BufferType buffer_type,
54 static constexpr ParameterType parameter_type = parameter_type_param; ///< The parameter type.
55 DataBufferBuilder() : data_() {}
56 /// @brief Constructor for DataBufferBuilder.
57 /// @param data The container to build a databuffer for
58 /// @tparam Data_ The type of the container.
59 template <typename Data_>
60 DataBufferBuilder(Data_&& data) : data_(std::forward<Data_>(data)) {}
61
62private:
63 Data data_;
64
65public:
67 decltype(make_data_buffer<
71 buffer_type,
73 ValueType>(std::forward<Data>(data_))); ///< The type of the constructed data buffer.
74
75 /// @brief Constructs the data buffer.
76 /// @tparam RebindContainerType The container to use for the data buffer (has no effect here).
77 /// @tparam Flag A tag type indicating special behavior, e.g., serialization support (@see \ref
78 /// serialization_support_tag). Defaults to `void`.
79 template <template <typename...> typename RebindContainerType = UnusedRebindContainer, typename Flag = void>
81 using Data_no_ref = std::remove_const_t<std::remove_reference_t<Data>>;
82 static constexpr bool support_serialization = std::is_same_v<Flag, internal::serialization_support_tag>;
83 static_assert(
84 support_serialization || !internal::is_serialization_buffer_v<Data_no_ref>,
85 "\n ---> Serialization buffers are not supported here."
86 );
89 } else {
90 return make_data_buffer<
94 buffer_type,
96 ValueType>(std::forward<Data>(data_));
97 }
98 }
99 static constexpr bool is_out_buffer =
100 DataBufferType::is_out_buffer; ///< \c true if the buffer is an out or in/out buffer that results will be
101 ///< written to and \c false otherwise.
102 static constexpr bool is_owning =
103 DataBufferType::is_owning; ///< Indicates whether the buffer owns its underlying storage.
104 static constexpr bool is_lib_allocated =
105 DataBufferType::is_lib_allocated; ///< Indicates whether the buffer is allocated by KaMPIng.
106 static constexpr bool is_single_element =
107 DataBufferType::is_single_element; ///< Indicated whether the buffer is a single element buffer.
108 using value_type = typename DataBufferType::value_type; ///< The constructed data buffer's value type.
109
110 /// @brief The size of the underlying container.
111 size_t size() const {
112 if constexpr (is_single_element) {
113 return 1;
114 } else {
115 return data_.size();
116 }
117 }
118};
119
120/// @brief Parameter object representing a data buffer to be allocated by KaMPIng. This is a specialization of \ref
121/// DataBufferBuilder for buffer allocation tags, such as \ref alloc_new, \ref alloc_new_using and \ref
122/// alloc_container_of. This is an intermediate object not holding any data. The actual buffer is constructed by
123/// calling the \c construct_buffer_or_rebind() method.
124///
125/// This type should be constructed using the factory methods \ref make_data_buffer_builder.
126///
127/// @tparam AllocType A tag type indicating what kind of buffer should be allocated. see \ref alloc_new, \ref
128/// alloc_new_using and \ref alloc_container_of.
129template <
130 typename AllocType,
131 typename ValueType,
134 BufferType buffer_type,
137 static constexpr ParameterType parameter_type = parameter_type_param; ///< The parameter type.
138public:
143 buffer_type,
145 ValueType>(
146 std::conditional_t<
148 AllocNewT<std::vector<ValueType>>, // we rebind to std::vector here, because this DataBufferType is only
149 // used for determining is_out_buffer, is_owning, etc. and rebinding
150 // does not affect this.
151 AllocType>{}
152 )); ///< The type of the constructed data buffer (potentially rebinded to std::vector).
153
154public:
155 /// @brief Constructs the data buffer.
156 /// @tparam RebindContainerType The container to use for constructing the data buffer. This parameter is ignored if
157 /// the buffer allocation trait is \ref alloc_new or \ref alloc_new_using. In case of `alloc_container_of<U>`, the
158 /// created data buffer encapsulated a `RebindContainerType<U>`.
159 /// @tparam Flag A tag type indicating special behavior, e.g., serialization support (@see \ref
160 /// serialization_support_tag). Defaults to `void`.
161 template <template <typename...> typename RebindContainerType = UnusedRebindContainer, typename Flag = void>
163 if constexpr (is_alloc_new_v<AllocType>) {
164 return make_data_buffer<
168 buffer_type,
171 } else if constexpr (is_alloc_new_using_v<AllocType>) {
172 return make_data_buffer<
176 buffer_type,
179 } else if constexpr (is_alloc_container_of_v<AllocType>) {
180 static_assert(
181 !std::is_same_v<RebindContainerType<void>, UnusedRebindContainer<void>>,
182 "RebindContainerType is required."
183 );
184 return make_data_buffer<
188 buffer_type,
191 } else {
192 static_assert(is_alloc_container_of_v<AllocType>, "Unknown AllocType");
193 }
194 }
195 static constexpr bool is_out_buffer =
196 DataBufferType::is_out_buffer; ///< \c true if the buffer is an out or in/out buffer that results will be
197 ///< written to and \c false otherwise.
198 static constexpr bool is_owning =
199 DataBufferType::is_owning; ///< Indicates whether the buffer owns its underlying storage.
200 static constexpr bool is_lib_allocated =
201 DataBufferType::is_lib_allocated; ///< Indicates whether the buffer is allocated by KaMPIng
202 static constexpr bool is_single_element =
203 DataBufferType::is_single_element; ///< Indicated whether the buffer is a single element buffer.
204 using value_type = typename DataBufferType::value_type; ///< The constructed data buffer's value type.
205
206 /// @brief The size of the underlying container.
207 size_t size() const {
208 if constexpr (is_single_element) {
209 return 1;
210 } else {
211 return 0;
212 }
213 }
214};
215
216/// @brief Factory method for constructing a \ref DataBufferBuilder from the given Container \p Data.
217/// @see DataBufferBuilder
218template <
219 ParameterType parameter_type,
221 BufferType buffer_type,
223 typename ValueType = default_value_type_tag,
224 typename Data>
230
231/// @brief Factory method for constructing a \ref DataBufferBuilder from an `std::initializer_list`.
232/// @see DataBufferBuilder
233template <
234 ParameterType parameter_type,
236 BufferType buffer_type,
238 typename Data>
239auto make_data_buffer_builder(std::initializer_list<Data> data) {
240 auto data_vec = [&]() {
241 if constexpr (std::is_same_v<Data, bool>) {
242 return std::vector<kabool>(data.begin(), data.end());
243 // We only use automatic conversion of bool to kabool for initializer lists, but not for single elements of
244 // type bool. The reason for that is, that sometimes single element conversion may not be desired.
245 // E.g. consider a gather operation with send_buf := bool& and recv_buf := Span<bool>, or a bcast with
246 // send_recv_buf = bool&
247 } else {
248 return std::vector<Data>{data};
249 }
250 }();
252 std::move(data_vec)
253 );
254}
255
256/// @brief Factory method for constructing an \ref AllocNewDataBufferBuilder for \ref alloc_new.
257template <
258 ParameterType parameter_type,
260 BufferType buffer_type,
262 typename ValueType = default_value_type_tag,
263 typename Data>
267 ValueType,
268 parameter_type,
270 buffer_type,
272}
273
274/// @brief Factory method for constructing an \ref AllocNewDataBufferBuilder for \ref alloc_new_using.
275template <
276 ParameterType parameter_type,
278 BufferType buffer_type,
280 typename ValueType = default_value_type_tag,
281 template <typename...>
282 typename Container>
292
293/// @brief Factory method for constructing an \ref AllocNewDataBufferBuilder for \ref alloc_container_of.
294template <
295 ParameterType parameter_type,
297 BufferType buffer_type,
299 typename ValueType>
309
310/// @brief Factory method for constructing an DataBufferBuilder for an \ref EmptyDataBuffer.
311/// @see DataBufferBuilder
312template <typename ValueType, ParameterType parameter_type, BufferType buffer_type>
314 return DataBufferBuilder<
316 parameter_type,
317 BufferModifiability::constant,
318 buffer_type,
319 no_resize,
320 ValueType>();
321}
322
323/// @brief Helper type for representing a type list
324/// @tparam Args the types.
325template <typename... Args>
326struct type_list {
327 /// @brief Member attribute to check if a type is contained in the list
328 /// @tparam T The type to check for if it is contained in the list.
329 template <typename T>
330 static constexpr bool contains = std::disjunction<std::is_same<T, Args>...>::value;
331};
332
333/// @brief Tag type for parameters that can be omitted on some PEs (e.g., root
334/// PE, or non-root PEs).
335template <typename T>
336struct ignore_t {};
337
338/// @brief Indicator if a rank parameter holds and actual value or \c MPI_ANY_SOURCE or \c MPI_PROC_NULL.
339enum class RankType {
340 value, ///< holds a value
341 any, ///< holds \c MPI_ANY_SOURCE
342 null ///< holds \c MPI_PROC_NULL
343};
344
345struct rank_any_t {}; ///< tag struct for \c MPI_ANY_SOURCE
346struct rank_null_t {}; ///< tag struct for \c MPI_PROC_NULL
347
348/// @brief Encapsulates the rank of a PE. This is needed for p2p communication
349/// and rooted \c MPI collectives like \c MPI_Gather.
350///
351/// This is a specialized \c DataBuffer. Its main functionality is to provide
352/// ease-of-use functionality in the form of the methods \c rank() and \c
353/// rank_signed(), which return the encapsulated rank and are easier to read in
354/// the code.
355// @tparam rank_type The \ref RankType encapsulated.
356// @tparam parameter_type The parameter type.
357template <RankType rank_type, ParameterType parameter_type>
359
360/// @brief Encapsulates the rank of a PE. This is needed for p2p communication
361/// and rooted \c MPI collectives like \c MPI_Gather.
362///
363/// This is a specialized \c DataBuffer. Its main functionality is to provide
364/// ease-of-use functionality in the form of the methods \c rank() and \c
365/// rank_signed(), which return the encapsulated rank and are easier to read in
366/// the code.
367// @tparam rank_type The \ref RankType encapsulated.
368// @tparam parameter_type The parameter type.
369template <ParameterType type>
371 size_t,
372 ParameterType,
373 type,
374 BufferModifiability::modifiable,
375 BufferOwnership::owning,
376 BufferType::in_buffer,
377 BufferResizePolicy::no_resize,
378 BufferAllocation::user_allocated> {
379private:
380 using BaseClass = DataBuffer<
381 size_t,
383 type,
384 BufferModifiability::modifiable,
385 BufferOwnership::owning,
386 BufferType::in_buffer,
388 BufferAllocation::user_allocated>;
389
390public:
391 static constexpr ParameterType parameter_type = type; ///< The type of parameter this object encapsulates.
392 static constexpr RankType rank_type = RankType::value; ///< The rank type.
393
394 /// @brief Constructor for Rank.
395 /// @param rank Rank of the PE.
396 RankDataBuffer(size_t rank) : BaseClass(rank) {}
397
398 /// @brief Constructor for Rank.
399 /// @param rank Rank of the PE.
401
402 /// @brief Returns the rank as `int`.
403 /// @returns Rank as `int`.
404 int rank_signed() const {
405 return asserting_cast<int>(BaseClass::underlying());
406 }
407
408 /// @brief Get a copy of this RankDataBuffer.
409 ///
410 /// @return A copy of this RankDataBuffer.
412 return {BaseClass::underlying()};
413 }
414};
415
416/// @brief Encapsulates the rank of a PE. This is needed for p2p communication
417/// and rooted \c MPI collectives like \c MPI_Gather.
418///
419/// This is a specialization for MPI_ANY_SOURCE which only implements
420/// \ref rank_signed(), without allocating any additional memory.
421template <ParameterType type>
422class RankDataBuffer<RankType::any, type> : private CopyMoveEnabler<> {
423public:
424 static constexpr ParameterType parameter_type = type; ///< The type of parameter this object encapsulates.
425 static constexpr RankType rank_type = RankType::any; ///< The rank type.
426
427 /// @brief Returns the rank as `int`.
428 /// @returns Rank as `int`.
429 int rank_signed() const {
430 return MPI_ANY_SOURCE;
431 }
432
433 /// @brief Get a copy of this RankDataBuffer.
434 ///
435 /// @return A copy of this RankDataBuffer.
439};
440
441/// @brief Encapsulates the rank of a PE. This is needed for p2p communication
442/// and rooted \c MPI collectives like \c MPI_Gather.
443///
444/// This is a specialization for MPI_PROC_NULL which only implements
445/// \ref rank_signed(), without allocating any additional memory.
446template <ParameterType type>
447class RankDataBuffer<RankType::null, type> : private CopyMoveEnabler<> {
448public:
449 static constexpr ParameterType parameter_type = type; ///< The type of parameter this object encapsulates.
450 static constexpr RankType rank_type = RankType::null; ///< The rank type.
451
452 /// @brief Returns the rank as `int`.
453 /// @returns Rank as `int`.
454 int rank_signed() const {
455 return MPI_PROC_NULL;
456 }
457
458 /// @brief Get a copy of this RankDataBuffer.
459 ///
460 /// @return A copy of this RankDataBuffer.
464};
465
467
468struct standard_mode_t {}; ///< tag for standard send mode
469struct buffered_mode_t {}; ///< tag for buffered send mode
470struct synchronous_mode_t {}; ///< tag for synchronous send mode
471struct ready_mode_t {}; ///< tag for ready send mode
474
475/// @brief Parameter object for send_mode encapsulating the send mode compile-time tag.
476/// @tparam SendModeTag The send mode.
477template <typename SendModeTag>
479 static_assert(send_mode_list::contains<SendModeTag>, "Unsupported send mode.");
480 static constexpr ParameterType parameter_type = ParameterType::send_mode; ///< The parameter type.
481 using send_mode = SendModeTag; ///< The send mode.
482};
483
484/// @brief returns a pointer to the \c MPI_Status encapsulated by the provided status parameter object.
485/// @tparam StatusParam The type of the status parameter object.
486/// @param param The status parameter object.
487/// @returns A pointer to the encapsulated \c MPI_Status or \c MPI_STATUS_IGNORE.
488template <typename StatusParam>
490 static_assert(StatusParam::parameter_type == ParameterType::status);
491 static_assert(type_list<MPI_Status, Status>::contains<typename StatusParam::value_type>);
492 if constexpr (StatusParam::buffer_type == BufferType::ignore) {
493 return MPI_STATUS_IGNORE;
494 } else if constexpr (std::is_same_v<typename StatusParam::value_type, MPI_Status>) {
495 return param.data();
496 } else {
497 // value_type == kamping::Status
498 return &param.underlying().native();
499 }
500}
501
502struct any_tag_t {}; ///< tag struct for message tag
503
504/// @brief Possible types of tag
505enum class TagType {
506 value, ///< holds an actual value
507 any ///< special value MPI_ANY_TAG}
508};
509
510/// @brief Encapsulates a message tag.
511/// @tparam The type of the tag.
512template <TagType tag_type>
513class TagParam {};
514
515/// @brief Encapsulates a message tag. Specialization if an explicit tag value is provided.
516template <>
518public:
519 /// @param tag The tag.
520 TagParam(int tag) : _tag_value(tag) {}
521 static constexpr ParameterType parameter_type = ParameterType::tag; ///< The parameter type.
522 static constexpr TagType tag_type = TagType::value; ///< The tag type.
523 /// @return The tag.
524 [[nodiscard]] int tag() const {
525 return _tag_value;
526 }
527
528 /// @brief Get a copy of this TagParam.
529 ///
530 /// @return A copy of this TagParam.
532 return {_tag_value};
533 }
534
535private:
536 int _tag_value; ///< the encapsulated tag value
537};
538
539/// @brief Encapsulates a message tag. Specialization if the value is MPI_ANY_TAG.
540template <>
541class TagParam<TagType::any> : private CopyMoveEnabler<> {
542public:
543 static constexpr ParameterType parameter_type = ParameterType::tag; ///< The parameter type.
544 static constexpr TagType tag_type = TagType::any; ///< The tag type.
545 /// @return The tag.
546 [[nodiscard]] int tag() const {
547 return MPI_ANY_TAG;
548 }
549
550 /// @brief Get a copy of this TagParam.
551 ///
552 /// @return A copy of this TagParam.
554 return {};
555 }
556};
557} // namespace kamping::internal
558
559namespace kamping {
560
561namespace send_modes {
562static constexpr internal::standard_mode_t standard{}; ///< global constant for standard send mode
563static constexpr internal::buffered_mode_t buffered{}; ///< global constant for buffered send mode
564static constexpr internal::synchronous_mode_t synchronous{}; ///< global constant for synchronous send mode
565static constexpr internal::ready_mode_t ready{}; ///< global constant for ready send mode
566} // namespace send_modes
567
568/// @brief Tag for parameters that can be omitted on some PEs (e.g., root PE, or non-root PEs).
569template <typename T = void>
571
572namespace tags {
573static constexpr internal::any_tag_t any{}; ///< global constant for any tag
574}
575
576namespace rank {
577static constexpr internal::rank_any_t any{}; ///< global constant for any rank
578static constexpr internal::rank_null_t null{}; ///< global constant for rank NULL
579} // namespace rank
580
581} // namespace kamping
Helper functions that make casts safer.
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
Class optionally containing a copy constructor while supporting move assignment/construction.
Definition data_buffer.hpp:85
Data buffer used for named parameters.
Definition data_buffer.hpp:371
Empty buffer that can be used as default argument for optional buffer parameters.
Definition data_buffer.hpp:722
RankDataBuffer< rank_type, parameter_type > clone()
Get a copy of this RankDataBuffer.
Definition parameter_objects.hpp:436
int rank_signed() const
Returns the rank as int.
Definition parameter_objects.hpp:429
RankDataBuffer< rank_type, parameter_type > clone()
Get a copy of this RankDataBuffer.
Definition parameter_objects.hpp:461
int rank_signed() const
Returns the rank as int.
Definition parameter_objects.hpp:454
RankDataBuffer(int rank)
Constructor for Rank.
Definition parameter_objects.hpp:400
RankDataBuffer< rank_type, parameter_type > clone()
Get a copy of this RankDataBuffer.
Definition parameter_objects.hpp:411
int rank_signed() const
Returns the rank as int.
Definition parameter_objects.hpp:404
RankDataBuffer(size_t rank)
Constructor for Rank.
Definition parameter_objects.hpp:396
Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like M...
Definition parameter_objects.hpp:358
TagParam< tag_type > clone()
Get a copy of this TagParam.
Definition parameter_objects.hpp:553
int tag() const
Definition parameter_objects.hpp:546
TagParam(int tag)
Definition parameter_objects.hpp:520
int tag() const
Definition parameter_objects.hpp:524
TagParam< tag_type > clone()
Get a copy of this TagParam.
Definition parameter_objects.hpp:531
Encapsulates a message tag.
Definition parameter_objects.hpp:513
BufferResizePolicy
Enum to specify in which cases a buffer is resized.
Definition data_buffer.hpp:291
constexpr BufferResizePolicy no_resize
Definition data_buffer.hpp:299
@ no_resize
Policy indicating that the underlying buffer shall never be resized.
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 To asserting_cast(From value) KAMPING_NOEXCEPT
Casts an integer value to the integer type To. If the value is outside To's range,...
Definition checking_casts.hpp:116
@ send_mode
Tag used to represent the send mode used by a send operation.
@ status
Tag used to represent the status in a MPI call.
@ tag
Tag used to represent the message tag in a MPI call.
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
TagType
Possible types of tag.
Definition parameter_objects.hpp:505
@ any
special value MPI_ANY_TAG}
@ value
holds an actual value
auto make_empty_data_buffer_builder()
Factory method for constructing an DataBufferBuilder for an EmptyDataBuffer.
Definition parameter_objects.hpp:313
RankType
Indicator if a rank parameter holds and actual value or MPI_ANY_SOURCE or MPI_PROC_NULL.
Definition parameter_objects.hpp:339
@ any
holds MPI_ANY_SOURCE
@ null
holds MPI_PROC_NULL
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
BufferType
Enum to specify whether a buffer is an in buffer of an out buffer. Out buffer will be used to directl...
Definition data_buffer.hpp:287
static MPI_Status * status_param_to_native_ptr(StatusParam &param)
returns a pointer to the MPI_Status encapsulated by the provided status parameter object.
Definition parameter_objects.hpp:489
STL namespace.
static constexpr internal::buffered_mode_t buffered
global constant for buffered send mode
Definition parameter_objects.hpp:563
static constexpr internal::any_tag_t any
global constant for any tag
Definition parameter_objects.hpp:573
static constexpr internal::synchronous_mode_t synchronous
global constant for synchronous send mode
Definition parameter_objects.hpp:564
static constexpr internal::rank_null_t null
global constant for rank NULL
Definition parameter_objects.hpp:578
static constexpr internal::standard_mode_t standard
global constant for standard send mode
Definition parameter_objects.hpp:562
constexpr internal::ignore_t< T > ignore
Tag for parameters that can be omitted on some PEs (e.g., root PE, or non-root PEs).
Definition parameter_objects.hpp:570
static constexpr internal::ready_mode_t ready
global constant for ready send mode
Definition parameter_objects.hpp:565
Parameter object representing a data buffer to be allocated by KaMPIng. This is a specialization of D...
Definition parameter_objects.hpp:136
auto construct_buffer_or_rebind()
Constructs the data buffer.
Definition parameter_objects.hpp:162
size_t size() const
The size of the underlying container.
Definition parameter_objects.hpp:207
static constexpr bool is_owning
Indicates whether the buffer owns its underlying storage.
Definition parameter_objects.hpp:198
static constexpr ParameterType parameter_type
The parameter type.
Definition parameter_objects.hpp:137
static constexpr bool is_out_buffer
Definition parameter_objects.hpp:195
decltype(make_data_buffer< ParameterType, parameter_type, modifiability, buffer_type, buffer_resize_policy, ValueType >( std::conditional_t< is_alloc_container_of_v< AllocType >, AllocNewT< std::vector< ValueType > >, AllocType >{})) DataBufferType
The type of the constructed data buffer (potentially rebinded to std::vector).
Definition parameter_objects.hpp:139
static constexpr bool is_lib_allocated
Indicates whether the buffer is allocated by KaMPIng.
Definition parameter_objects.hpp:200
typename DataBufferType::value_type value_type
The constructed data buffer's value type.
Definition parameter_objects.hpp:204
static constexpr bool is_single_element
Indicated whether the buffer is a single element buffer.
Definition parameter_objects.hpp:202
Parameter object representing a data buffer. This is an intermediate object which only holds the data...
Definition parameter_objects.hpp:53
static constexpr ParameterType parameter_type
The parameter type.
Definition parameter_objects.hpp:54
DataBufferBuilder(Data_ &&data)
Constructor for DataBufferBuilder.
Definition parameter_objects.hpp:60
size_t size() const
The size of the underlying container.
Definition parameter_objects.hpp:111
static constexpr bool is_owning
Indicates whether the buffer owns its underlying storage.
Definition parameter_objects.hpp:102
static constexpr bool is_lib_allocated
Indicates whether the buffer is allocated by KaMPIng.
Definition parameter_objects.hpp:104
typename DataBufferType::value_type value_type
The constructed data buffer's value type.
Definition parameter_objects.hpp:108
static constexpr bool is_out_buffer
Definition parameter_objects.hpp:99
static constexpr bool is_single_element
Indicated whether the buffer is a single element buffer.
Definition parameter_objects.hpp:106
decltype(make_data_buffer< ParameterType, parameter_type, modifiability, buffer_type, buffer_resize_policy, ValueType >(std::forward< Data >(data_))) DataBufferType
The type of the constructed data buffer.
Definition parameter_objects.hpp:66
auto construct_buffer_or_rebind()
Constructs the data buffer.
Definition parameter_objects.hpp:80
Parameter object for send_mode encapsulating the send mode compile-time tag.
Definition parameter_objects.hpp:478
static constexpr ParameterType parameter_type
The parameter type.
Definition parameter_objects.hpp:480
Dummy template for representing the absence of a container to rebind to.
Definition parameter_objects.hpp:35
tag struct for message tag
Definition parameter_objects.hpp:502
tag for buffered send mode
Definition parameter_objects.hpp:469
tag type to indicate that the value_type should be inferred from the container
Definition data_buffer.hpp:320
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
tag for ready send mode
Definition parameter_objects.hpp:471
tag for standard send mode
Definition parameter_objects.hpp:468
tag for synchronous send mode
Definition parameter_objects.hpp:470
Helper type for representing a type list.
Definition parameter_objects.hpp:326
static constexpr bool contains
Member attribute to check if a type is contained in the list.
Definition parameter_objects.hpp:330