MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
medi::MpiTypeDefault< ADTool > Class Template Referencefinal

The default implementation of a MPI type that is represented by an AD type. More...

#include <typeDefault.hpp>

Inheritance diagram for medi::MpiTypeDefault< ADTool >:

Public Types

typedef ADTool::AdjointType AdjointType
 
typedef ADTool::IndexType IndexType
 
typedef ADTool::ModifiedType ModifiedType
 
typedef ADTool::PrimalType PrimalType
 
typedef ADTool Tool
 
typedef ADTool::Type Type
 
- Public Types inherited from medi::MpiTypeBase< MpiTypeDefault< ADTool >, ADTool::Type, ADTool::ModifiedType, ADTool >
typedef ADToolB::IndexType IndexTypeB
 
typedef ADToolB::PrimalType PrimalTypeB
 
- Public Types inherited from medi::MpiTypeInterface
typedef void AdjointType
 
typedef void IndexType
 The type of the identifiers for the AD tool.
 
typedef void ModifiedType
 The type of the modified buffer data which is send over the network.
 
typedef void PrimalType
 The type of the floating point values which are handled by the AD tool.
 
typedef void Type
 The type of the user data which is represented by this interface.
 

Public Member Functions

void clearIndices (Type *buf, size_t bufOffset, int elements) const
 
MpiTypeDefaultclone () const
 Creates a clone of the mpi type also calling MPI_Type_dub.
 
int computeActiveElements (const int count) const
 Get the number of active elements that are contained in count versions of the type.
 
void copy (Type *from, size_t fromOffset, Type *to, size_t toOffset, int count) const
 
void copyFromModifiedBuffer (Type *buf, size_t bufOffset, const ModifiedType *bufMod, size_t bufModOffset, int elements) const
 
void copyIntoModifiedBuffer (const Type *buf, size_t bufOffset, ModifiedType *bufMod, size_t bufModOffset, int elements) const
 
void createIndices (Type *buf, size_t bufOffset, IndexType *indices, size_t bufModOffset, int elements) const
 
void createModifiedTypeBuffer (ModifiedType *&buf, size_t size) const
 
void createTypeBuffer (Type *&buf, size_t size) const
 
void deleteModifiedTypeBuffer (ModifiedType *&buf) const
 
void deleteTypeBuffer (Type *&buf, size_t size) const
 
void freeType (Type *buf, size_t bufOffset, int elements) const
 
const ToolgetADTool () const
 Get the AD tool that handled the AD specifics.
 
void getIndices (const Type *buf, size_t bufOffset, IndexType *indices, size_t bufModOffset, int elements) const
 
void getValues (const Type *buf, size_t bufOffset, PrimalType *primals, size_t bufModOffset, int elements) const
 
void initializeType (Type *buf, size_t bufOffset, int elements) const
 
bool isModifiedBufferRequired () const
 Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffers can be used.
 
 MpiTypeDefault (Tool *adTool, MPI_Datatype type, MPI_Datatype modType)
 
void performReduce (Type *buf, Type *target, int count, AMPI_Op op, int ranks) const
 
void registerValue (Type *buf, size_t bufOffset, IndexType *indices, PrimalType *oldPrimals, size_t bufModOffset, int elements) const
 
 ~MpiTypeDefault ()
 
- Public Member Functions inherited from medi::MpiTypeBase< MpiTypeDefault< ADTool >, ADTool::Type, ADTool::ModifiedType, ADTool >
void clearIndices (void *buf, size_t bufOffset, int elements) const
 Clear the AD types in the buffer such that they can be overwritten.
 
void copy (void *from, size_t fromOffset, void *to, size_t toOffset, int count) const
 Copy the elements of one buffer into the other.
 
void copyFromModifiedBuffer (void *buf, size_t bufOffset, const void *bufMod, size_t bufModOffset, int elements) const
 Copy all data from the modified buffer and perform the special handling for the AD type.
 
void copyIntoModifiedBuffer (const void *buf, size_t bufOffset, void *bufMod, size_t bufModOffset, int elements) const
 Copy all data into the modified buffer and perform the special handling for the AD type.
 
void createIndices (void *buf, size_t bufOffset, void *indices, size_t bufModOffset, int elements) const
 Create indices for a reciving buffer if necessary.
 
void createModifiedTypeBuffer (void *&buf, size_t size) const
 Create a temporary buffer of the modified type that this interface represents.
 
void createTypeBuffer (void *&buf, size_t size) const
 Create a temporary buffer of the type that this interface represents.
 
void deleteModifiedTypeBuffer (void *&buf) const
 Delete the temporary buffer for the modified types.
 
void deleteTypeBuffer (void *&buf, size_t size) const
 Delete the temporary buffer.
 
void freeType (void *buf, size_t bufOffset, int elements) const
 Destroy the types in the buffer.
 
void getIndices (const void *buf, size_t bufOffset, void *indices, size_t bufModOffset, int elements) const
 Get all the AD identifiers from all AD types in the buffer.
 
void getValues (const void *buf, size_t bufOffset, void *primals, size_t bufModOffset, int elements) const
 Get the primal values from the AD types.
 
void initializeType (void *buf, size_t bufOffset, int elements) const
 Initialize the types in the buffer.
 
 MpiTypeBase (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType)
 
void performReduce (void *buf, void *target, int count, AMPI_Op op, int ranks) const
 Perform a local reduce operation.
 
void registerValue (void *buf, size_t bufOffset, void *indices, void *oldPrimals, size_t bufModOffset, int elements) const
 Register all the AD values on the new machine.
 
- Public Member Functions inherited from medi::MpiTypeInterface
MPI_Datatype getModifiedMpiType () const
 Return the MPI type for the modified data.
 
MPI_Datatype getMpiType () const
 Return the MPI type for the data that this interface represents.
 
 MpiTypeInterface (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType)
 Wrapper interface for MPI types in communications. See the class description for details.
 
virtual ~MpiTypeInterface ()
 Virtual destructor.
 

Public Attributes

TooladTool
 
bool isClone
 

Additional Inherited Members

- Protected Member Functions inherited from medi::MpiTypeInterface
void setMpiTypes (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType)
 Helper method for extending classes to set the types after the initial construction.
 

Detailed Description

template<typename ADTool>
class medi::MpiTypeDefault< ADTool >

The default implementation of a MPI type that is represented by an AD type.

Template Parameters
ADToolThis class needs to implement the ADToolInterface and the StaticADToolInterface.

Member Typedef Documentation

◆ AdjointType

template<typename ADTool >
typedef ADTool::AdjointType medi::MpiTypeDefault< ADTool >::AdjointType

◆ IndexType

template<typename ADTool >
typedef ADTool::IndexType medi::MpiTypeDefault< ADTool >::IndexType

◆ ModifiedType

template<typename ADTool >
typedef ADTool::ModifiedType medi::MpiTypeDefault< ADTool >::ModifiedType

◆ PrimalType

template<typename ADTool >
typedef ADTool::PrimalType medi::MpiTypeDefault< ADTool >::PrimalType

◆ Tool

template<typename ADTool >
typedef ADTool medi::MpiTypeDefault< ADTool >::Tool

◆ Type

template<typename ADTool >
typedef ADTool::Type medi::MpiTypeDefault< ADTool >::Type

Constructor & Destructor Documentation

◆ MpiTypeDefault()

template<typename ADTool >
medi::MpiTypeDefault< ADTool >::MpiTypeDefault ( Tool * adTool,
MPI_Datatype type,
MPI_Datatype modType )
inline

◆ ~MpiTypeDefault()

template<typename ADTool >
medi::MpiTypeDefault< ADTool >::~MpiTypeDefault ( )
inline

Member Function Documentation

◆ clearIndices()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::clearIndices ( Type * buf,
size_t bufOffset,
int elements ) const
inline

◆ clone()

template<typename ADTool >
MpiTypeDefault * medi::MpiTypeDefault< ADTool >::clone ( ) const
inlinevirtual

Creates a clone of the mpi type also calling MPI_Type_dub.

Returns
The cloned interface.

Implements medi::MpiTypeInterface.

◆ computeActiveElements()

template<typename ADTool >
int medi::MpiTypeDefault< ADTool >::computeActiveElements ( const int count) const
inlinevirtual

Get the number of active elements that are contained in count versions of the type.

Parameters
[in]countThe number of times this type is contained in the buffer.
Returns
The number of active elements in the buffer.

Reimplemented from medi::MpiTypeBase< MpiTypeDefault< ADTool >, ADTool::Type, ADTool::ModifiedType, ADTool >.

◆ copy()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::copy ( Type * from,
size_t fromOffset,
Type * to,
size_t toOffset,
int count ) const
inline

◆ copyFromModifiedBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::copyFromModifiedBuffer ( Type * buf,
size_t bufOffset,
const ModifiedType * bufMod,
size_t bufModOffset,
int elements ) const
inline

◆ copyIntoModifiedBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::copyIntoModifiedBuffer ( const Type * buf,
size_t bufOffset,
ModifiedType * bufMod,
size_t bufModOffset,
int elements ) const
inline

◆ createIndices()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::createIndices ( Type * buf,
size_t bufOffset,
IndexType * indices,
size_t bufModOffset,
int elements ) const
inline

◆ createModifiedTypeBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::createModifiedTypeBuffer ( ModifiedType *& buf,
size_t size ) const
inline

◆ createTypeBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::createTypeBuffer ( Type *& buf,
size_t size ) const
inline

◆ deleteModifiedTypeBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::deleteModifiedTypeBuffer ( ModifiedType *& buf) const
inline

◆ deleteTypeBuffer()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::deleteTypeBuffer ( Type *& buf,
size_t size ) const
inline

◆ freeType()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::freeType ( Type * buf,
size_t bufOffset,
int elements ) const
inline

◆ getADTool()

template<typename ADTool >
const Tool & medi::MpiTypeDefault< ADTool >::getADTool ( ) const
inlinevirtual

Get the AD tool that handled the AD specifics.

Returns
The handle to the AD tool

Implements medi::MpiTypeInterface.

◆ getIndices()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::getIndices ( const Type * buf,
size_t bufOffset,
IndexType * indices,
size_t bufModOffset,
int elements ) const
inline

◆ getValues()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::getValues ( const Type * buf,
size_t bufOffset,
PrimalType * primals,
size_t bufModOffset,
int elements ) const
inline

◆ initializeType()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::initializeType ( Type * buf,
size_t bufOffset,
int elements ) const
inline

◆ isModifiedBufferRequired()

template<typename ADTool >
bool medi::MpiTypeDefault< ADTool >::isModifiedBufferRequired ( ) const
inlinevirtual

Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffers can be used.

Returns
true if new send/recv buffers are required.

Implements medi::MpiTypeInterface.

◆ performReduce()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::performReduce ( Type * buf,
Type * target,
int count,
AMPI_Op op,
int ranks ) const
inline

◆ registerValue()

template<typename ADTool >
void medi::MpiTypeDefault< ADTool >::registerValue ( Type * buf,
size_t bufOffset,
IndexType * indices,
PrimalType * oldPrimals,
size_t bufModOffset,
int elements ) const
inline

Member Data Documentation

◆ adTool

template<typename ADTool >
Tool* medi::MpiTypeDefault< ADTool >::adTool

◆ isClone

template<typename ADTool >
bool medi::MpiTypeDefault< ADTool >::isClone

The documentation for this class was generated from the following file: