MPI_OP_CREATE, MPI_Op_create Purpose Binds a user-defined reduction operation to an op handle. C synopsis #include int MPI_Op_create(MPI_User_function *function,int commute,MPI_Op *op); C++ synopsis #include mpi.h void MPI::Op::Init(MPI::User_function *func, bool commute); FORTRAN synopsis include 'mpif.h' or use mpi MPI_OP_CREATE(EXTERNAL FUNCTION,INTEGER COMMUTE,INTEGER OP,INTEGER IERROR) Parameters function is the user-defined reduction function (function) (IN) commute is true if commutative; otherwise it is false (IN) op is the reduction operation (handle) (OUT) IERROR is the FORTRAN return code. It is always the last argument. Description This subroutine binds a user-defined reduction operation to an op handle which you can then use in MPI_REDUCE, MPI_ALLREDUCE, MPI_REDUCE_SCATTER and MPI_SCAN and their nonblocking equivalents. The user-defined operation is assumed to be associative. If commute = true, then the operation must be both commutative and associative. If commute = false, then the order of the operation is fixed. The order is defined in ascending, task rank order and begins with task zero. function is a user-defined function. It must have the following four arguments: invec, inoutvec, len, and datatype. The following is the ANSI-C prototype for the function: typedef void MPI_User_function(void *invec, void *inoutvec, int *len, MPI_Datatype *datatype); The following is the FORTRAN declaration for the function: SUBROUTINE USER_FUNCTION(INVEC(*), INOUTVEC(*), LEN, TYPE) INVEC(LEN), INOUTVEC(LEN) INTEGER LEN, TYPE Notes See IBM Parallel Environment for AIX: MPI Programming Guide for information about reduction functions. Errors Null function MPI not initialized MPI already finalized Related information MPI_ALLREDUCE MPI_OP_FREE MPI_REDUCE MPI_REDUCE_SCATTER