MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB > Class Template Reference

#include <adToolInterface.h>

Inheritance diagram for medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >:

Public Member Functions

 ADToolBase (MPI_Datatype primalMpiType, MPI_Datatype adjointMpiType)
 Construct the type safe wrapper.
 
void createIndexTypeBuffer (void *&buf, size_t size) const
 Create an array for the index variables.
 
void createPrimalTypeBuffer (void *&buf, size_t size) const
 Create an array for the passive variables.
 
void deleteIndexTypeBuffer (void *&buf) const
 Delete the array of the index variables.
 
void deletePrimalTypeBuffer (void *&buf) const
 Delete the array of the passive variables.
 
- Public Member Functions inherited from medi::ADToolInterface
virtual void addToolAction (HandleBase *h) const =0
 Register the handle so that the AD tool can evaluate it in the reverse sweep.
 
 ADToolInterface (MPI_Datatype primalMpiType, MPI_Datatype adjointMpiType)
 Create an interface for the AD type.
 
virtual AMPI_Op convertOperator (AMPI_Op op) const =0
 Convert the mpi intrinsic operators like MPI_SUM to the specific one for the AD tool.
 
MPI_Datatype getAdjointMpiType () const
 The mpi data type for the adjoint type.
 
MPI_Datatype getPrimalMpiType () const
 The mpi data type for the primal type.
 
virtual bool isActiveType () const =0
 If this AD interface represents an AD type.
 
virtual bool isHandleRequired () const =0
 The handle needs to be created if an adjoint action is required by the AD tool.
 
virtual bool isModifiedBufferRequired () const =0
 Indicates if the AD tool needs to modify the buffer in order to send the correct data.
 
virtual bool isOldPrimalsRequired () const =0
 Indicates if MeDiPack needs store the overwritten primal values for the AD tool.
 
virtual void startAssembly (HandleBase *h) const =0
 Indicates to the AD tool that an adjoint action is in the progress of beeing recorded.
 
virtual void stopAssembly (HandleBase *h) const =0
 Indicates to the AD tool that an adjoint action is beeing finished.
 
virtual ~ADToolInterface ()
 

Additional Inherited Members

- Public Types inherited from medi::ADToolInterface
typedef void AdjointType
 The data type that is used for the adjoint variables.
 
typedef void IndexType
 The data type from the AD tool for the identification of AD variables.
 
typedef void ModifiedType
 The type that is send through the modified buffers.
 
typedef void PrimalType
 The data type used for the floating point data.
 
typedef void Type
 The actual type that the AD implementation uses.
 

Detailed Description

template<typename Impl, typename AdjointTypeB, typename PrimalTypeB, typename IndexTypeB>
class medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >

A type save implementation of the AD tool interface.

All functions with void types are forwarded to the type safe implementation.

Template Parameters
ImplThe class that implements the actual interface in a type save manner.
AdjointTypeBThe data type for the adjoint variables that the implementation uses.
PrimalTypeBThe data type for the passive variables that the implementation uses.
IndexTypeBThe data type for the index variables that the implementation uses.

Constructor & Destructor Documentation

◆ ADToolBase()

template<typename Impl , typename AdjointTypeB , typename PrimalTypeB , typename IndexTypeB >
medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >::ADToolBase ( MPI_Datatype primalMpiType,
MPI_Datatype adjointMpiType )
inline

Construct the type safe wrapper.

Parameters
[in]primalMpiTypeThe mpi data type for the primal type.
[in]adjointMpiTypeThe mpi data type for the adjoint type.

Member Function Documentation

◆ createIndexTypeBuffer()

template<typename Impl , typename AdjointTypeB , typename PrimalTypeB , typename IndexTypeB >
void medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >::createIndexTypeBuffer ( void *& buf,
size_t size ) const
inlinevirtual

Create an array for the index variables.

Parameters
[out]bufThe pointer for the buffer.
[in]sizeThe size of the buffer.

Implements medi::ADToolInterface.

Reimplemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.

◆ createPrimalTypeBuffer()

template<typename Impl , typename AdjointTypeB , typename PrimalTypeB , typename IndexTypeB >
void medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >::createPrimalTypeBuffer ( void *& buf,
size_t size ) const
inlinevirtual

Create an array for the passive variables.

Parameters
[out]bufThe pointer for the buffer.
[in]sizeThe size of the buffer.

Implements medi::ADToolInterface.

Reimplemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.

◆ deleteIndexTypeBuffer()

template<typename Impl , typename AdjointTypeB , typename PrimalTypeB , typename IndexTypeB >
void medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >::deleteIndexTypeBuffer ( void *& buf) const
inlinevirtual

Delete the array of the index variables.

Parameters
[in,out]bufThe pointer for the buffer.

Implements medi::ADToolInterface.

Reimplemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.

◆ deletePrimalTypeBuffer()

template<typename Impl , typename AdjointTypeB , typename PrimalTypeB , typename IndexTypeB >
void medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >::deletePrimalTypeBuffer ( void *& buf) const
inlinevirtual

Delete the array of the passive variables.

Parameters
[in,out]bufThe pointer for the buffer.

Implements medi::ADToolInterface.

Reimplemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.


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