#include <typeInterface.hpp>
Public Types | |
typedef ADToolB::IndexType | IndexTypeB |
typedef ADToolB::PrimalType | PrimalTypeB |
Public Types inherited from medi::MpiTypeInterface | |
typedef void | AdjointType |
typedef void | IndexType |
The type of the identifiers for the AD tool. | |
typedef void | ModifiedType |
The type of the modified buffer data which is send over the network. | |
typedef void | PrimalType |
The type of the floating point values which are handled by the AD tool. | |
typedef void | Type |
The type of the user data which is represented by this interface. | |
Public Member Functions | |
void | clearIndices (void *buf, size_t bufOffset, int elements) const |
Clear the AD types in the buffer such that they can be overwritten. | |
int | computeActiveElements (const int count) const |
Get the number of active elements that are contained in count versions of the type. | |
void | copy (void *from, size_t fromOffset, void *to, size_t toOffset, int count) const |
Copy the elements of one buffer into the other. | |
void | copyFromModifiedBuffer (void *buf, size_t bufOffset, const void *bufMod, size_t bufModOffset, int elements) const |
Copy all data from the modified buffer and perform the special handling for the AD type. | |
void | copyIntoModifiedBuffer (const void *buf, size_t bufOffset, void *bufMod, size_t bufModOffset, int elements) const |
Copy all data into the modified buffer and perform the special handling for the AD type. | |
void | createIndices (void *buf, size_t bufOffset, void *indices, size_t bufModOffset, int elements) const |
Create indices for a reciving buffer if necessary. | |
void | createModifiedTypeBuffer (void *&buf, size_t size) const |
Create a temporary buffer of the modified type that this interface represents. | |
void | createTypeBuffer (void *&buf, size_t size) const |
Create a temporary buffer of the type that this interface represents. | |
void | deleteModifiedTypeBuffer (void *&buf) const |
Delete the temporary buffer for the modified types. | |
void | deleteTypeBuffer (void *&buf, size_t size) const |
Delete the temporary buffer. | |
void | freeType (void *buf, size_t bufOffset, int elements) const |
Destroy the types in the buffer. | |
void | getIndices (const void *buf, size_t bufOffset, void *indices, size_t bufModOffset, int elements) const |
Get all the AD identifiers from all AD types in the buffer. | |
void | getValues (const void *buf, size_t bufOffset, void *primals, size_t bufModOffset, int elements) const |
Get the primal values from the AD types. | |
void | initializeType (void *buf, size_t bufOffset, int elements) const |
Initialize the types in the buffer. | |
MpiTypeBase (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType) | |
void | performReduce (void *buf, void *target, int count, AMPI_Op op, int ranks) const |
Perform a local reduce operation. | |
void | registerValue (void *buf, size_t bufOffset, void *indices, void *oldPrimals, size_t bufModOffset, int elements) const |
Register all the AD values on the new machine. | |
Public Member Functions inherited from medi::MpiTypeInterface | |
virtual MpiTypeInterface * | clone () const =0 |
Creates a clone of the mpi type also calling MPI_Type_dub. | |
virtual const ADToolInterface & | getADTool () const =0 |
Get the AD tool that handled the AD specifics. | |
MPI_Datatype | getModifiedMpiType () const |
Return the MPI type for the modified data. | |
MPI_Datatype | getMpiType () const |
Return the MPI type for the data that this interface represents. | |
virtual bool | isModifiedBufferRequired () const =0 |
Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffers can be used. | |
MpiTypeInterface (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType) | |
Wrapper interface for MPI types in communications. See the class description for details. | |
virtual | ~MpiTypeInterface () |
Virtual destructor. | |
Additional Inherited Members | |
Protected Member Functions inherited from medi::MpiTypeInterface | |
void | setMpiTypes (MPI_Datatype mpiType, MPI_Datatype modifiedMpiType) |
Helper method for extending classes to set the types after the initial construction. | |
Implements all functions from MpiType that require a type change.
Functions that are not implemented: isModifiedBufferRequired
typedef ADToolB::IndexType medi::MpiTypeBase< Impl, TypeB, ModifiedTypeB, ADToolB >::IndexTypeB |
typedef ADToolB::PrimalType medi::MpiTypeBase< Impl, TypeB, ModifiedTypeB, ADToolB >::PrimalTypeB |
|
inline |
|
inlinevirtual |
Clear the AD types in the buffer such that they can be overwritten.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Get the number of active elements that are contained in count versions of the type.
[in] | count | The number of times this type is contained in the buffer. |
Implements medi::MpiTypeInterface.
Reimplemented in medi::MpiTypeDefault< ADTool >, and medi::MpiTypePassive< T >.
|
inlinevirtual |
Copy the elements of one buffer into the other.
[in] | from | The original buffer provided by the user. |
[in] | fromOffset | The offset into the original buffer. |
[out] | to | The target buffer for the data. |
[in] | toOffset | The offset for the target buffer. |
[in] | count | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Copy all data from the modified buffer and perform the special handling for the AD type.
The data for the AD types is modified such that it can be used on the new machine.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | bufMod | The buffer with the modified data. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are contiunous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Copy all data into the modified buffer and perform the special handling for the AD type.
The data for the AD types is modified such that it can be send over the network.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | bufMod | The new buffer for the modified data. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are continuous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Create indices for a reciving buffer if necessary.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | indices | The generated buffer for indices. Indices are stored in a linearized fashion. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are continuous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Create a temporary buffer of the modified type that this interface represents.
[in,out] | buf | The location for the new buffer |
[in] | size | The number of elements for the buffer |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Create a temporary buffer of the type that this interface represents.
[in,out] | buf | The location for the new buffer |
[in] | size | The number of elements for the buffer |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Delete the temporary buffer for the modified types.
[in,out] | buf | The location for the buffer |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Delete the temporary buffer.
[in,out] | buf | The location for the buffer |
[in] | size | The size of the temporary buffer |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Destroy the types in the buffer.
[in,out] | buf | The buffer in which the types are destroyed. |
[in] | bufOffset | The offset into the orignal buffer, as provided by the user. |
[in] | elements | THe number of elements the shoudl be initialized. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Get all the AD identifiers from all AD types in the buffer.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | indices | The generated buffer for indices. Indices are stored in a linearized fashion. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are continuous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Get the primal values from the AD types.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | primals | The generated buffer for primal values if the AD tool requires theses. Indices are stored in a linearized fashion. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are continuous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Initialize the types in the buffer.
[in,out] | buf | The buffer in which the types are created. |
[in] | bufOffset | The offset into the orignal buffer, as provided by the user. |
[in] | elements | THe number of elements the shoudl be initialized. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Perform a local reduce operation.
[in] | buf | The original buffer provided by the user. |
[out] | target | The target buffer provided by the user. |
[in] | count | The number of elements per rank. |
[in] | op | The operator for the reduction. |
[in] | ranks | The number of ranks in the communication. |
Implements medi::MpiTypeInterface.
|
inlinevirtual |
Register all the AD values on the new machine.
[in] | buf | The original buffer provided by the user. |
[in] | bufOffset | The offset into the original buffer, as provided by the user. |
[out] | indices | The generated buffer for indices. Indices are stored in a linearized fashion. |
[out] | oldPrimals | The generated buffer for primal values if the AD tool requires theses. Indices are stored in a linearized fashion. |
[in] | bufModOffset | The linearized displacement for the modified buffer. These displacements are continuous and do not contain any holes. |
[in] | elements | The number of elements that should be copied. |
Implements medi::MpiTypeInterface.