Handling for costum MPI_Datatypes crated by the user. More...
#include <constructedDatatypes.hpp>
Public Types | |
typedef void | AdjointType |
typedef void | IndexType |
typedef void | ModifiedType |
typedef void | PrimalType |
typedef void | Type |
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. | |
MpiStructType * | clone () const |
Creates a clone of the mpi type also calling MPI_Type_dub. | |
int | computeActiveElements (const int count) const |
Get the number of active elements that are contained in count versions of the type. | |
const void * | computeBufferPointer (const void *buf, size_t offset) const |
void * | computeBufferPointer (void *buf, size_t offset) const |
int | computeBufOffset (size_t element) const |
int | computeModOffset (size_t element) const |
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. | |
const ADToolInterface & | getADTool () const |
Get the AD tool that handled the AD specifics. | |
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. | |
bool | isModifiedBufferRequired () const |
Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffers can be used. | |
MpiStructType (const MpiStructType *other) | |
MpiStructType (const MpiStructType *other, size_t offset, size_t extent) | |
MpiStructType (int count, const int *array_of_blocklengths, const MPI_Aint *array_of_displacements, MpiTypeInterface *const *array_of_types) | |
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. | |
~MpiStructType () | |
Public Member Functions inherited from medi::MpiTypeInterface | |
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. | |
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. | |
Handling for costum MPI_Datatypes crated by the user.
The type stores the special intefaces of the types used to construct the datatype. It then uses these types to forward all calls to the implementations.
typedef void medi::MpiStructType::AdjointType |
typedef void medi::MpiStructType::IndexType |
typedef void medi::MpiStructType::ModifiedType |
typedef void medi::MpiStructType::PrimalType |
typedef void medi::MpiStructType::Type |
|
inline |
|
inline |
|
inline |
|
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 |
Creates a clone of the mpi type also calling MPI_Type_dub.
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
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 the AD tool that handled the AD specifics.
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 |
Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffers can be used.
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.