19#include <kamping/utils/traits.hpp>
32 template <
typename...
Args>
34 return f(std::forward<Args...>(
args)...);
45template <
typename T,
typename Enable =
void>
52 std::remove_const_t<std::tuple_element_t<1, typename T::value_type>>;
58 using type = std::remove_const_t<typename T::value_type>;
98 static_assert(is_nested_send_buffer_v<Container>);
100 for (
auto const& message: nested_send_buf) {
109 typename internal::FlatContainer<Container>::type flat_send_buf;
110 flat_send_buf.resize(total_send_count);
111 if constexpr (is_sparse_send_buffer_v<Container>) {
112 for (
auto const& [
destination, message]: nested_send_buf) {
121 static_assert(is_nested_send_buffer_v<Container>);
123 for (
auto const& message: nested_send_buf) {
133 std::forward<
decltype(f)>(f),
164 template <
typename...>
typename CountContainer = std::vector,
166 typename Enable = std::enable_if_t<is_nested_send_buffer_v<Container>>>
167auto with_flattened(Container
const& nested_send_buf) {
168 return with_flattened<CountContainer>(nested_send_buf, nested_send_buf.size());
STL-compatible allocator for requesting memory using the builtin MPI allocator.
Definition allocator.hpp:32
auto destination(int rank)
Passes rank as destination rank to the underlying call. This parameter is needed in point-to-point ex...
Definition named_parameters.hpp:999
auto send_buf(internal::ignore_t< Data > ignore)
Generates a dummy send buf that wraps a nullptr.
Definition named_parameters.hpp:51
auto send_counts(Container &&container)
Passes a container as send counts to the underlying call, i.e. the container's storage must contain t...
Definition named_parameters.hpp:203
auto send_displs(Container &&container)
Passes a container as send displacements to the underlying call, i.e. the container's storage must co...
Definition named_parameters.hpp:574
Factory methods for buffer wrappers.
auto make_callable_wrapper(F f)
A factory function for CallableWrapper.
Definition flatten.hpp:40
A wrapper around a functor F that makes it callable using the call method.
Definition flatten.hpp:28
auto call(Args &&... args)
Calls the wrapped functor with the given arguments.
Definition flatten.hpp:33
F f
The functor to wrap.
Definition flatten.hpp:29
std::remove_const_t< typename T::value_type > type
The type of the nested container.
Definition flatten.hpp:58
std::remove_const_t< std::tuple_element_t< 1, typename T::value_type > > type
The type of the nested container.
Definition flatten.hpp:51
Maps a container to is underlying nested container.
Definition flatten.hpp:46