TRIQS/mpi 1.3.0
C++ interface to MPI
|
Specify supported MPI datatypes and provide tools to simplify the creation of user-defined MPI types and operations.
The following functionality is provided:
T
can be used in MPI communications. The user is allowed to implement their own MPI compatible types and provide a specializtion of mpi::mpi_type.See Example 3: Custom type and operator for a detailed example.
Classes | |
struct | mpi::mpi_type< T > |
Map C++ datatypes to the corresponding MPI datatypes. More... | |
struct | mpi::mpi_type< bool > |
Specialization of mpi_type for bool. More... | |
struct | mpi::mpi_type< char > |
Specialization of mpi_type for char. More... | |
struct | mpi::mpi_type< const T > |
Specialization of mpi::mpi_type for const types. More... | |
struct | mpi::mpi_type< double > |
Specialization of mpi_type for double. More... | |
struct | mpi::mpi_type< float > |
Specialization of mpi_type for float. More... | |
struct | mpi::mpi_type< int > |
Specialization of mpi_type for int. More... | |
struct | mpi::mpi_type< long > |
Specialization of mpi_type for long. More... | |
struct | mpi::mpi_type< long long > |
Specialization of mpi_type for long long. More... | |
struct | mpi::mpi_type< std::complex< double > > |
Specialization of mpi_type for std::complex<double>. More... | |
struct | mpi::mpi_type< std::tuple< T... > > |
Specialization of mpi::mpi_type for std::tuple. More... | |
struct | mpi::mpi_type< unsigned int > |
Specialization of mpi_type for unsigned int. More... | |
struct | mpi::mpi_type< unsigned long > |
Specialization of mpi_type for unsigned long. More... | |
struct | mpi::mpi_type< unsigned long long > |
Specialization of mpi_type for unsigned long long. More... | |
struct | mpi::mpi_type_from_tie< T > |
Create an MPI_Datatype from some struct. More... | |
Functions | |
template<typename... Ts> | |
MPI_Datatype | mpi::get_mpi_type (std::tuple< Ts... > tup) |
Create a new MPI_Datatype from a tuple. | |
template<typename T > | |
MPI_Op | mpi::map_add () |
Create a new MPI_Op for a generic addition by calling MPI_Op_create . | |
template<typename T , T(*)(T const &, T const &) F> | |
MPI_Op | mpi::map_C_function () |
Create a new MPI_Op from a given binary function by calling MPI_Op_create . | |
Variables | |
template<typename T , typename = void> | |
constexpr bool | mpi::has_mpi_type = false |
Type trait to check if a type T has a corresponding MPI datatype, i.e. if mpi::mpi_type has been specialized. | |
|
nodiscard |
#include <mpi/datatypes.hpp>
Create a new MPI_Datatype
from a tuple.
The tuple element types must have corresponding MPI datatypes, i.e. they must have mpi::mpi_type specializtions. It uses MPI_Type_create_struct
to create a new datatype consisting of the tuple element types.
It throws an exception in case a call to the MPI C library fails.
Ts | Tuple element types. |
tup | Tuple object. |
MPI_Datatype
consisting of the types of the tuple elements. Definition at line 109 of file datatypes.hpp.
MPI_Op mpi::map_add | ( | ) |
#include <mpi/operators.hpp>
Create a new MPI_Op
for a generic addition by calling MPI_Op_create
.
The type is required to have an overloaded operator+(const T& lhs, const T& rhs) -> T
.
T | Type used for the addition. |
MPI_Op
for the generic addition of the given type. Definition at line 70 of file operators.hpp.
MPI_Op mpi::map_C_function | ( | ) |
#include <mpi/operators.hpp>
Create a new MPI_Op
from a given binary function by calling MPI_Op_create
.
The binary function must have the following signature (T const&, T const&) -> T
.
It throws an exception in case a call to the MPI C library fails.
T | Type on which the binary function operates. |
F | Binary function pointer to be mapped. |
MPI_Op
created from the binary function. Definition at line 46 of file operators.hpp.
|
constexpr |
#include <mpi/datatypes.hpp>
Type trait to check if a type T has a corresponding MPI datatype, i.e. if mpi::mpi_type has been specialized.
T | Type to be checked. |
Definition at line 89 of file datatypes.hpp.