Purpose
Performs a prefix reduction on data distributed across the group.
C synopsis
#include <mpi.h> int MPI_Exscan(void *sendbuf, void *recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm);
C++ synopsis
#include mpi.h
void MPI::Intracomm::Exscan(const void* sendbuf, void* recvbuf, int count,
const MPI::Datatype& datatype, const MPI::Op& op) const;
FORTRAN synopsis
include 'mpif.h' or use mpi MPI_EXSCAN(CHOICE SENDBUF, CHOICE RECVBUF, INTEGER COUNT, INTEGER DATATYPE, INTEGER OP, INTEGER COMM, INTEGER IERROR)
Parameters
Description
Use this subroutine to perform a prefix reduction operation on data distributed across a group. The value in recvbuf on the task with rank 0 is undefined, and recvbuf is not signficant on task 0. The value in recvbuf on the task with rank 1 is defined as the value in sendbuf on the task with rank 0. For tasks with rank i > 1, the operation returns, in the receive buffer of the task with rank i, the reduction of the values in the send buffers of tasks with ranks 0,...,i -1 (inclusive). The type of operations supported, their semantics, and the constraints on send and receive buffers, are as for MPI_REDUCE.
MPI_EXSCAN is not supported for intercommunicators and does not accept MPI_IN_PLACE.
When you use this subroutine in a threads application, make sure all collective operations on a particular communicator occur in the same order at each task. See IBM Parallel Environment for AIX: MPI Programming Guide for more information on programming with MPI in a threads environment.
Notes
As for MPI_SCAN, MPI does not specify which tasks can call the reduction operation, only that the result be correctly computed. In particular, note that the task with rank 1 need not call the MPI_Op, because all it needs to do is to receive the value from the task with rank 0. However, all tasks, even the tasks with ranks 0 and 1, must provide the same op.
Errors
Fatal errors:
Develop mode error if:
Related information