1 | .\"Copyright 2006-2008 Sun Microsystems, Inc. |
---|
2 | .\" Copyright (c) 1996 Thinking Machines Corporation |
---|
3 | .TH MPI_Exscan 3 "Dec 08, 2009" "1.4" "Open MPI" |
---|
4 | |
---|
5 | .SH NAME |
---|
6 | \fBMPI_Exscan\fP \- Computes an exclusive scan (partial reduction) |
---|
7 | |
---|
8 | .SH SYNTAX |
---|
9 | .ft R |
---|
10 | |
---|
11 | .SH C Syntax |
---|
12 | .nf |
---|
13 | #include <mpi.h> |
---|
14 | int MPI_Exscan(void *\fIsendbuf\fP, void *\fIrecvbuf\fP, int \fIcount\fP, |
---|
15 | MPI_Datatype \fIdatatype\fP, MPI_Op \fIop\fP, MPI_Comm \fIcomm\fP) |
---|
16 | |
---|
17 | .SH Fortran Syntax |
---|
18 | .nf |
---|
19 | INCLUDE 'mpif.h' |
---|
20 | MPI_SCAN(\fISENDBUF, RECVBUF, COUNT, DATATYPE, OP, COMM, IERROR\fP) |
---|
21 | <type> \fISENDBUF(*), RECVBUF(*)\fP |
---|
22 | INTEGER \fICOUNT, DATATYPE, OP, COMM, IERROR\fP |
---|
23 | |
---|
24 | .SH C++ Syntax |
---|
25 | .nf |
---|
26 | #include <mpi.h> |
---|
27 | void MPI::Intracomm::Exscan(const void* \fIsendbuf\fP, void* \fIrecvbuf\fP, |
---|
28 | int \fIcount\fP, const MPI::Datatype& \fIdatatype\fP, |
---|
29 | const MPI::Op& \fIop\fP) const |
---|
30 | |
---|
31 | .SH INPUT PARAMETERS |
---|
32 | .ft R |
---|
33 | .TP 1i |
---|
34 | sendbuf |
---|
35 | Send buffer (choice). |
---|
36 | .TP 1i |
---|
37 | count |
---|
38 | Number of elements in input buffer (integer). |
---|
39 | .TP 1i |
---|
40 | datatype |
---|
41 | Data type of elements of input buffer (handle). |
---|
42 | .TP 1i |
---|
43 | op |
---|
44 | Operation (handle). |
---|
45 | .TP 1i |
---|
46 | comm |
---|
47 | Communicator (handle). |
---|
48 | |
---|
49 | .SH OUTPUT PARAMETERS |
---|
50 | .ft R |
---|
51 | .TP 1i |
---|
52 | recvbuf |
---|
53 | Receive buffer (choice). |
---|
54 | .ft R |
---|
55 | .TP 1i |
---|
56 | IERROR |
---|
57 | Fortran only: Error status (integer). |
---|
58 | |
---|
59 | .SH DESCRIPTION |
---|
60 | .ft R |
---|
61 | MPI_Exscan is used to perform an exclusive prefix reduction on data |
---|
62 | distributed across the calling processes. The operation returns, in |
---|
63 | the \fIrecvbuf\fP of the process with rank i, the reduction |
---|
64 | (calculated according to the function \fIop\fP) of the values in the |
---|
65 | \fIsendbuf\fPs of processes with ranks 0, ..., i-1. Compare this with |
---|
66 | the functionality of MPI_Scan, which calculates over the range 0, ..., |
---|
67 | i (inclusive). The type of operations supported, their semantics, and |
---|
68 | the constraints on send and receive buffers are as for MPI_Reduce. |
---|
69 | .sp |
---|
70 | The value in \fIrecvbuf\fP on process 0 is undefined and unreliable |
---|
71 | as \fIrecvbuf\fP is not significant for process 0. The value of |
---|
72 | \fIrecvbuf\fP on process 1 is always the value in \fIsendbuf\fP on |
---|
73 | process 0. |
---|
74 | .sp |
---|
75 | No MPI_IN_PLACE operation is supported. |
---|
76 | |
---|
77 | .SH NOTES |
---|
78 | .ft R |
---|
79 | MPI does not specify which process computes which operation. In |
---|
80 | particular, both processes 0 and 1 may participate in the computation |
---|
81 | even though the results for both processes' \fIrecvbuf\fP are |
---|
82 | degenerate. Therefore, all processes, including 0 and 1, must provide |
---|
83 | the same \fIop\fP. |
---|
84 | .sp |
---|
85 | It can be argued, from a mathematical perspective, that the definition |
---|
86 | of MPI_Exscan is unsatisfactory because the output at process 0 is |
---|
87 | undefined. The "mathematically correct" output for process 0 would be |
---|
88 | the unit element of the reduction operation. However, such a |
---|
89 | definition of an exclusive scan would not work with user-defined |
---|
90 | \fIop\fP functions as there is no way for MPI to "know" the unit value |
---|
91 | for these custom operations. |
---|
92 | |
---|
93 | .SH NOTES ON COLLECTIVE OPERATIONS |
---|
94 | .ft R |
---|
95 | The reduction functions of type MPI_Op do not return an error value. |
---|
96 | As a result, if the functions detect an error, all they can do is |
---|
97 | either call MPI_Abort or silently skip the problem. Thus, if the |
---|
98 | error handler is changed from MPI_ERRORS_ARE_FATAL to something else |
---|
99 | (e.g., MPI_ERRORS_RETURN), then no error may be indicated. |
---|
100 | .sp |
---|
101 | The reason for this is the performance problems in ensuring that |
---|
102 | all collective routines return the same error value. |
---|
103 | |
---|
104 | .SH ERRORS |
---|
105 | .ft R |
---|
106 | Almost all MPI routines return an error value; C routines as |
---|
107 | the value of the function and Fortran routines in the last argument. C++ |
---|
108 | functions do not return errors. If the default error handler is set to |
---|
109 | MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism |
---|
110 | will be used to throw an MPI:Exception object. |
---|
111 | .sp |
---|
112 | Before the error value is returned, the current MPI error handler is |
---|
113 | called. By default, this error handler aborts the MPI job, except for |
---|
114 | I/O function errors. The error handler may be changed with |
---|
115 | MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN |
---|
116 | may be used to cause error values to be returned. Note that MPI does not |
---|
117 | guarantee that an MPI program can continue past an error. |
---|
118 | .sp |
---|
119 | See the MPI man page for a full list of MPI error codes. |
---|
120 | |
---|
121 | .SH SEE ALSO |
---|
122 | .ft R |
---|
123 | .nf |
---|
124 | MPI_Op_create |
---|
125 | MPI_Reduce |
---|
126 | MPI_Scan |
---|
127 | |
---|