KaMPIng 0.1.1
Flexible and (near) zero-overhead C++ bindings for MPI
Loading...
Searching...
No Matches
utility.hpp
1// This file is part of KaMPIng.
2//
3// Copyright 2024 The KaMPIng Authors
4//
5// KaMPIng is free software : you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
6// License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
7// version. KaMPIng is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
8// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
9// for more details.
10//
11// You should have received a copy of the GNU Lesser General Public License along with KaMPIng. If not, see
12// <https://www.gnu.org/licenses/>.
13//
14#pragma once
15
16#include <utility>
17
19
20namespace kamping {
21/// @brief Specialization of the `mpi_type_traits` type trait for `std::pair`, which represents the pair as MPI struct
22/// type.
23/// @note Using struct types may have performance pitfalls if the types has padding. For maximum performance, use the
24/// unsafe version in \ref kamping/types/unsafe/utility.hpp.
25template <typename First, typename Second>
26struct mpi_type_traits<
27 std::pair<First, Second>,
28 std::enable_if_t<has_static_type_v<First> && has_static_type_v<Second>>> : struct_type<std::pair<First, Second>> {};
29} // namespace kamping
Utility that maps C++ types to types that can be understood by MPI.
STL namespace.