MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
medi::StaticADToolInterface Struct Reference

The static methods for the AD tool interface. More...

#include <adToolInterface.h>

Inheritance diagram for medi::StaticADToolInterface:

Public Types

typedef double AdjointType
 The data type that is used for the adjoint variables.
 
typedef int IndexType
 The data type from the AD tool for the identification of AD variables.
 
typedef double ModifiedType
 The type that is send through the modified buffers.
 
typedef double PrimalType
 The data type used for the floating point data.
 
typedef double Type
 The actual type that the AD implementation uses.
 
- 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.
 

Static Public Member Functions

static void clearIndex (Type &value)
 Delete the index in a buffer such that the buffer can be overwritten.
 
static void createIndex (Type &value, IndexType &index)
 Create an index for the given item in the buffer.
 
static void getFromModifyBuffer (const ModifiedType &modValue, Type &value)
 Copies the nescessary data from the received MeDiPack buffer into the user buffer.
 
static IndexType getIndex (const Type &value)
 Get the AD identifier for this value.
 
static PrimalType getValue (const Type &value)
 Get the primal floating point value of the AD value.
 
static void registerValue (Type &value, PrimalType &oldPrimal, IndexType &index)
 Register an AD value on the receiving side of the communication.
 
static void setIntoModifyBuffer (ModifiedType &modValue, const Type &value)
 Copies the nescessary data from the user buffer into the buffer crated by MeDiPack.
 

Additional Inherited Members

- 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.
 
virtual void createIndexTypeBuffer (void *&buf, size_t size) const =0
 Create an array for the index variables.
 
virtual void createPrimalTypeBuffer (void *&buf, size_t size) const =0
 Create an array for the passive variables.
 
virtual void deleteIndexTypeBuffer (void *&buf) const =0
 Delete the array of the index variables.
 
virtual void deletePrimalTypeBuffer (void *&buf) const =0
 Delete the array of the passive variables.
 
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 ()
 

Detailed Description

The static methods for the AD tool interface.

All these static methods need to be implemented by the AD tool

Member Typedef Documentation

◆ AdjointType

The data type that is used for the adjoint variables.

◆ IndexType

The data type from the AD tool for the identification of AD variables.

◆ ModifiedType

The type that is send through the modified buffers.

◆ PrimalType

The data type used for the floating point data.

◆ Type

The actual type that the AD implementation uses.

Member Function Documentation

◆ clearIndex()

static void medi::StaticADToolInterface::clearIndex ( Type & value)
static

Delete the index in a buffer such that the buffer can be overwritten.

Parameters
[in,out]valueThe AD value in the buffer.

◆ createIndex()

static void medi::StaticADToolInterface::createIndex ( Type & value,
IndexType & index )
static

Create an index for the given item in the buffer.

Parameters
[in,out]valueThe AD value in the buffer.
[out]indexThe index for the value.

◆ getFromModifyBuffer()

static void medi::StaticADToolInterface::getFromModifyBuffer ( const ModifiedType & modValue,
Type & value )
static

Copies the nescessary data from the received MeDiPack buffer into the user buffer.

Parameters
[in]modValueThe value in the modified buffer
[out]valueThe value in the user buffer.

◆ getIndex()

static IndexType medi::StaticADToolInterface::getIndex ( const Type & value)
static

Get the AD identifier for this value.

Parameters
[in]valueThe AD value.
Returns
The identifier for the AD value.

◆ getValue()

static PrimalType medi::StaticADToolInterface::getValue ( const Type & value)
static

Get the primal floating point value of the AD value.

Parameters
[in]valueThe AD value.
Returns
The primal floating point value that is represented by the AD value.

◆ registerValue()

static void medi::StaticADToolInterface::registerValue ( Type & value,
PrimalType & oldPrimal,
IndexType & index )
static

Register an AD value on the receiving side of the communication.

Parameters
[in,out]valueThe AD value in the user buffer on the receiving side.
[out]oldPrimalThe old primal value that was overwritten by this value.
[in,out]indexThe identifier registered for the old value. This value may be set here or already be the value from createIndex.

◆ setIntoModifyBuffer()

static void medi::StaticADToolInterface::setIntoModifyBuffer ( ModifiedType & modValue,
const Type & value )
static

Copies the nescessary data from the user buffer into the buffer crated by MeDiPack.

Parameters
[out]modValueThe value in the modified buffer
[in]valueThe value in the user buffer.

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