MeDiPack  1.2.2
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
medi::ADToolPassive Class Referencefinal

Implementation for the AD tool interface of a type that is no AD type. More...

#include <adToolPassive.hpp>

Inheritance diagram for medi::ADToolPassive:

Public Types

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

Public Member Functions

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

Detailed Description

Implementation for the AD tool interface of a type that is no AD type.

All methods in this implementation contain no logic.

Member Typedef Documentation

◆ AdjointType

◆ IndexType

◆ PrimalType

Constructor & Destructor Documentation

◆ ADToolPassive()

medi::ADToolPassive::ADToolPassive ( MPI_Datatype  primalType,
MPI_Datatype  adjointType 
)
inline

Member Function Documentation

◆ addToolAction()

void medi::ADToolPassive::addToolAction ( HandleBase h) const
inlinevirtual

Register the handle so that the AD tool can evaluate it in the reverse sweep.

The AD tool needs to store the handle and do the following call:

h->func(h);

This call will evaluate the necessary adjoint actions by MeDiPack.

The handle pointer is now in the possion of the AD tool and the AD tool needs to delete the handle with the call

delete h;

The virtual function call will take care of the proper deletion of the MeDiPack structure.

Parameters
[in,out]hThe handle that is used by MeDiPack for the data storing.

Implements medi::ADToolInterface.

◆ convertOperator()

AMPI_Op medi::ADToolPassive::convertOperator ( AMPI_Op  op) const
inlinevirtual

Convert the mpi intrinsic operators like MPI_SUM to the specific one for the AD tool.

Parameters
[in]opThe intrinsic mpi operator.
Returns
The opertor that can handle the AD type.

Implements medi::ADToolInterface.

◆ createIndexTypeBuffer()

void medi::ADToolPassive::createIndexTypeBuffer ( IndexType *&  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.

◆ createPrimalTypeBuffer()

void medi::ADToolPassive::createPrimalTypeBuffer ( PrimalType *&  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.

◆ deleteIndexTypeBuffer()

void medi::ADToolPassive::deleteIndexTypeBuffer ( IndexType *&  buf) const
inlinevirtual

Delete the array of the index variables.

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

Implements medi::ADToolInterface.

◆ deletePrimalTypeBuffer()

void medi::ADToolPassive::deletePrimalTypeBuffer ( PrimalType *&  buf) const
inlinevirtual

Delete the array of the passive variables.

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

Implements medi::ADToolInterface.

◆ isActiveType()

bool medi::ADToolPassive::isActiveType ( ) const
inlinevirtual

If this AD interface represents an AD type.

Returns
true if it is an AD type.

Implements medi::ADToolInterface.

◆ isHandleRequired()

bool medi::ADToolPassive::isHandleRequired ( ) const
inlinevirtual

The handle needs to be created if an adjoint action is required by the AD tool.

Returns
True if an adjoint action is required.

Implements medi::ADToolInterface.

◆ isModifiedBufferRequired()

bool medi::ADToolPassive::isModifiedBufferRequired ( ) const
inlinevirtual

Indicates if the AD tool needs to modify the buffer in order to send the correct data.

Returns
true if a new buffer needs to be created.

Implements medi::ADToolInterface.

◆ isOldPrimalsRequired()

bool medi::ADToolPassive::isOldPrimalsRequired ( ) const
inlinevirtual

Indicates if MeDiPack needs store the overwritten primal values for the AD tool.

Returns
True if overwritten primal values need to be restored.

Implements medi::ADToolInterface.

◆ startAssembly()

void medi::ADToolPassive::startAssembly ( HandleBase h) const
inlinevirtual

Indicates to the AD tool that an adjoint action is in the progress of beeing recorded.

Parameters
[in,out]hThe handle that is used by MeDiPack for the data storing.

Implements medi::ADToolInterface.

◆ stopAssembly()

void medi::ADToolPassive::stopAssembly ( HandleBase h) const
inlinevirtual

Indicates to the AD tool that an adjoint action is beeing finished.

Parameters
[in,out]hThe handle that is used by MeDiPack for the data storing.

Implements medi::ADToolInterface.


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