37#include <medi/medi.hpp>
41#include "../../traits/tapeTraits.hpp"
42#include "codiForwardMeDiPackTool.hpp"
43#include "codiReverseMeDiPackTool.hpp"
59 template<
typename T_Type,
60 typename T_Tool =
typename std::conditional<codi::TapeTraits::IsForwardTape<typename T_Type::Tape>::value,
61 CoDiPackForwardTool<T_Type>, CoDiPackReverseTool<T_Type> >::type>
69 using MPIType = medi::MpiTypeDefault<Tool>;
73 MPI_Datatype codiMpiType;
74 MPI_Datatype modifiedMpiType;
75 MPI_Datatype primalMpiType;
76 MPI_Datatype adjointMpiType;
87 : codiMpiType(createByteType(sizeof(
Type))),
88 modifiedMpiType(codiMpiType),
89 primalMpiType(createByteType(sizeof(typename
Type::
Real))),
90 adjointMpiType(primalMpiType),
91 adTool(primalMpiType, adjointMpiType),
107 MPI_Type_free(&codiMpiType);
108 MPI_Type_free(&primalMpiType);
113 static MPI_Datatype createByteType(
size_t size) {
115 MPI_Type_contiguous(size, MPI_BYTE, &type);
116 MPI_Type_commit(&type);
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
CoDiPack - Code Differentiation Package.
Definition codi.hpp:91
Represents a concrete lvalue in the CoDiPack expression tree.
Definition activeType.hpp:52
MPI datatype implementation for CoDipack types in the type wrapper of MeDiPack.
Definition codiMpiTypes.hpp:62
medi::MpiTypeDefault< Tool > MPIType
MeDiPack default implementation.
Definition codiMpiTypes.hpp:69
medi::AMPI_Datatype MPI_INT_TYPE
MPI_Datatype for the specified CoDiPack type and an int.
Definition codiMpiTypes.hpp:83
T_Tool Tool
See CoDiMpiTypes.
Definition codiMpiTypes.hpp:67
CoDiMpiTypes()
Constructor.
Definition codiMpiTypes.hpp:86
T_Type Type
See CoDiMpiTypes.
Definition codiMpiTypes.hpp:66
MPIType * MPI_TYPE
MPI_Datatype for the specified CoDiPack type.
Definition codiMpiTypes.hpp:82
~CoDiMpiTypes()
Destructor.
Definition codiMpiTypes.hpp:99