Structure for the special handling of the MPI_Op structure. More...
#include <op.hpp>
Public Member Functions | |
AMPI_Op () | |
Default constructor for static initialization. | |
int | free () |
int | init (const bool requiresPrimal, const bool requiresPrimalSend, MPI_User_function *primalFunction, int primalFunctionCommute, MPI_User_function *modifiedPrimalFunction, int modifiedPrimalFunctionCommute, const PreAdjointOperation preAdjointOperation, const PostAdjointOperation postAdjointOperation) |
Creates an operator with a specialized adjoint handling. | |
void | init (MPI_Op op) |
Creates an operator that has no special adjoint handling. | |
int | init (MPI_User_function *user_fn, int commute) |
Creates an operator that has no special adjoint handling. | |
Public Attributes | |
bool | hasAdjoint |
Indicates if the user has provided a specialized adjoint handling for the operator. | |
MPI_Op | modifiedPrimalFunction |
The mpi operator for the modified AD types. This are the operations that are evaluated during the mpi transactions. | |
PostAdjointOperation | postAdjointOperation |
The operation that is evaluated on each adjoint after the values have been received in a message. | |
PreAdjointOperation | preAdjointOperation |
The operation that is evaluated on each adjoint value before they are send in a message. | |
MPI_Op | primalFunction |
The mpi operator for the unmodified AD types. The AD tool needs to record all operations that are evaluated with this operator. | |
bool | requiresPrimal |
Indicates if the primal on the sending and receiving side are required by this operator. | |
bool | requiresPrimalSend |
Indicates if the primal on the receiving side needs to be send to the sending side. | |
Structure for the special handling of the MPI_Op structure.
The structure contains additional data for the AD evaluation and indicators what the operator requires.
|
inline |
Default constructor for static initialization.
On this constructed type one of the init method needs to be called.
|
inline |
|
inline |
Creates an operator with a specialized adjoint handling.
[in] | requiresPrimal | If the adjoint operations require the primals in the sender/receiver side. |
[in] | requiresPrimalSend | If the adjoint operation on the primal sending side requires the primal result of the primal receiving side. |
[in] | primalFunction | The mpi function for the primal evaluation on the unmodified AD types. This function is called if the buffers are reduced locally and the reduction needs to be recorded by the AD tool. |
[in] | primalFunctionCommute | If the primal function commutes. |
[in] | modifiedPrimalFunction | The mpi function for the primal evaluation of the modifed AD types. This function is called during a MPI transaction, so the AD tool should not record anything. |
[in] | modifiedPrimalFunctionCommute | If the modified primal function commutes. |
[in] | preAdjointOperation | The operation that is evaluated on the adjoint values before they are send. |
[in] | postAdjointOperation | The operation that is evaluated on the adjoint values after they are received. |
|
inline |
Creates an operator that has no special adjoint handling.
If AD types are in this operator, the reduce operations are evaluated locally by performing first a gather operation and the then the reduce.
The AD tool needs to record the opertions when the user function is evaluated.
[in] | op | An existing MPI operator. |
|
inline |
Creates an operator that has no special adjoint handling.
If AD types are in this operator, the reduce operations are evaluated locally by performing first a gather operation and the then the reduce.
The AD tool needs to record the opertions when the user function is evaluated.
[in] | user_fn | The function for the operation. |
[in] | commute | If the operations commutes. |
bool medi::AMPI_Op::hasAdjoint |
Indicates if the user has provided a specialized adjoint handling for the operator.
MPI_Op medi::AMPI_Op::modifiedPrimalFunction |
The mpi operator for the modified AD types. This are the operations that are evaluated during the mpi transactions.
This operator is used when the user has created a specialized operator for the adjoint communication.
PostAdjointOperation medi::AMPI_Op::postAdjointOperation |
The operation that is evaluated on each adjoint after the values have been received in a message.
PreAdjointOperation medi::AMPI_Op::preAdjointOperation |
The operation that is evaluated on each adjoint value before they are send in a message.
MPI_Op medi::AMPI_Op::primalFunction |
The mpi operator for the unmodified AD types. The AD tool needs to record all operations that are evaluated with this operator.
This operator is used when no specialized adjoint operation is available. Then the buffers are gathered and afterwards the reduction is performed locally.
bool medi::AMPI_Op::requiresPrimal |
Indicates if the primal on the sending and receiving side are required by this operator.
bool medi::AMPI_Op::requiresPrimalSend |
Indicates if the primal on the receiving side needs to be send to the sending side.