KaMPIng 0.1.0
(Near) zero-overhead C++ MPI bindings.
Loading...
Searching...
No Matches
data_buffer.hpp File Reference
#include <cstddef>
#include <memory>
#include <type_traits>
#include <mpi.h>
#include "kamping/assertion_levels.hpp"
#include "kamping/checking_casts.hpp"
#include "kamping/has_member.hpp"
#include "kamping/kabool.hpp"
#include "kamping/named_parameter_types.hpp"
#include "kamping/span.hpp"
#include "kassert/kassert.hpp"

Go to the source code of this file.

Classes

class  kamping::internal::ParameterObjectBase
 Base object for parameter objects which deletes copy constructor and assignment operator and enables move. More...
 
struct  kamping::internal::is_specialization< T, Template >
 Type trait to check if a type is an instance of a templated type. More...
 
struct  kamping::internal::is_specialization< Template< Args... >, Template >
 Type trait to check if a type is an instance of a templated type. More...
 
struct  kamping::AllocNewT< Container >
 Buffer allocation tag used for indicating that a buffer should be allocated by KaMPIng. More...
 
struct  kamping::AllocNewUsingT< Container >
 Buffer allocation tag used for indicating that a buffer should be allocated by KaMPIng. More...
 
struct  kamping::AllocContainerOfT< T >
 Buffer allocation tag used for indicating that a buffer of type T should be allocated by KaMPIng. More...
 
struct  kamping::internal::has_data_member< typename, typename >
 Helper to decide if data type has .data() method. More...
 
struct  kamping::internal::has_data_member< T, std::void_t< decltype(std::declval< T >().data())> >
 Helper to decide if data type has .data() method. More...
 
class  kamping::internal::ValueTypeWrapper< has_value_type_member, T >
 Wrapper to get the value type of a non-container type (aka the type itself). More...
 
struct  kamping::internal::default_value_type_tag
 tag type to indicate that the value_type should be inferred from the container More...
 
class  kamping::internal::ValueTypeWrapper< true, T >
 Wrapper to get the value type of a container type. More...
 
class  kamping::internal::DataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param, buffer_resize_policy_param, allocation, ValueType >
 Data buffer used for named parameters. More...
 
class  kamping::internal::GenericDataBuffer< MemberType, TParameterType, parameter_type_param, modifiability, ownership, buffer_type_param >
 A more generic version of a DataBuffer which stores an object of type. More...
 
class  kamping::internal::EmptyDataBuffer< Data, type, buffer_type_param >
 Empty buffer that can be used as default argument for optional buffer parameters. More...
 

Namespaces

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

Enumerations

enum class  kamping::internal::BufferModifiability { modifiable , constant }
 Enum to specify whether a buffer is modifiable.
 
enum class  kamping::internal::BufferOwnership { owning , referencing }
 Enum to specify whether a buffer owns its data.
 
enum class  kamping::internal::BufferAllocation { lib_allocated , user_allocated }
 Enum to specify whether a buffer is allocated by the library or the user.
 
enum class  kamping::internal::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  kamping::BufferResizePolicy { BufferResizePolicy::no_resize , BufferResizePolicy::grow_only , BufferResizePolicy::resize_to_fit }
 Enum to specify in which cases a buffer is resized. More...
 

Functions

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)
 
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.
 
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.
 

Variables

template<typename , typename = void>
static constexpr bool kamping::internal::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 kamping::internal::is_vector_bool_v = false
 Boolean value helping to check if a type is an instance of std::vector<bool>.
 
template<typename Container >
static constexpr auto kamping::alloc_new = AllocNewT<Container>{}
 Convenience wrapper for creating library allocated containers. See AllocNewT for details.
 
template<typename T >
static constexpr bool kamping::is_alloc_new_v = false
 Helper to decide if an allocation tag is an AllocNewT.
 
template<typename T >
static constexpr bool kamping::is_alloc_new_v< AllocNewT< T > > = true
 Helper to decide if an allocation tag is an AllocNewT.
 
template<template< typename... > typename Container>
static constexpr auto kamping::alloc_new_using = AllocNewUsingT<Container>{}
 Convenience wrapper for creating library allocated containers. See AllocNewUsingT for details.
 
template<typename T >
static constexpr bool kamping::is_alloc_new_using_v = false
 Helper to decide if an allocation tag is an AllocNewUsingT.
 
template<template< typename... > typename Container>
static constexpr bool kamping::is_alloc_new_using_v< AllocNewUsingT< Container > > = true
 Helper to decide if an allocation tag is an AllocNewUsingT.
 
template<typename T >
static constexpr auto kamping::alloc_container_of = AllocContainerOfT<T>{}
 Convenience wrapper for creating library allocated containers. See AllocContainerOfT for details.
 
template<typename T >
static constexpr bool kamping::is_alloc_container_of_v = false
 Helper to decide if an allocation tag is an AllocContainerOfT.
 
template<typename T >
static constexpr bool kamping::is_alloc_container_of_v< AllocContainerOfT< T > > = true
 Helper to decide if an allocation tag is an AllocContainerOfT.
 
template<typename T >
constexpr bool kamping::internal::has_data_member_v = has_data_member<T>::value
 Boolean value helping to decide if data type has .data() method.
 
constexpr BufferResizePolicy kamping::no_resize
 
constexpr BufferResizePolicy kamping::grow_only
 
constexpr BufferResizePolicy kamping::resize_to_fit
 
template<typename MemberType >
constexpr BufferResizePolicy kamping::internal::maximum_viable_resize_policy
 for a given
 
template<typename T >
constexpr bool kamping::internal::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 kamping::internal::is_empty_data_buffer_v< EmptyDataBuffer< T, type, buffer_type_param > > = true
 Helper to decide if a type is an instance of EmptyDataBuffer.
 

Detailed Description

The classes defined in this file serve as in, out and in/out parameters to the MPI calls wrapped by KaMPIng.

The non-modifiable buffers encapsulate input data like data to send or send counts needed for a lot of MPI calls. If the user already computed additional information like the send displacements or receive counts for a collective operations that would otherwise have to be computed by the library, these values can also be provided to the library via non-modifiable buffers.

The modifiable buffers provide memory to store the result of MPI calls and (intermediate information needed to complete an MPI call like send displacements or receive counts/displacements etc. if the user has not yet provided them). The storage can be either provided by the user or can be allocated by the library.