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

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

Adding compiled files

File size: 5.7 KB
Line 
1.\"Copyright 2006-2008 Sun Microsystems, Inc.
2.\" Copyright (c) 1996 Thinking Machines Corporation
3.TH MPI_Allgather 3 "Dec 08, 2009" "1.4" "Open MPI"
4.SH NAME
5\fBMPI_Allgather\fP \- Gathers data from all processes and distributes it to all processes
6
7.SH SYNTAX
8.ft R
9.SH C Syntax
10.nf
11#include <mpi.h>
12int MPI_Allgather(void\fI *sendbuf\fP, int \fI sendcount\fP,
13        MPI_Datatype\fI sendtype\fP, void\fI *recvbuf\fP, int\fI recvcount\fP,
14         MPI_Datatype\fI recvtype\fP, MPI_Comm\fI comm\fP)
15
16.SH Fortran Syntax
17.nf
18INCLUDE 'mpif.h'
19MPI_ALLGATHER(\fISENDBUF\fP,\fI SENDCOUNT\fP,\fI SENDTYPE\fP,\fI RECVBUF\fP,\fI RECVCOUNT\fP,\fI
20                RECVTYPE\fP,\fI COMM\fP,\fI IERROR\fP)
21        <type>  \fISENDBUF\fP (*), \fIRECVBUF\fP (*)
22        INTEGER \fISENDCOUNT\fP,\fI SENDTYPE\fP,\fI RECVCOUNT\fP,\fI RECVTYPE\fP,\fI COMM\fP,
23        INTEGER \fIIERROR\fP 
24
25.SH C++ Syntax
26.nf
27#include <mpi.h>
28void MPI::Comm::Allgather(const void* \fIsendbuf\fP, int \fIsendcount\fP, const
29        MPI::Datatype& \fIsendtype\fP, void* \fIrecvbuf\fP, int \fIrecvcount\fP,
30        const MPI::Datatype& \fIrecvtype\fP) const = 0
31
32.SH INPUT PARAMETERS
33.ft R
34.TP 1i
35sendbuf   
36Starting address of send buffer (choice).
37.TP 1i
38sendcount   
39Number of elements in send buffer (integer).
40.TP 1i
41sendtype   
42Datatype of send buffer elements (handle).
43.TP 1i
44recvcount   
45Number of elements received from any process (integer).
46.TP 1i
47recvtype   
48Datatype of receive buffer elements (handle).
49.TP 1i
50comm   
51Communicator (handle).
52
53.SH OUTPUT PARAMETERS
54.ft R
55.TP 1i
56recvbuf   
57Address of receive buffer (choice).
58.ft R
59.TP 1i
60IERROR
61Fortran only: Error status (integer).
62
63.SH DESCRIPTION
64.ft R
65MPI_Allgather is similar to MPI_Gather, except that all processes receive the result, instead of just the root. In other words, all processes contribute to the result, and all processes receive the result. 
66.sp
67The type signature associated with sendcount, sendtype at a process must be equal to the type signature associated with recvcount, recvtype at any other process.
68.sp
69The outcome of a call to MPI_Allgather(\&...) is as if all processes executed n calls to     
70.sp
71.nf
72  MPI_Gather(sendbuf,sendcount,sendtype,recvbuf,recvcount,
73             recvtype,root,comm),
74.sp
75.fi
76for root = 0 , ..., n-1. The rules for correct usage of MPI_Allgather are easily found from the corresponding rules for MPI_Gather.
77.sp
78\fBExample:\fR The all-gather version of Example 1 in MPI_Gather. Using  MPI_Allgather, we will gather 100 ints from every process in the group to every process.
79.sp
80.nf
81MPI_Comm comm;
82    int gsize,sendarray[100];
83    int *rbuf;
84    \&...
85    MPI_Comm_size( comm, &gsize);
86    rbuf = (int *)malloc(gsize*100*sizeof(int));
87    MPI_Allgather( sendarray, 100, MPI_INT, rbuf, 100, MPI_INT, comm);
88.fi
89.sp
90After the call, every process has the group-wide concatenation of the sets of data.
91
92.SH USE OF IN-PLACE OPTION
93When the communicator is an intracommunicator, you can perform an all-gather operation in-place (the output buffer is used as the input buffer).  Use the variable MPI_IN_PLACE as the value of both \fIsendbuf\fR and \fIrecvbuf\fR.  In this case, \fIsendcount\fR and \fIsendtype\fR are ignored.  The input data of each process is assumed to be in the area where that process would receive its own contribution to the receive buffer.  Specifically, the outcome of a call to MPI_Allgather that used the in-place option is identical to the case in which all processes executed \fIn\fR calls to
94.sp
95.nf
96   MPI_GATHER ( MPI_IN_PLACE, 0, MPI_DATATYPE_NULL, recvbuf,
97   recvcount, recvtype, root, comm )
98
99for root =0, ... , n-1.
100.fi
101.sp
102Note that MPI_IN_PLACE is a special kind of value; it has the same restrictions on its use as MPI_BOTTOM.
103.sp
104Because 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.   
105.sp
106.SH WHEN COMMUNICATOR IS AN INTER-COMMUNICATOR
107.sp
108When the communicator is an inter-communicator, the gather operation occurs in two phases.  The data is gathered from all the members of the first group and received by all the members of the second group.  Then the data is gathered from all the members of the second group and received by all the members of the first.  The operation, however, need not be symmetric.  The number of items sent by the processes in first group need not be equal to the number of items sent by the the processes in the second group.  You can move data in only one direction by giving \fIsendcount\fR a value of 0 for communication in the reverse direction. 
109.sp
110The first group defines the root process.  The root process uses MPI_ROOT as the value of \fIroot\fR.  All other processes in the first group use MPI_PROC_NULL as the value of \fIroot\fR.  All processes in the second group use the rank of the root process in the first group as the value of \fIroot\fR.
111.sp
112When the communicator is an intra-communicator, these groups are the same, and the operation occurs in a single phase.
113.sp 
114
115
116.SH ERRORS
117Almost 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.
118.sp
119Before the error value is returned, the current MPI error handler is
120called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler
121may 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. 
122
123.SH SEE ALSO
124.ft R
125.sp
126MPI_Allgatherv
127.br
128MPI_Gather
129
Note: See TracBrowser for help on using the repository browser.