source: proiecte/hpl/openmpi_compiled/share/man/man3/MPI_Scatter.3 @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 5.8 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Scatter 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Scatter\fP \- Sends data from one task to all tasks in a group.
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Scatter(void *\fIsendbuf\fP, int\fI sendcount\fP, MPI_Datatype\fI sendtype\fP,
13        void\fI *recvbuf\fP, int\fI recvcount\fP, MPI_Datatype\fI recvtype\fP, int\fI root\fP,
14        MPI_Comm\fI comm\fP)
15
16.SH Fortran Syntax
17.nf
18INCLUDE 'mpif.h'
19MPI_SCATTER(\fISENDBUF, SENDCOUNT, SENDTYPE, RECVBUF, RECVCOUNT,
20                RECVTYPE, ROOT, COMM, IERROR\fP)
21        <type>  \fISENDBUF(*), RECVBUF(*)\fP
22        INTEGER \fISENDCOUNT, SENDTYPE, RECVCOUNT, RECVTYPE, ROOT\fP
23        INTEGER \fICOMM, IERROR\fP
24
25.SH C++ Syntax
26.nf
27#include <mpi.h>
28void MPI::Comm::Scatter(const void* \fIsendbuf\fP, int \fIsendcount\fP,
29        const MPI::Datatype& \fIsendtype\fP, void* \fIrecvbuf\fP,
30        int \fIrecvcount\fP, const MPI::Datatype& \fIrecvtype\fP,
31        int \fIroot\fP) const
32
33.SH INPUT PARAMETERS
34.ft R
35.TP 1i
36sendbuf
37Address of send buffer (choice, significant only at root).
38.TP 1i
39sendcount
40Number of elements sent to each process (integer, significant only at
41root).
42.TP 1i
43sendtype
44Datatype of send buffer elements (handle, significant only at root).
45.TP 1i
46recvcount
47Number of elements in receive buffer (integer).
48.TP 1i
49recvtype
50Datatype of receive buffer elements (handle).
51.TP 1i
52root
53Rank of sending process (integer).
54.TP 1i
55comm
56Communicator (handle).
57
58.SH OUTPUT PARAMETERS
59.ft R
60.TP 1i
61recvbuf
62Address of receive buffer (choice).
63.ft R
64.TP 1i
65IERROR
66Fortran only: Error status (integer).
67
68.SH DESCRIPTION
69.ft R
70MPI_Scatter is the inverse operation to MPI_Gather.
71.sp
72The outcome is as if the root executed n send operations, 
73.sp
74.nf
75    MPI_Send(sendbuf + i * sendcount * extent(sendtype), sendcount,
76             sendtype, i, \&...)
77.fi
78.sp
79and each process executed a receive, 
80.sp
81.nf
82    MPI_Recv(recvbuf, recvcount, recvtype, i, \&...).
83.fi
84.sp
85An alternative description is that the root sends a message with
86MPI_Send(\fIsendbuf\fP, \fIsendcount\fP * \fIn\fP,\ \fIsendtype\fP, \&...). This message is split
87into \fIn\fP equal segments, the ith segment is sent to the ith process in the
88group, and each process receives this message as above.
89.sp
90The send buffer is ignored for all nonroot processes.
91.sp
92The type signature associated with \fIsendcount\fP, \fIsendtype\fP at the root must be
93equal to the type signature associated with \fIrecvcount\fP, \fIrecvtype\fP at all
94processes (however, the type maps may be different). This implies that the
95amount of data sent must be equal to the amount of data received, pairwise
96between each process and the root. Distinct type maps between sender and
97receiver are still allowed.
98.sp
99All arguments to the function are significant on process \fIroot\fP, while on
100other processes, only arguments \fIrecvbuf\fP, \fIrecvcount\fP, \fIrecvtype\fP, \fIroot\fP, \fIcomm\fP
101are significant. The arguments \fIroot\fP and \fIcomm\fP must have identical values on
102all processes.
103.sp
104The specification of counts and types should not cause any location on the
105root to be read more than once.
106.sp
107\fBRationale:\fR Though not needed, the last restriction is imposed so as
108to achieve symmetry with MPI_Gather, where the corresponding restriction (a
109multiple-write restriction) is necessary.
110.sp
111\fBExample:\fR The reverse of Example 1 in the MPI_Gather manpage. Scatter
112sets of 100 ints from the root to each process in the group. 
113.sp
114.nf
115        MPI_Comm comm;
116        int gsize,*sendbuf;
117        int root, rbuf[100];
118        \&...
119        MPI_Comm_size(comm, &gsize);
120        sendbuf = (int *)malloc(gsize*100*sizeof(int));
121        \&...
122        MPI_Scatter(sendbuf, 100, MPI_INT, rbuf, 100,
123                    MPI_INT, root, comm);
124.fi
125
126.SH USE OF IN-PLACE OPTION
127When the communicator is an intracommunicator, you can perform a gather operation in-place (the output buffer is used as the input buffer).  Use the variable MPI_IN_PLACE as the value of the root process \fIrecvbuf\fR.  In this case, \fIrecvcount\fR and \fIrecvtype\fR are ignored, and the root process sends no data to itself.   
128.sp
129Note that MPI_IN_PLACE is a special kind of value; it has the same restrictions on its use as MPI_BOTTOM.
130.sp
131Because the in-place option converts the receive buffer into a send-and-receive buffer, a Fortran binding that includes INTENT must mark these as INOUT, not OUT.   
132.sp
133.SH WHEN COMMUNICATOR IS AN INTER-COMMUNICATOR
134.sp
135When the communicator is an inter-communicator, the root process in the first group sends data to all processes in the second group.  The first group defines the root process.  That process uses MPI_ROOT as the value of its \fIroot\fR argument.  The remaining processes use MPI_PROC_NULL as the value of their \fIroot\fR argument.  All processes in the second group use the rank of that root process in the first group as the value of their \fIroot\fR argument.   The receive buffer argument of the root process in the first group must be consistent with the receive buffer argument of the processes in the second group.   
136.sp 
137.SH ERRORS
138Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ functions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object.
139.sp
140Before the error value is returned, the current MPI error handler is
141called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error. 
142
143.SH SEE ALSO
144.ft R
145.sp
146.nf
147MPI_Scatterv
148MPI_Gather
149MPI_Gatherv
150
Note: See TracBrowser for help on using the repository browser.