42 #include "Teuchos_MpiReductionOpSetter.hpp"
43 #include "Teuchos_OpaqueWrapper.hpp"
47 #define CALL_API MPIAPI
63 void CALL_API Teuchos_MPI_reduction_op(
67 ,MPI_Datatype *datatype
70 void Teuchos_MPI_Op_free( MPI_Op *op )
104 return the_reduct_op;
113 if(!the_mpi_op.
get()) {
114 MPI_Op mpi_op = MPI_OP_NULL;
116 0!=MPI_Op_create( &Teuchos_MPI_reduction_op ,1 ,&mpi_op )
118 the_mpi_op = Teuchos::opaqueWrapper(mpi_op,Teuchos_MPI_Op_free);
120 the_reduct_op = reduct_op;
126 void CALL_API Teuchos_MPI_reduction_op(
130 ,MPI_Datatype *datatype
133 get_reduct_op()->reduce(invec,inoutvec,len,datatype);
140 MpiReductionOpSetter::MpiReductionOpSetter(
147 set_reduct_op(reduct_op);
152 set_reduct_op( null );
157 return (*the_mpi_op)();
T * get() const
Get the raw C++ pointer to the underlying object.
MPI_Op mpi_op() const
Return the created MPI_Op reduction object that can be used by MPI.
A MPI utilities class, providing methods for initializing, finalizing, and querying the global MPI se...
Smart reference counting pointer class for automatic garbage collection.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
This macro is designed to be a short version of TEUCHOS_TEST_FOR_EXCEPTION() that is easier to call...