The interface for the AD tool that is accessed by MeDiPack. More...
#include <adToolInterface.h>
Public Types | |
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. | |
Public Member Functions | |
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 () |
The interface for the AD tool that is accessed by MeDiPack.
typedef void medi::ADToolInterface::AdjointType |
The data type that is used for the adjoint variables.
typedef void medi::ADToolInterface::IndexType |
The data type from the AD tool for the identification of AD variables.
typedef void medi::ADToolInterface::ModifiedType |
The type that is send through the modified buffers.
typedef void medi::ADToolInterface::PrimalType |
The data type used for the floating point data.
typedef void medi::ADToolInterface::Type |
The actual type that the AD implementation uses.
|
inline |
Create an interface for the AD type.
[in] | adjointMpiType | The mpi data type for the adjoint type. |
|
inlinevirtual |
|
pure virtual |
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.
[in,out] | h | The handle that is used by MeDiPack for the data storing. |
Implemented in medi::ADToolPassive.
Convert the mpi intrinsic operators like MPI_SUM to the specific one for the AD tool.
[in] | op | The intrinsic mpi operator. |
Implemented in medi::ADToolPassive.
|
pure virtual |
Create an array for the index variables.
[out] | buf | The pointer for the buffer. |
[in] | size | The size of the buffer. |
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, medi::ADToolPassive, medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >, medi::ADToolBase< ADToolPassive, void, void, void >, and medi::ADToolBase< Impl, AdjointType, PrimalType, IndexType >.
|
pure virtual |
Create an array for the passive variables.
[out] | buf | The pointer for the buffer. |
[in] | size | The size of the buffer. |
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, medi::ADToolPassive, medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >, medi::ADToolBase< ADToolPassive, void, void, void >, and medi::ADToolBase< Impl, AdjointType, PrimalType, IndexType >.
|
pure virtual |
Delete the array of the index variables.
[in,out] | buf | The pointer for the buffer. |
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, medi::ADToolPassive, medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >, medi::ADToolBase< ADToolPassive, void, void, void >, and medi::ADToolBase< Impl, AdjointType, PrimalType, IndexType >.
|
pure virtual |
Delete the array of the passive variables.
[in,out] | buf | The pointer for the buffer. |
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, medi::ADToolPassive, medi::ADToolBase< Impl, AdjointTypeB, PrimalTypeB, IndexTypeB >, medi::ADToolBase< ADToolPassive, void, void, void >, and medi::ADToolBase< Impl, AdjointType, PrimalType, IndexType >.
|
inline |
The mpi data type for the adjoint type.
|
inline |
The mpi data type for the primal type.
|
pure virtual |
If this AD interface represents an AD type.
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.
|
pure virtual |
The handle needs to be created if an adjoint action is required by the AD tool.
Implemented in medi::ADToolPassive.
|
pure virtual |
Indicates if the AD tool needs to modify the buffer in order to send the correct data.
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.
|
pure virtual |
Indicates if MeDiPack needs store the overwritten primal values for the AD tool.
Implemented in medi::ADToolImplCommon< Impl, restorePrimal, modifiedBuffer, Type, AdjointType, PrimalType, IndexType >, and medi::ADToolPassive.
|
pure virtual |
Indicates to the AD tool that an adjoint action is in the progress of beeing recorded.
[in,out] | h | The handle that is used by MeDiPack for the data storing. |
Implemented in medi::ADToolPassive.
|
pure virtual |
Indicates to the AD tool that an adjoint action is beeing finished.
[in,out] | h | The handle that is used by MeDiPack for the data storing. |
Implemented in medi::ADToolPassive.