103 for(
int i = 0; i < elements; ++i) {
104 bufMod[bufModOffset + i] = buf[bufOffset + i];
109 for(
int i = 0; i < elements; ++i) {
110 buf[bufOffset + i] = bufMod[bufModOffset + i];
162 inline void copy(
Type* from,
size_t fromOffset,
Type* to,
size_t toOffset,
int count)
const {
163 for(
int i = 0; i < count; ++i) {
164 to[toOffset + i] = from[fromOffset + i];
169 for(
int i = 0; i < elements; ++i) {
170 new(&buf[bufOffset + i])
Type;
175 for(
int i = 0; i < elements; ++i) {
176 buf[bufOffset + elements].~Type();
181 buf =
new Type[size];
void copy(void *from, size_t fromOffset, void *to, size_t toOffset, int count) const
Definition typeInterface.hpp:369
MpiTypeBase(MPI_Datatype mpiType, MPI_Datatype modifiedMpiType)
Definition typeInterface.hpp:330
MPI_Datatype getMpiType() const
Return the MPI type for the data that this interface represents.
Definition typeInterface.hpp:127
void getIndices(const Type *buf, size_t bufOffset, IndexType *indices, size_t bufModOffset, int elements) const
Definition typePassive.hpp:114
void registerValue(Type *buf, size_t bufOffset, IndexType *indices, PrimalType *oldPrimals, size_t bufModOffset, int elements) const
Definition typePassive.hpp:122
void getValues(const Type *buf, size_t bufOffset, PrimalType *primals, size_t bufModOffset, int elements) const
Definition typePassive.hpp:145
MpiTypePassive(MPI_Datatype type)
Definition typePassive.hpp:69
ADToolPassive Tool
Definition typePassive.hpp:61
void deleteTypeBuffer(Type *&buf, size_t size) const
Definition typePassive.hpp:188
void performReduce(Type *buf, Type *target, int count, AMPI_Op op, int ranks) const
Definition typePassive.hpp:153
void createModifiedTypeBuffer(ModifiedType *&buf, size_t size) const
Definition typePassive.hpp:184
void copyIntoModifiedBuffer(const Type *buf, size_t bufOffset, ModifiedType *bufMod, size_t bufModOffset, int elements) const
Definition typePassive.hpp:102
void PrimalType
Definition typePassive.hpp:58
bool isModifiedBufferRequired() const
Tell the functions if the underlying AD tool requires new send/recv buffers or if the original buffer...
Definition typePassive.hpp:98
T ModifiedType
Definition typePassive.hpp:57
void createTypeBuffer(Type *&buf, size_t size) const
Definition typePassive.hpp:180
void createIndices(Type *buf, size_t bufOffset, IndexType *indices, size_t bufModOffset, int elements) const
Definition typePassive.hpp:137
MpiTypePassive * clone() const
Creates a clone of the mpi type also calling MPI_Type_dub.
Definition typePassive.hpp:202
bool isClone
Definition typePassive.hpp:65
const Tool & getADTool() const
Get the AD tool that handled the AD specifics.
Definition typePassive.hpp:88
void deleteModifiedTypeBuffer(ModifiedType *&buf) const
Definition typePassive.hpp:195
Tool adTool
Definition typePassive.hpp:67
T Type
Definition typePassive.hpp:56
void freeType(Type *buf, size_t bufOffset, int elements) const
Definition typePassive.hpp:174
void clearIndices(Type *buf, size_t bufOffset, int elements) const
Definition typePassive.hpp:131
MpiTypeBase< MpiTypePassive< T >, Type, ModifiedType, ADToolPassive > Base
Definition typePassive.hpp:63
void initializeType(Type *buf, size_t bufOffset, int elements) const
Definition typePassive.hpp:168
int computeActiveElements(const int count) const
Get the number of active elements that are contained in count versions of the type.
Definition typePassive.hpp:92
void IndexType
Definition typePassive.hpp:59
void copy(Type *from, size_t fromOffset, Type *to, size_t toOffset, int count) const
Definition typePassive.hpp:162
~MpiTypePassive()
Definition typePassive.hpp:81
void copyFromModifiedBuffer(Type *buf, size_t bufOffset, const ModifiedType *bufMod, size_t bufModOffset, int elements) const
Definition typePassive.hpp:108
#define MEDI_UNUSED(name)
Definition macros.h:108
Global namespace for MeDiPack - Message Differentiation Package.
Definition adjointInterface.hpp:37
Structure for the special handling of the MPI_Op structure.
Definition op.hpp:50