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

#include <adjointInterface.hpp>

Public Member Functions

virtual void combineAdjoints (void *buf, const int elements, const int ranks) const =0
 Perform a reduction in the first element of the buffer. More...
 
virtual int computeElements (int elements) const =0
 Compute the number of active types in the buffer. More...
 
virtual void createAdjointTypeBuffer (void *&buf, size_t size) const =0
 Create an array for the adjoint variables. More...
 
virtual void createPrimalTypeBuffer (void *&buf, size_t size) const =0
 Create an array for the primal variables. More...
 
virtual void deleteAdjointTypeBuffer (void *&buf) const =0
 Delete the array of the adjoint variables. More...
 
virtual void deletePrimalTypeBuffer (void *&buf) const =0
 Delete the array of the primal variables. More...
 
virtual void getAdjoints (const void *indices, void *adjoints, int elements) const =0
 Get the adjoints for the indices from the AD tool. More...
 
virtual void getPrimals (const void *indices, const void *primals, int elements) const =0
 Get the primal values from the AD tool. More...
 
virtual int getVectorSize () const =0
 The vector size for the current evaluation. More...
 
virtual void setPrimals (const void *indices, const void *primals, int elements) const =0
 Set the primal values on the AD tool. More...
 
virtual void updateAdjoints (const void *indices, const void *adjoints, int elements) const =0
 Add the adjoint varaibles to the ones in the AD tool. That is the AD tool should perform the operation: More...
 

Member Function Documentation

◆ combineAdjoints()

virtual void medi::AdjointInterface::combineAdjoints ( void *  buf,
const int  elements,
const int  ranks 
) const
pure virtual

Perform a reduction in the first element of the buffer.

Parameters
[in,out]bufThe buffer with adjoint values its size is elements * ranks
[in]elementsThe number of elements in the vectors.
[in]ranksThe number of ranks in the communication.

◆ computeElements()

virtual int medi::AdjointInterface::computeElements ( int  elements) const
pure virtual

Compute the number of active types in the buffer.

Parameters
[in]elementsThe number of elements in the buffer.
Returns
The number of active types in the buffer.

◆ createAdjointTypeBuffer()

virtual void medi::AdjointInterface::createAdjointTypeBuffer ( void *&  buf,
size_t  size 
) const
pure virtual

Create an array for the adjoint variables.

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

◆ createPrimalTypeBuffer()

virtual void medi::AdjointInterface::createPrimalTypeBuffer ( void *&  buf,
size_t  size 
) const
pure virtual

Create an array for the primal variables.

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

◆ deleteAdjointTypeBuffer()

virtual void medi::AdjointInterface::deleteAdjointTypeBuffer ( void *&  buf) const
pure virtual

Delete the array of the adjoint variables.

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

◆ deletePrimalTypeBuffer()

virtual void medi::AdjointInterface::deletePrimalTypeBuffer ( void *&  buf) const
pure virtual

Delete the array of the primal variables.

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

◆ getAdjoints()

virtual void medi::AdjointInterface::getAdjoints ( const void *  indices,
void *  adjoints,
int  elements 
) const
pure virtual

Get the adjoints for the indices from the AD tool.

Parameters
[in]indicesThe indices from the AD tool for the variables in the buffer.
[out]adjointsThe vector for the adjoint variables.
[in]elementsThe number of elements in the vectors.

◆ getPrimals()

virtual void medi::AdjointInterface::getPrimals ( const void *  indices,
const void *  primals,
int  elements 
) const
pure virtual

Get the primal values from the AD tool.

Can be used to store the old primal values from the floating point values in the buffer.

Parameters
[in]indicesThe indices from the AD tool for the variables in the buffer.
[out]primalsThe vector with the old primal variables.
[in]elementsThe number of elements in the vectors.

◆ getVectorSize()

virtual int medi::AdjointInterface::getVectorSize ( ) const
pure virtual

The vector size for the current evaluation.

Returns
The vector size for the current evaluation.

◆ setPrimals()

virtual void medi::AdjointInterface::setPrimals ( const void *  indices,
const void *  primals,
int  elements 
) const
pure virtual

Set the primal values on the AD tool.

Can be used to restore the old primal values from the floating point values in the buffer.

Parameters
[in]indicesThe indices from the AD tool for the variables in the buffer.
[out]primalsThe vector with the old primal variables.
[in]elementsThe number of elements in the vectors.

◆ updateAdjoints()

virtual void medi::AdjointInterface::updateAdjoints ( const void *  indices,
const void *  adjoints,
int  elements 
) const
pure virtual

Add the adjoint varaibles to the ones in the AD tool. That is the AD tool should perform the operation:

internalAdjoints[indices[i]] += adjoints[i];

Parameters
[in]indicesThe indices from the AD tool for the variables in the buffer.
[out]adjointsThe vector with the adjoint variables.
[in]elementsThe number of elements in the vectors.

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