KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
kamping::internal Namespace Reference

Internal namespace marking the code that is not user-facing. More...

Classes

struct  all_unique
 Base wrapper (std::integral_constant) to test if all types of a tuple are unique. More...
 
struct  all_unique< std::tuple< T, Ts... > >
 Recursive wrapper (std::integral_constant) to test if all types of a tuple are unique. This is done by checking for each type whether the type occurs in the types of the tuple to the right. If this is true for any type/position, the types in the tuple are not unique. More...
 
struct  AllocNewDataBufferBuilder
 Parameter object representing a data buffer to be allocated by KaMPIng. This is a specialization of DataBufferBuilder for buffer allocation tags, such as alloc_new, alloc_new_using and alloc_container_of. This is an intermediate object not holding any data. The actual buffer is constructed by calling the construct_buffer_or_rebind() method. More...
 
struct  any_tag_t
 tag struct for message tag More...
 
struct  buffered_mode_t
 tag for buffered send mode More...
 
struct  CallableWrapper
 A wrapper around a functor F that makes it callable using the call method. More...
 
class  CopyMoveEnabler
 Class optionally containing a copy constructor while supporting move assignment/construction. More...
 
class  CopyMoveEnabler< true >
 Specialisation of ParameterObjectBase which possesses a copy constructor. More...
 
class  DataBuffer
 Data buffer used for named parameters. More...
 
struct  DataBufferBuilder
 Parameter object representing a data buffer. This is an intermediate object which only holds the data and parameters. The actual buffer is created by calling the construct_buffer_or_rebind() method. More...
 
struct  default_value_type_tag
 tag type to indicate that the value_type should be inferred from the container More...
 
struct  DiscardSerializationBuffers
 Predicate to check whether a buffer provided to make_mpi_result() shall be discard or returned in the result object, including a hotfix for serialization. More...
 
class  EmptyDataBuffer
 Empty buffer that can be used as default argument for optional buffer parameters. More...
 
class  Extractable
 Base class containing logic to verify whether a buffer's data has already been extracted. This only has effects if an appropiate assertion level is set. More...
 
struct  FilterOut
 Base template used to filter a list of types and only keep those whose types meet specified criteria. See the following specialisations for more information. More...
 
struct  FilterOut< Predicate >
 Specialisation of template class used to filter a list of types and only keep the those whose types meet the specified criteria. More...
 
struct  FilterOut< Predicate, Head, Tail... >
 Specialization of template class used to filter a list of (buffer-)types and discard those for which The template is recursively instantiated to check one type after the other and "insert" it into a std::tuple if it meets the criteria . based on https://stackoverflow.com/a/18366475. More...
 
struct  FilterOut< Predicate, std::tuple< Types... > >
 Specialisation of template class for types stored in a std::tuple<...> that is used to filter these types and only keep those which meet certain criteria (see above). More...
 
struct  FlatContainer
 Maps a container to is underlying nested container. More...
 
struct  FlatContainer< T, std::enable_if_t< is_nested_send_buffer_v< T > > >
 Maps a container to is underlying nested container. More...
 
struct  FlatContainer< T, std::enable_if_t< is_sparse_send_buffer_v< T > > >
 Maps a container to is underlying nested container. More...
 
class  GenericDataBuffer
 A more generic version of a DataBuffer which stores an object of type. More...
 
struct  has_data_member
 Helper to decide if data type has .data() method. More...
 
struct  has_data_member< T, std::void_t< decltype(std::declval< T >().data())> >
 Helper to decide if data type has .data() method. More...
 
struct  has_no_unused_parameters
 Struct wrapping a check that verifies that no unused parameters are part of the arguments. More...
 
struct  has_parameter_helper
 Helper struct needed to retrieve the types stored in a std::tuple for the has_parameter_type check. More...
 
struct  ignore_t
 Tag type for parameters that can be omitted on some PEs (e.g., root PE, or non-root PEs). More...
 
struct  is_specialization
 Type trait to check if a type is an instance of a templated type. More...
 
struct  is_specialization< Template< Args... >, Template >
 Type trait to check if a type is an instance of a templated type. More...
 
struct  is_std_array
 Helper to check if a type is a std::array. More...
 
struct  is_std_array< std::array< T, N > >
 Helper to check if a type is a std::array. More...
 
struct  is_std_pair
 Helper to check if a type is a std::pair. More...
 
struct  is_std_pair< std::pair< T1, T2 > >
 Helper to check if a type is a std::pair. More...
 
struct  is_std_tuple
 Helper to check if a type is a std::tuple. More...
 
struct  is_std_tuple< std::tuple< Ts... > >
 Helper to check if a type is a std::tuple. More...
 
struct  logical_xor_impl
 Wrapper struct for logical xor, as the standard library does not provided a function object for it. More...
 
struct  logical_xor_impl< void >
 Template specialization for kamping::internal::logical_xor_impl without type parameter, which leaves to operand type to be deduced. The actual implementation is used in case that the operation is a builtin operation for the given datatype. More...
 
struct  max_impl
 Wrapper struct for std::max. More...
 
struct  max_impl< void >
 Template specialization for kamping::internal::max_impl without type parameter, which leaves the operand type to be deduced. More...
 
struct  min_impl
 Wrapper struct for std::min. More...
 
struct  min_impl< void >
 Template specialization for kamping::internal::min_impl without type parameter, which leaves the operand type to be deduced. The actual implementation is used in case that the operation is a builtin operation for the given datatype. More...
 
struct  mpi_operation_traits
 Type trait for checking whether a functor is a builtin MPI reduction operation and query corresponding MPI_Op. More...
 
class  OperationBuilder
 Parameter wrapping an operation passed to reduce-like MPI collectives. This wraps an MPI operation without the argument of the operation specified. This enables the user to construct such wrapper using the parameter factory kamping::op without passing the type of the operation. The library developer may then construct the actual operation wrapper with a given type later. More...
 
struct  parameter_type_to_integral_constant
 Wrapper to get an std::integral_constant for a kamping::internal::ParameterType. More...
 
struct  parameter_types_to_integral_constants
 Wrapper to get a tuple of std::integral_constant for each kamping::internal::ParameterType passed as template parameter that are extracted as tuple of std::integral_constant. More...
 
struct  parameters_to_integral_constant
 Wrapper to get a tuple of std::integral_constant for each kamping::internal::ParameterType of the parameters. More...
 
struct  ParameterTypeEntry
 Wrapper class to store an enum entry (kamping::internal::ParameterType) in a separate type (so that it can be used in a compile time list) More...
 
struct  ParameterTypeUnwrapping
 Trait struct used to determine the underlying type and value of the parameter type of an object with a parameter type. (This is a building block to enable plugins to have their own named parameters). More...
 
struct  ParameterTypeUnwrapping< std::integral_constant< T, v > >
 Trait struct used to determine the underlying type and value of the parameter type of an std::integral_constant wrapping a parameter type. (This is a building block to enable plugins to have their own named parameters). More...
 
struct  PredicateForResultObject
 Predicate to check whether a buffer provided to make_mpi_result() shall be discard or returned in the result object. More...
 
struct  PrependParameterType
 Template class to prepend the ParameterTypeEntry<ParameterType::ptype> type to a given std::tuple. More...
 
struct  PrependType
 Base template used to concatenate a type to a given std::tuple. based on https://stackoverflow.com/a/18366475. More...
 
struct  PrependType< Head, std::tuple< Tail... > >
 Specialization of a class template used to preprend a type to a given std::tuple. More...
 
struct  rank_any_t
 tag struct for MPI_ANY_SOURCE More...
 
struct  rank_null_t
 tag struct for MPI_PROC_NULL More...
 
class  RankDataBuffer
 Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like MPI_Gather. More...
 
class  RankDataBuffer< RankType::any, type >
 Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like MPI_Gather. More...
 
class  RankDataBuffer< RankType::null, type >
 Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like MPI_Gather. More...
 
class  RankDataBuffer< RankType::value, type >
 Encapsulates the rank of a PE. This is needed for p2p communication and rooted MPI collectives like MPI_Gather. More...
 
struct  ready_mode_t
 tag for ready send mode More...
 
class  ReduceOperation
 Wraps an operation and translates it to a builtin MPI_Op or constructs a custom operation. More...
 
struct  ResultCategoryNotUsed
 Use this type if one of the template parameters of MPIResult is not used for a specific wrapped MPI call. More...
 
struct  SendModeParameter
 Parameter object for send_mode encapsulating the send mode compile-time tag. More...
 
struct  serialization_support_tag
 Tag type to identify serialization support. More...
 
struct  standard_mode_t
 tag for standard send mode More...
 
struct  synchronous_mode_t
 tag for synchronous send mode More...
 
class  TagParam
 Encapsulates a message tag. More...
 
class  TagParam< TagType::any >
 Encapsulates a message tag. Specialization if the value is MPI_ANY_TAG. More...
 
class  TagParam< TagType::value >
 Encapsulates a message tag. Specialization if an explicit tag value is provided. More...
 
struct  type_list
 Helper type for representing a type list. More...
 
struct  unused_tparam
 An unused template parameter. More...
 
struct  UnusedRebindContainer
 Dummy template for representing the absence of a container to rebind to. More...
 
class  UserOperationPtrWrapper
 Wrapper for a user defined reduction operation based on a function pointer. More...
 
class  UserOperationWrapper
 Wrapper for a user defined reduction operation based on a functor object. More...
 
class  ValueTypeWrapper
 Wrapper to get the value type of a non-container type (aka the type itself). More...
 
class  ValueTypeWrapper< true, T >
 Wrapper to get the value type of a container type. More...
 

Typedefs

template<typename T >
using remove_rvalue_reference_t = std::conditional_t<std::is_rvalue_reference_v<T>, std::remove_reference_t<T>, T>
 If the given type T is an rvalue reference,i.e. T = U&&, the type alias refers to U. Otherwise the type alias refers to T (which possibly can be an lvalue reference).
 
using mpi_custom_operation_type = void (*)(void*, void*, int*, MPI_Datatype*)
 type used by user-defined operations passed to MPI_Op_create
 
template<typename Arg >
using parameter_type_t = typename ParameterTypeUnwrapping<Arg>::type
 Trait for the underlying type of the parameter type of.
 
template<ParameterType parameter_type, typename... Args>
using buffer_type_with_requested_parameter_type
 Type of Buffer with requested.
 
using RootDataBuffer = RankDataBuffer<RankType::value, ParameterType::root>
 Helper for roots;.
 
using send_mode_list
 list of all available send modes
 
using parameter_types_to_ignore_for_result_object
 List of parameter type (entries) which should not be included in the result object.
 

Enumerations

enum class  BufferModifiability { modifiable , constant }
 Enum to specify whether a buffer is modifiable.
 
enum class  BufferOwnership { owning , referencing }
 Enum to specify whether a buffer owns its data.
 
enum class  BufferAllocation { lib_allocated , user_allocated }
 Enum to specify whether a buffer is allocated by the library or the user.
 
enum class  BufferType { in_buffer , out_buffer , in_out_buffer , ignore }
 Enum to specify whether a buffer is an in buffer of an out buffer. Out buffer will be used to directly write the result to.
 
enum class  ParameterType {
  ParameterType::send_buf , ParameterType::recv_buf , ParameterType::send_recv_buf , ParameterType::recv_counts ,
  ParameterType::recv_count , ParameterType::recv_displs , ParameterType::send_counts , ParameterType::send_count ,
  ParameterType::send_displs , ParameterType::send_recv_count , ParameterType::op , ParameterType::source ,
  ParameterType::destination , ParameterType::status , ParameterType::statuses , ParameterType::request ,
  ParameterType::root , ParameterType::tag , ParameterType::send_mode , ParameterType::values_on_rank_0 ,
  ParameterType::send_type , ParameterType::recv_type , ParameterType::send_recv_type
}
 Each input parameter to one of the MPI calls wrapped by KaMPIng needs to has one of the following tags. More...
 
enum class  RankType { value , any , null }
 Indicator if a rank parameter holds and actual value or MPI_ANY_SOURCE or MPI_PROC_NULL. More...
 
enum class  TagType { value , any }
 Possible types of tag. More...
 

Functions

template<typename RecvCounts , typename RecvDispls >
size_t compute_required_recv_buf_size_in_vectorized_communication (RecvCounts const &recv_counts, RecvDispls const &recv_displs, size_t comm_size)
 Compute the required size of the recv buffer in vectorized communication (i.e. MPI operation that take a receive displacements). If recv displs are provided by the user the required size is the sum of the last entries of the recv_counts and the recv_displs buffers. Otherwise we have to compute the elementwise maximum of both buffers to obtain a minimum required recv buf size.
 
template<typename send_value_type , typename recv_value_type , typename recv_buf , typename... Args>
constexpr auto determine_mpi_datatypes (Args &... args)
 Deduce the MPI_Datatype to use on the send and recv side. If kamping::send_type() is given, the MPI_Datatype wrapped inside will be used as send_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.
 
template<typename send_or_send_recv_value_type , typename recv_or_send_recv_buf , typename... Args>
constexpr auto determine_mpi_send_recv_datatype (Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::send_recv_type, decltype(kamping::send_recv_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
 Deduce the MPI_Datatype to use as send_recv_type in a collective operation which accepts only one parameter of MPI_Datatype instead of (possibly) distinct send and recv types. If kamping::send_recv_type() is given, the MPI_Datatype wrapped inside will be used as send_recv_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.
 
template<typename TParameterType , TParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto make_data_buffer (Data &&data)
 Creates a user allocated DataBuffer containing the supplied data (a container or a single element)
 
template<typename TParameterType , TParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto make_data_buffer (AllocNewT< Data >)
 Creates a library allocated DataBuffer with the given container or single data type.
 
template<typename TParameterType , ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, template< typename... > typename Data>
auto make_data_buffer (AllocNewUsingT< Data >)
 Creates a library allocated DataBuffer by instantiating the given container template with the given value type.
 
template<typename NeighborhoodRange >
constexpr bool are_neighborhoods_weighted ()
 Returns whether a given range of neighbors is weighted or not at compile time, i.e., whether the neighborhood only consists of ranks or of (rank, weight) pairs.
 
template<typename RankDataBufferClass , typename Comm >
constexpr bool is_valid_rank_in_comm (RankDataBufferClass const &rank_data_buffer, Comm const &comm, bool const allow_null=false, bool const allow_any=false)
 Checks whether a RankDataBuffer contains a valid rank in the given communicator.
 
template<typename T , typename F , size_t... Is>
void for_each_tuple_field (T &&t, F &&f, std::index_sequence< Is... >)
 Applies functor f to each field of the tuple with an index in index sequence Is.
 
template<typename T , typename F >
void for_each_tuple_field (T &t, F &&f)
 Applies functor f to each field of the tuple t.
 
template<typename T , typename F >
void for_each_field (T &t, F &&f)
 Applies functor f to each field of the tuple-like type t. This works for std::pair and std::tuple. If KaMPIng's reflection support is enabled, this also works with types that are reflectable with pfr.
 
template<typename Functor >
auto with_operation_functor (MPI_Op op, Functor &&func)
 Helper function that maps an MPI_Op to the matching functor from kamping::ops. In case no function maps, the functor is called with kamping::ops::null<>{}.
 
template<internal::ParameterType ptype, typename... Buffers>
autoretrieve_buffer (std::tuple< Buffers... > &buffers)
 Retrieve the buffer with requested ParameterType from the std::tuple containg all buffers.
 
template<typename ParameterTypeTuple , typename... Buffers, std::size_t... i>
auto construct_buffer_tuple_impl (std::tuple< Buffers... > &buffers, std::index_sequence< i... >)
 Construct tuple containing all buffers specified in.
 
template<typename ParameterTypeTuple , typename... Buffers>
auto construct_buffer_tuple (Buffers &&... buffers)
 Construct tuple containing all buffers specified in.
 
template<typename T , typename U >
constexpr bool has_same_parameter_type ()
 Check whether two objects have the same parameter type.
 
template<typename ParameterTypeConstant , size_t Index>
constexpr size_t find_pos ()
 Base case if there are no parameters: always returns max index indicating that the parameter was not found.
 
template<typename ParameterTypeConstant , size_t Index, typename Arg >
constexpr size_t find_pos ()
 Returns the Index parameter if the parameter type of Arg matches the requested parameter type. If not, this fails to compile.
 
template<typename ParameterTypeConstant , size_t Index, typename Arg , typename Arg2 , typename... Args>
constexpr size_t find_pos ()
 Returns position of first argument in Args with Trait trait.
 
template<typename ParameterTypeConstant , typename... Args>
autoselect_parameter_type (Args &... args)
 Returns parameter with requested parameter type.
 
template<ParameterType parameter_type, typename... Args>
autoselect_parameter_type_in_tuple (std::tuple< Args... > &tuple)
 Returns parameter with requested parameter type.
 
template<ParameterType parameter_type, typename... Args>
auto constselect_parameter_type_in_tuple (std::tuple< Args... > const &tuple)
 Returns parameter with requested parameter type.
 
template<typename ParameterTypeConstant , typename... Args>
constexpr bool has_parameter_type ()
 Checks if parameter with requested parameter type exists.
 
template<ParameterType parameter_type, typename... Args>
constexpr bool has_parameter_type_in_tuple_impl (has_parameter_helper< std::tuple< Args... > >)
 Checks if parameter with requested parameter type exists. Wrapper using the functionality from kamping::internal::has_parameter_type() disassembling a std::tuple passed as parameter.
 
template<ParameterType parameter_type, typename Tuple >
constexpr bool has_parameter_type_in_tuple ()
 Checks if parameter with requested parameter type exists.
 
template<typename ParameterTypeConstant , typename DefaultParameterType , typename... DefaultArguments, typename... Args>
decltype(autoselect_parameter_type_or_default (std::tuple< DefaultArguments... > default_arguments, Args &... args)
 Checks if parameter with requested parameter type exists, if not constructs a default value.
 
template<typename send_value_type , typename... Args>
constexpr auto determine_mpi_send_datatype (Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::send_type, decltype(kamping::send_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
 Deduce the MPI_Datatype to use as send_type in a p2p send operation.If kamping::send_type() is given, the MPI_Datatype wrapped inside will be used as send_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.
 
template<typename recv_value_type , typename recv_buf , typename... Args>
constexpr auto determine_mpi_recv_datatype (Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::recv_type, decltype(kamping::recv_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
 Deduce the MPI_Datatype to use as recv_type in a p2p recv operation.If kamping::recv_type() is given, the MPI_Datatype wrapped inside will be used as recv_type. Otherwise, the MPI_datatype is derived automatically based on recv_buf's underlying value_type.
 
template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto make_data_buffer_builder (Data &&data)
 Factory method for constructing a DataBufferBuilder from the given Container Data.
 
template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename Data >
auto make_data_buffer_builder (std::initializer_list< Data > data)
 Factory method for constructing a DataBufferBuilder from an std::initializer_list.
 
template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto make_data_buffer_builder (AllocNewT< Data >)
 Factory method for constructing an AllocNewDataBufferBuilder for alloc_new.
 
template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, template< typename... > typename Container>
auto make_data_buffer_builder (AllocNewUsingT< Container >)
 Factory method for constructing an AllocNewDataBufferBuilder for alloc_new_using.
 
template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType >
auto make_data_buffer_builder (AllocContainerOfT< ValueType >)
 Factory method for constructing an AllocNewDataBufferBuilder for alloc_container_of.
 
template<typename ValueType , ParameterType parameter_type, BufferType buffer_type>
auto make_empty_data_buffer_builder ()
 Factory method for constructing an DataBufferBuilder for an EmptyDataBuffer.
 
template<typename StatusParam >
static MPI_Statusstatus_param_to_native_ptr (StatusParam &param)
 returns a pointer to the MPI_Status encapsulated by the provided status parameter object.
 
template<typename CallerProvidedOwningOutBuffers >
constexpr bool return_recv_or_send_recv_buffer_only ()
 Determines whether only the recv (send_recv) buffer or multiple different buffers will be returned.
 
template<typename... Buffers>
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 and returns the found parameter type. Note that we require that either a recv_buf or a send_recv_buf is present.
 
template<typename... Buffers>
constexpr bool has_recv_or_send_recv_buf ()
 Returns True iff only a recv or send_recv buffer is present. Communicator::ibarrier()).
 
template<typename CallerProvidedOwningOutBuffers , typename... Buffers>
constexpr bool return_send_buf_out_only ()
 Determines whether only the send buffer should be returned. This may happen if ownership of the send buffer is transfered to the call.
 
template<typename CallerProvidedArgs , typename... Buffers>
auto make_mpi_result (Buffers &&... buffers)
 Construct result object for a wrapped MPI call. Four different cases are handled: a) The recv_buffer owns its underlying data (i.e. the received data has to be returned via the result object):
 
template<typename CallerProvidedArgs , typename... Buffers>
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 inside a std::tuple. See make_mpi_result() for more details.
 
template<typename... Buffers>
auto move_buffer_to_heap (Buffers &&... buffers)
 Moves given buffers into a std::tuple wrapped with an std::unique_ptr on the heap.
 
template<typename CallerProvidedArgsInTuple , typename RequestDataBuffer , typename... Buffers>
auto make_nonblocking_result (RequestDataBuffer &&request, std::unique_ptr< std::tuple< Buffers... > > buffers_on_heap)
 Factory for creating a kamping::NonBlockingResult.
 
template<typename RequestDataBuffer >
auto make_nonblocking_result (RequestDataBuffer &&request)
 Factory for creating a kamping::NonBlockingResult.
 
template<bool serialization_used, typename BufferType >
auto deserialization_repack (BufferType buffer)
 If serialization_used is true, this takes a received serialization buffer, deserializes the data and repacks it into a new buffer only containing the deserialized data If serialization_used is false, the input buffer is returned unchanged.
 
template<typename T >
constexpr T * to_address (T *p) noexcept
 Obtain the address represented by p. Modelled after C++20's std::to_address. See https://en.cppreference.com/w/cpp/memory/to_address for details.
 
template<typename T >
constexpr auto to_address (T const &p) noexcept
 Obtain the address represented by p. Modelled after C++20's std::to_address. See https://en.cppreference.com/w/cpp/memory/to_address for details.
 
template<typename F >
auto make_callable_wrapper (F f)
 A factory function for CallableWrapper.
 

Variables

template<typename , typename = void>
static constexpr bool has_value_type_v = false
 Boolean value helping to decide if type has a value_type member type.
 
template<typename T , typename = void>
static constexpr bool is_vector_bool_v = false
 Boolean value helping to check if a type is an instance of std::vector<bool>.
 
template<typename T >
constexpr bool has_data_member_v = has_data_member<T>::value
 Boolean value helping to decide if data type has .data() method.
 
template<BufferOwnership ownership>
constexpr bool enable_copy_construction_v = (ownership == BufferOwnership::referencing)
 Check whether copy construction is allowed for the given ownership.
 
template<typename MemberType >
constexpr BufferResizePolicy maximum_viable_resize_policy
 for a given
 
template<typename T >
constexpr bool is_empty_data_buffer_v = false
 Helper to decide if a type is an instance of EmptyDataBuffer.
 
template<typename T , ParameterType type, BufferType buffer_type_param>
constexpr bool is_empty_data_buffer_v< EmptyDataBuffer< T, type, buffer_type_param > > = true
 Helper to decide if a type is an instance of EmptyDataBuffer.
 
std::vector< MPI_Datatyperegistered_mpi_types
 A global list of MPI data types registered to KaMPIng.
 
template<typename T >
constexpr size_t tuple_size
 The number of elements in a tuple-like type. This works for std::pair and std::tuple. If KaMPIng's reflection support is enabled, this also works with types that are reflectable with pfr.
 
template<typename Tuple >
static constexpr bool all_unique_v = all_unique<Tuple>::value
 true if and only if all types of the tuple are unique.
 
template<ParameterType parameter_type, typename... Args>
static constexpr bool is_parameter_given_as_in_buffer
 Checks if a data buffer with requested parameter type exists and it is an input parameter (i.e. its content does not have to be computed/deduced by KaMPIng).
 
template<typename BufferType >
static constexpr bool has_to_be_computed
 Checks if the buffer has to be computed by kamping, i.e. if it is an output parameter or the buffer has been allocated by KaMPIng.
 
template<typename... BufferTypes>
static constexpr bool all_have_to_be_computed = (has_to_be_computed<BufferTypes> && ...)
 Checks if all buffers have to be computed by kamping, i.e., if all buffers are output parameters of the buffers have been allocated by kamping.
 
template<typename... BufferTypes>
static constexpr bool any_has_to_be_computed = (has_to_be_computed<BufferTypes> || ...)
 Checks if any of the buffers have to be computed by kamping, i.e., if at least one buffer is an output parameter or has been allocated by kamping.
 
template<typename DataBufferType >
static constexpr bool buffer_uses_serialization
 Checks if DataBufferType is a serialization buffer.
 
template<typename Arg >
constexpr parameter_type_t< Argparameter_type_v = ParameterTypeUnwrapping<Arg>::value
 Trait for the underlying value of the parameter type of.
 
template<typename T >
constexpr bool has_extract_v = has_member_extract_v<T>
 has_extract_v is true iff type T has a member function extract().
 
template<typename Buffer >
constexpr bool is_extractable = Buffer::is_owning&& Buffer::is_out_buffer
 Helper for implementing the extract_* functions in MPIResult. Is true if the passed buffer type owns its underlying storage and is an output buffer.
 
template<typename , typename = void>
constexpr bool has_data_buffer_type_member = false
 Helper to check if a type T has a member type T::DataBufferType.
 
template<typename >
constexpr bool is_serialization_buffer_v_impl = false
 Type trait to check if a type is a serialization buffer.
 
template<typename T >
constexpr bool is_serialization_buffer_v
 Type trait to check if a type is a serialization buffer.
 

Detailed Description

Internal namespace marking the code that is not user-facing.

Typedef Documentation

◆ parameter_types_to_ignore_for_result_object

Initial value:
type_list<
ParameterTypeEntry<ParameterType::op>,
ParameterTypeEntry<ParameterType::source>,
ParameterTypeEntry<ParameterType::destination>,
ParameterTypeEntry<ParameterType::statuses>,
ParameterTypeEntry<ParameterType::request>,
ParameterTypeEntry<ParameterType::root>,
ParameterTypeEntry<ParameterType::tag>,
ParameterTypeEntry<ParameterType::send_mode>,
ParameterTypeEntry<ParameterType::values_on_rank_0>>

List of parameter type (entries) which should not be included in the result object.

◆ remove_rvalue_reference_t

template<typename T >
using kamping::internal::remove_rvalue_reference_t = std::conditional_t<std::is_rvalue_reference_v<T>, std::remove_reference_t<T>, T>

If the given type T is an rvalue reference,i.e. T = U&&, the type alias refers to U. Otherwise the type alias refers to T (which possibly can be an lvalue reference).

Template Parameters
TType for which a possible rvalue reference is removed.

◆ send_mode_list

Initial value:
type_list<standard_mode_t, buffered_mode_t, synchronous_mode_t, ready_mode_t>

list of all available send modes

Enumeration Type Documentation

◆ RankType

Indicator if a rank parameter holds and actual value or MPI_ANY_SOURCE or MPI_PROC_NULL.

Enumerator
value 

holds a value

any 

holds MPI_ANY_SOURCE

null 

holds MPI_PROC_NULL

◆ TagType

Possible types of tag.

Enumerator
value 

holds an actual value

any 

special value MPI_ANY_TAG}

Function Documentation

◆ are_neighborhoods_weighted()

constexpr bool kamping::internal::are_neighborhoods_weighted ( )
constexpr

Returns whether a given range of neighbors is weighted or not at compile time, i.e., whether the neighborhood only consists of ranks or of (rank, weight) pairs.

Template Parameters
NeighborhoodRangeRange type to be checked.

◆ compute_required_recv_buf_size_in_vectorized_communication()

size_t kamping::internal::compute_required_recv_buf_size_in_vectorized_communication ( RecvCounts const & recv_counts,
RecvDispls const & recv_displs,
size_t comm_size )

Compute the required size of the recv buffer in vectorized communication (i.e. MPI operation that take a receive displacements). If recv displs are provided by the user the required size is the sum of the last entries of the recv_counts and the recv_displs buffers. Otherwise we have to compute the elementwise maximum of both buffers to obtain a minimum required recv buf size.

Template Parameters
RecvCountsType of the recv counts buffer.
RecvDisplsType of the recv displs buffer.
Parameters
recv_countsRecv counts buffer.
recv_displsRecv displs buffer.
comm_sizeSize of the communicator.
Returns
Required size of the recv buffer.

◆ construct_buffer_tuple()

template<typename ParameterTypeTuple , typename... Buffers>
auto kamping::internal::construct_buffer_tuple ( Buffers &&... buffers)

Construct tuple containing all buffers specified in.

Template Parameters
ParamterTypeTuple.
ParameterTypeTupleTuple containing ParameterTypeEntries specifing the entries to be retrieved from the BufferTuple buffers.
BuffersTypes of the data buffers.
Parameters
buffersData buffers out of which the ones with parameter types contained in ParameterTypeTuple are retrieved.
Returns
std::tuple containing all requested data buffers.

◆ construct_buffer_tuple_impl()

template<typename ParameterTypeTuple , typename... Buffers, std::size_t... i>
auto kamping::internal::construct_buffer_tuple_impl ( std::tuple< Buffers... > & buffers,
std::index_sequence< i... >  )

Construct tuple containing all buffers specified in.

Template Parameters
ParamterTypeTuple.
ParameterTypeTupleTuple containing ParameterTypeEntries specifing the entries to be retrieved from the BufferTuple buffers.
BuffersTypes of the data buffers.
iInteger sequence.
Parameters
buffersData buffers out of which the ones with parameter types contained in ParameterTypeTuple are retrieved.
Returns
std::tuple containing all requested data buffers.

◆ determine_mpi_datatypes()

constexpr auto kamping::internal::determine_mpi_datatypes ( Args &... args)
constexpr

Deduce the MPI_Datatype to use on the send and recv side. If kamping::send_type() is given, the MPI_Datatype wrapped inside will be used as send_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.

If kamping::recv_type() is given, the MPI_Datatype wrapped inside will be used as recv_type. Otherwise, the MPI_datatype is derived automatically based on recv_buf's underlying value_type.

Template Parameters
send_value_typeValue type of the send buffer.
recv_value_typeValue type of the recv buffer.
recv_bufType of the recv buffer.
ArgsTypes of all arguments passed to the wrapped MPI call.
Parameters
argsAll arguments passed to a wrapped MPI call.
Returns
Return a tuple containing the MPI send_type wrapped in a DataBuffer, the MPI recv_type wrapped in a DataBuffer.

◆ determine_mpi_recv_datatype()

template<typename recv_value_type , typename recv_buf , typename... Args>
constexpr auto kamping::internal::determine_mpi_recv_datatype ( Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::recv_type, decltype(kamping::recv_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
constexpr

Deduce the MPI_Datatype to use as recv_type in a p2p recv operation.If kamping::recv_type() is given, the MPI_Datatype wrapped inside will be used as recv_type. Otherwise, the MPI_datatype is derived automatically based on recv_buf's underlying value_type.

Template Parameters
recv_value_typeValue type of the recv buffer.
recv_bufType of the recv buffer.
ArgsTypes of all arguments passed to the wrapped MPI call.
Parameters
argsAll arguments passed to a wrapped MPI call.
Returns
Return the MPI recv_type wrapped in a DataBuffer. This is either an lvalue reference to the recv_type DataBuffer if the recv_type is provided by the user or a newly created recv_type DataBuffer otherwise.

◆ determine_mpi_send_datatype()

template<typename send_value_type , typename... Args>
constexpr auto kamping::internal::determine_mpi_send_datatype ( Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::send_type, decltype(kamping::send_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
constexpr

Deduce the MPI_Datatype to use as send_type in a p2p send operation.If kamping::send_type() is given, the MPI_Datatype wrapped inside will be used as send_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.

Template Parameters
send_value_typeValue type of the send buffer.
ArgsTypes of all arguments passed to the wrapped MPI call.
Parameters
argsAll arguments passed to a wrapped MPI call.
Returns
Return the MPI send_type wrapped in a DataBuffer. This is either an lvalue reference to the send_type DataBuffer if the send_type is provided by the user or a newly created send_type DataBuffer otherwise.

◆ determine_mpi_send_recv_datatype()

constexpr auto kamping::internal::determine_mpi_send_recv_datatype ( Args &... args) -> decltype(internal::select_parameter_type_or_default< internal::ParameterType::send_recv_type, decltype(kamping::send_recv_type_out())>(std::make_tuple(), args...) .construct_buffer_or_rebind())
constexpr

Deduce the MPI_Datatype to use as send_recv_type in a collective operation which accepts only one parameter of MPI_Datatype instead of (possibly) distinct send and recv types. If kamping::send_recv_type() is given, the MPI_Datatype wrapped inside will be used as send_recv_type. Otherwise, the MPI_datatype is derived automatically based on send_buf's underlying value_type.

Template Parameters
send_or_send_recv_value_typeValue type of the send(_recv) buffer.
recv_bufValue type of the send buffer.
recv_or_send_recv_bufType of the (send_)recv buffer.
ArgsTypes of all arguments passed to the wrapped MPI call.
Parameters
argsAll arguments passed to a wrapped MPI call.
Returns
Return the MPI send_type wrapped in a DataBuffer. This is either an lvalue reference to the send_recv_type DataBuffer if the send_recv_type is provided by the user or a newly created send_recv_type DataBuffer otherwise.

◆ determine_recv_buffer_type()

template<typename... Buffers>
constexpr ParameterType kamping::internal::determine_recv_buffer_type ( )
constexpr

Checks whether a buffer with parameter type recv_buf or a buffer with type send_recv_buf is present and returns the found parameter type. Note that we require that either a recv_buf or a send_recv_buf is present.

Template Parameters
BuffersAll buffer types to be searched for type recv_buf or send_recv_buf.
Returns
The parameter type of the first buffer whose parameter type is recv_buf or send_recv_buf.

◆ for_each_field()

template<typename T , typename F >
void kamping::internal::for_each_field ( T & t,
F && f )

Applies functor f to each field of the tuple-like type t. This works for std::pair and std::tuple. If KaMPIng's reflection support is enabled, this also works with types that are reflectable with pfr.

f should be a callable that takes a reference to the field and its index.

◆ for_each_tuple_field() [1/2]

template<typename T , typename F , size_t... Is>
void kamping::internal::for_each_tuple_field ( T && t,
F && f,
std::index_sequence< Is... >  )

Applies functor f to each field of the tuple with an index in index sequence Is.

f should be a callable that takes a reference to the field and its index.

◆ for_each_tuple_field() [2/2]

template<typename T , typename F >
void kamping::internal::for_each_tuple_field ( T & t,
F && f )

Applies functor f to each field of the tuple t.

f should be a callable that takes a reference to the field and its index.

◆ has_recv_or_send_recv_buf()

template<typename... Buffers>
constexpr bool kamping::internal::has_recv_or_send_recv_buf ( )
constexpr

Returns True iff only a recv or send_recv buffer is present. Communicator::ibarrier()).

Template Parameters
BuffersAll buffer types to be searched for type status.

◆ is_valid_rank_in_comm()

constexpr bool kamping::internal::is_valid_rank_in_comm ( RankDataBufferClass const & rank_data_buffer,
Comm const & comm,
bool const allow_null = false,
bool const allow_any = false )
constexpr

Checks whether a RankDataBuffer contains a valid rank in the given communicator.

Can also be configured to accept RankType::null or RankType::any.

Parameters
rank_data_bufferThe RankDataBuffer encapsulating the rank to check.
commThe Communicator to check for validity in.
allow_nullWhether this function should return true for RankType::null.
allow_anyWhether this function should return true for RankType::any.
Template Parameters
RankDataBufferClassThe template instantiation of RankDataBuffer.
CommThe template instantiation of Communicator.

◆ make_data_buffer() [1/3]

template<typename TParameterType , TParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto kamping::internal::make_data_buffer ( AllocNewT< Data > )

Creates a library allocated DataBuffer with the given container or single data type.

Creates a library allocated DataBuffer with the given template parameters.

Template Parameters
TParameterTypetype of parameter type represented by this buffer.
parameter_typeparameter type represented by this buffer.
modifiabilitymodifiable if a KaMPIng operation is allowed to modify the underlying container. constant otherwise.
buffer_typeType of this buffer, i.e., in, out, or in_out.
buffer_resize_policyPolicy specifying whether (and if so, how) the underlying buffer shall be resized.
ValueTypeRequested value type for the the data buffer. If not specified, it will be deduced from the underlying container and no checking is performed.
DataContainer or data type on which this buffer is based.
Returns
A library allocated DataBuffer with the given template parameters.

◆ make_data_buffer() [2/3]

template<typename TParameterType , ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, template< typename... > typename Data>
auto kamping::internal::make_data_buffer ( AllocNewUsingT< Data > )

Creates a library allocated DataBuffer by instantiating the given container template with the given value type.

Template Parameters
TParameterTypetype of parameter type represented by this buffer.
parameter_typeparameter type represented by this buffer.
modifiabilitymodifiable if a KaMPIng operation is allowed to modify the underlying container. constant otherwise.
buffer_typeType of this buffer, i.e., in, out, or in_out.
buffer_resize_policyPolicy specifying whether (and if so, how) the underlying buffer shall be resized.
ValueTypeThe value type to initialize the Data template with. If not specified, this will fail.
DataContainer template this buffer is based on. The first template parameter is initialized with ValueType
Returns
A library allocated DataBuffer with the given template parameters.

◆ make_data_buffer() [3/3]

template<typename TParameterType , TParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto kamping::internal::make_data_buffer ( Data && data)

Creates a user allocated DataBuffer containing the supplied data (a container or a single element)

Creates a user allocated DataBuffer with the given template parameters and ownership based on whether an rvalue or lvalue reference is passed.

Template Parameters
TParameterTypetype of parameter type represented by this buffer.
parameter_typeparameter type represented by this buffer.
modifiabilitymodifiable if a KaMPIng operation is allowed to modify the underlying container. constant otherwise.
buffer_typeType of this buffer, i.e., in, out, or in_out.
DataContainer or data type on which this buffer is based.
buffer_resize_policyPolicy specifying whether (and if so, how) the underlying buffer shall be resized.
ValueTypeRequested value type for the the data buffer. If not specified, it will be deduced from the underlying container and no checking is performed.
Parameters
dataUniversal reference to a container or single element holding the data for the buffer.
Returns
A user allocated DataBuffer with the given template parameters and matching ownership.

◆ make_data_buffer_builder() [1/2]

template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename ValueType = default_value_type_tag, typename Data >
auto kamping::internal::make_data_buffer_builder ( Data && data)

Factory method for constructing a DataBufferBuilder from the given Container Data.

See also
DataBufferBuilder

◆ make_data_buffer_builder() [2/2]

template<ParameterType parameter_type, BufferModifiability modifiability, BufferType buffer_type, BufferResizePolicy buffer_resize_policy, typename Data >
auto kamping::internal::make_data_buffer_builder ( std::initializer_list< Data > data)

Factory method for constructing a DataBufferBuilder from an std::initializer_list.

See also
DataBufferBuilder

◆ make_empty_data_buffer_builder()

template<typename ValueType , ParameterType parameter_type, BufferType buffer_type>
auto kamping::internal::make_empty_data_buffer_builder ( )

Factory method for constructing an DataBufferBuilder for an EmptyDataBuffer.

See also
DataBufferBuilder

◆ make_mpi_result()

template<typename CallerProvidedArgs , typename... Buffers>
auto kamping::internal::make_mpi_result ( Buffers &&... buffers)

Construct result object for a wrapped MPI call. Four different cases are handled: a) The recv_buffer owns its underlying data (i.e. the received data has to be returned via the result object):

a.1) The recv_buffer is the only buffer to be returned, i.e. the only caller provided owning out buffer: In this case, the recv_buffers's underlying data is extracted and returned directly (by value).

a.2) There are multiple buffers to be returned and recv_buffer is explicitly provided by the caller: In this case a kamping::MPIResult object is created, which stores the buffers to return (owning out buffers) in a std::tuple respecting the order in which these buffers where provided to the wrapped MPI call. This enables unpacking the object via structured binding.

a.3) There are more data buffers to be returned and recv_buffer is not explicitly provided by the caller: In this case a kamping::MPIResult object is created, which stores the buffers to return. The recv_buffer is always the first entry in the result object followed by the other buffers respecting the order in which these buffers where provided to the wrapped MPI call.

b) There is no recv buffer (see Communicator::probe() for example) or the recv_buffer only references its underlying data (i.e. it is a non-owning out buffer): In this case recv_buffer is not part of the result object. The kamping::MPIResult object stores the buffer to return (owning buffers for which a *_out() named parameter was passed to the wrapped MPI call) in a std::tuple respecting the order in which these buffers where provided to the wrapped MPI call.

Template Parameters
CallerProvidedArgsTypes of arguments passed to the wrapped MPI call.
BuffersTypes of data buffers created/filled within the wrapped MPI call.
Parameters
buffersdata buffers created/filled within the wrapped MPI call.
Returns
result object as specified above.
See also
docs/parameter_handling.md

◆ make_mpi_result_from_tuple()

template<typename CallerProvidedArgs , typename... Buffers>
auto kamping::internal::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 inside a std::tuple. See make_mpi_result() for more details.

Template Parameters
CallerProvidedArgsTypes of arguments passed to the wrapped MPI call.
BuffersTypes of data buffers created/filled within the wrapped MPI call.
Parameters
buffersdata buffers created/filled within the wrapped MPI call bundled within a std::tuple.

◆ make_nonblocking_result() [1/2]

auto kamping::internal::make_nonblocking_result ( RequestDataBuffer && request)

Factory for creating a kamping::NonBlockingResult.

Makes an kamping::NonBlockingResult from all arguments passed and inserts internal::ResultCategoryNotUsed when no fitting parameter type is passed as argument.

Note that an argument of with type kamping::internal::ParameterType::request is required.

Template Parameters
RequestDataBufferContainer encapsulating the underlying request.
Parameters
requestRequest associated with the non-blocking MPI call.
Returns
kamping::NonBlockingResult encapsulating all passed parameters.

◆ make_nonblocking_result() [2/2]

template<typename CallerProvidedArgsInTuple , typename RequestDataBuffer , typename... Buffers>
auto kamping::internal::make_nonblocking_result ( RequestDataBuffer && request,
std::unique_ptr< std::tuple< Buffers... > > buffers_on_heap )

Factory for creating a kamping::NonBlockingResult.

Makes an kamping::NonBlockingResult from all arguments passed and inserts internal::ResultCategoryNotUsed when no fitting parameter type is passed as argument.

Note that an argument of with type kamping::internal::ParameterType::request is required.

Template Parameters
CallerProvidedArgsTypes of arguments passed to the wrapped MPI call.
RequestDataBufferContainer encapsulating the underlying request.
BuffersTypes of buffers associated with the underlying non-blocking MPI call.
Parameters
requestRequest associated with the non-blocking MPI call.
buffers_on_heapBuffers associated with the non-blocking MPI call stored in a tuple on the heap.
Returns
kamping::NonBlockingResult encapsulating all passed parameters.

◆ move_buffer_to_heap()

template<typename... Buffers>
auto kamping::internal::move_buffer_to_heap ( Buffers &&... buffers)

Moves given buffers into a std::tuple wrapped with an std::unique_ptr on the heap.

Template Parameters
Buffers...Types of the buffers to be moved to the heap.
Parameters
buffersBuffers to be moved to the heap.
Returns
std::unique_ptr wrapping a std::tuple containing the passed buffers.

◆ retrieve_buffer()

template<internal::ParameterType ptype, typename... Buffers>
auto & kamping::internal::retrieve_buffer ( std::tuple< Buffers... > & buffers)

Retrieve the buffer with requested ParameterType from the std::tuple containg all buffers.

Template Parameters
ptypeParameterType of the buffer to retrieve.
BuffersTypes of the data buffers.
Parameters
buffersData buffers out of which the one with requested parameter type is retrieved.
Returns
Reference to the buffer which the requested ParameterType.

◆ return_recv_or_send_recv_buffer_only()

constexpr bool kamping::internal::return_recv_or_send_recv_buffer_only ( )
constexpr

Determines whether only the recv (send_recv) buffer or multiple different buffers will be returned.

Template Parameters
CallerProvidedOwningOutBuffersAn std::tuple containing the types of the owning, out buffers explicitly requested by the caller of the wrapped MPI call.
Returns
True if the recv (send_recv) buffer is either not mentioned explicitly and no other (owning) out buffers are requested or the only explicitly requested owning out buffer is the recv_buf. False otherwise.

◆ status_param_to_native_ptr()

template<typename StatusParam >
static MPI_Status * kamping::internal::status_param_to_native_ptr ( StatusParam & param)
inlinestatic

returns a pointer to the MPI_Status encapsulated by the provided status parameter object.

Template Parameters
StatusParamThe type of the status parameter object.
Parameters
paramThe status parameter object.
Returns
A pointer to the encapsulated MPI_Status or MPI_STATUS_IGNORE.

◆ to_address() [1/2]

template<typename T >
constexpr T * kamping::internal::to_address ( T * p)
constexprnoexcept

Obtain the address represented by p. Modelled after C++20's std::to_address. See https://en.cppreference.com/w/cpp/memory/to_address for details.

Parameters
pa raw pointer
Template Parameters
theunderlying type

◆ to_address() [2/2]

template<typename T >
constexpr auto kamping::internal::to_address ( T const & p)
constexprnoexcept

Obtain the address represented by p. Modelled after C++20's std::to_address. See https://en.cppreference.com/w/cpp/memory/to_address for details.

Parameters
pa smart pointer
Template Parameters
thepointer type

◆ with_operation_functor()

template<typename Functor >
auto kamping::internal::with_operation_functor ( MPI_Op op,
Functor && func )

Helper function that maps an MPI_Op to the matching functor from kamping::ops. In case no function maps, the functor is called with kamping::ops::null<>{}.

Parameters
opThe operation.
funcThe lambda to be called with the functor matching the MPI_Op, e.g. in the case of MPI_SUM we call func(kamping::ops::plus<>{}).

Variable Documentation

◆ all_have_to_be_computed

template<typename... BufferTypes>
constexpr bool kamping::internal::all_have_to_be_computed = (has_to_be_computed<BufferTypes> && ...)
staticconstexpr

Checks if all buffers have to be computed by kamping, i.e., if all buffers are output parameters of the buffers have been allocated by kamping.

Template Parameters
BufferTypesAny number of buffers types to be checked.

◆ any_has_to_be_computed

template<typename... BufferTypes>
constexpr bool kamping::internal::any_has_to_be_computed = (has_to_be_computed<BufferTypes> || ...)
staticconstexpr

Checks if any of the buffers have to be computed by kamping, i.e., if at least one buffer is an output parameter or has been allocated by kamping.

Template Parameters
BufferTypesAny number of buffers to be checked.

◆ buffer_uses_serialization

template<typename DataBufferType >
constexpr bool kamping::internal::buffer_uses_serialization
staticconstexpr
Initial value:
= internal::is_serialization_buffer_v<
typename std::remove_const_t<std::remove_reference_t<DataBufferType>>::MemberTypeWithConstAndRef>

Checks if DataBufferType is a serialization buffer.

◆ has_data_member_v

template<typename T >
constexpr bool kamping::internal::has_data_member_v = has_data_member<T>::value
inlineconstexpr

Boolean value helping to decide if data type has .data() method.

Returns
true if class has .data() method and false otherwise.

◆ has_extract_v

template<typename T >
constexpr bool kamping::internal::has_extract_v = has_member_extract_v<T>
inlineconstexpr

has_extract_v is true iff type T has a member function extract().

Template Parameters
TType which is tested for the existence of a member function.

◆ has_to_be_computed

template<typename BufferType >
constexpr bool kamping::internal::has_to_be_computed
staticconstexpr
Initial value:
=
std::remove_reference_t<BufferType>::is_out_buffer || std::remove_reference_t<BufferType>::is_lib_allocated

Checks if the buffer has to be computed by kamping, i.e. if it is an output parameter or the buffer has been allocated by KaMPIng.

Template Parameters
BufferTypeThe buffer type to be checked

◆ has_value_type_v

template<typename , typename = void>
constexpr bool kamping::internal::has_value_type_v = false
staticconstexpr

Boolean value helping to decide if type has a value_type member type.

Returns
true if class has value_type method and false otherwise.

◆ is_parameter_given_as_in_buffer

template<ParameterType parameter_type, typename... Args>
constexpr bool kamping::internal::is_parameter_given_as_in_buffer
staticconstexpr
Initial value:
= []() {
constexpr size_t found_pos = find_pos<std::integral_constant<ParameterType, parameter_type>, 0, Args...>();
if constexpr (found_pos >= sizeof...(Args)) {
return false;
} else {
using FoundType = std::tuple_element_t<found_pos, std::tuple<Args...>>;
return !FoundType::is_out_buffer;
}
}()
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32

Checks if a data buffer with requested parameter type exists and it is an input parameter (i.e. its content does not have to be computed/deduced by KaMPIng).

Template Parameters
parameter_typeThe parameter type for which a parameter should be found.
ArgsAll parameter types to be searched.
Returns
true iff. Args contains a parameter of type parameter_type and this parameter is not an output buffer.

◆ is_serialization_buffer_v

template<typename T >
constexpr bool kamping::internal::is_serialization_buffer_v
constexpr
Initial value:
=
is_serialization_buffer_v_impl<std::remove_const_t<std::remove_reference_t<T>>>

Type trait to check if a type is a serialization buffer.

◆ is_vector_bool_v

template<typename T , typename = void>
constexpr bool kamping::internal::is_vector_bool_v = false
staticconstexpr

Boolean value helping to check if a type is an instance of std::vector<bool>.

Template Parameters
TThe type.
Returns
true if T is an template instance of std::vector<bool>, false otherwise.

◆ maximum_viable_resize_policy

template<typename MemberType >
constexpr BufferResizePolicy kamping::internal::maximum_viable_resize_policy
constexpr
Initial value:
= [] {
auto is_single_element = !has_data_member_v<MemberType>;
if (is_single_element || !has_member_resize_v<MemberType, size_t>) {
return no_resize;
} else {
return resize_to_fit;
}
}()
constexpr BufferResizePolicy resize_to_fit
Definition data_buffer.hpp:305
constexpr BufferResizePolicy no_resize
Definition data_buffer.hpp:299

for a given

Template Parameters
MemberTypeof a data buffer, defines the most viable resize policy.

For example, a single element buffer may not be resizable.

◆ tuple_size

template<typename T >
constexpr size_t kamping::internal::tuple_size
constexpr
Initial value:
= [] {
if constexpr (internal::is_std_pair<T>::value) {
return 2;
} else if constexpr (internal::is_std_tuple<T>::value) {
return std::tuple_size_v<T>;
} else {
if constexpr (std::is_arithmetic_v<T>) {
return 1;
} else {
return std::tuple_size_v<T>;
}
}
}()
Helper to check if a type is a std::tuple.
Definition mpi_datatype.hpp:53

The number of elements in a tuple-like type. This works for std::pair and std::tuple. If KaMPIng's reflection support is enabled, this also works with types that are reflectable with pfr.