MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
medi::AMPI_Op Struct Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AMPI_Op()

medi::AMPI_Op::AMPI_Op ( )
inline

Default constructor for static initialization.

On this constructed type one of the init method needs to be called.

Member Function Documentation

◆ free()

int medi::AMPI_Op::free ( )
inline

◆ init() [1/3]

int medi::AMPI_Op::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 )
inline

Creates an operator with a specialized adjoint handling.

Parameters
[in]requiresPrimalIf the adjoint operations require the primals in the sender/receiver side.
[in]requiresPrimalSendIf the adjoint operation on the primal sending side requires the primal result of the primal receiving side.
[in]primalFunctionThe 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]primalFunctionCommuteIf the primal function commutes.
[in]modifiedPrimalFunctionThe 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]modifiedPrimalFunctionCommuteIf the modified primal function commutes.
[in]preAdjointOperationThe operation that is evaluated on the adjoint values before they are send.
[in]postAdjointOperationThe operation that is evaluated on the adjoint values after they are received.
Returns
result of MPI_Op_create

◆ init() [2/3]

void medi::AMPI_Op::init ( MPI_Op op)
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.

Parameters
[in]opAn existing MPI operator.
Returns
Result of MPI_Op_Create

◆ init() [3/3]

int medi::AMPI_Op::init ( MPI_User_function * user_fn,
int commute )
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.

Parameters
[in]user_fnThe function for the operation.
[in]commuteIf the operations commutes.
Returns
Result of MPI_Op_Create

Member Data Documentation

◆ hasAdjoint

bool medi::AMPI_Op::hasAdjoint

Indicates if the user has provided a specialized adjoint handling for the operator.

◆ modifiedPrimalFunction

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

PostAdjointOperation medi::AMPI_Op::postAdjointOperation

The operation that is evaluated on each adjoint after the values have been received in a message.

◆ preAdjointOperation

PreAdjointOperation medi::AMPI_Op::preAdjointOperation

The operation that is evaluated on each adjoint value before they are send in a message.

◆ primalFunction

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.

◆ requiresPrimal

bool medi::AMPI_Op::requiresPrimal

Indicates if the primal on the sending and receiving side are required by this operator.

◆ requiresPrimalSend

bool medi::AMPI_Op::requiresPrimalSend

Indicates if the primal on the receiving side needs to be send to the sending side.


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