1MPI_Gatherv(3) LAM/MPI MPI_Gatherv(3)
2
3
4
6 MPI_Gatherv - Gathers into specified locations from all processes in a
7 group
8
10 #include <mpi.h>
11 int MPI_Gatherv(void *sbuf, int scount, MPI_Datatype sdtype,
12 void *rbuf, int *rcounts, int *disps,
13 MPI_Datatype rdtype, int root, MPI_Comm comm)
14
16 sendbuf
17 - starting address of send buffer (choice)
18 sendcount
19 - number of elements in send buffer (integer)
20 sendtype
21 - data type of send buffer elements (handle)
22 recvcounts
23 - integer array (of length group size) containing the number of
24 elements that are received from each process (significant only
25 at root )
26 displs - integer array (of length group size). Entry i specifies the
27 displacement relative to recvbuf at which to place the incoming
28 data from process i (significant only at root)
29 recvtype
30 - data type of recv buffer elements (significant only at root )
31 (handle)
32 root - rank of receiving process (integer)
33 comm - communicator (handle)
34
35
37 recvbuf
38 - address of receive buffer (choice, significant only at root )
39
40
42 LAM/MPI does not yet support invoking this function on a communicator
43 that contains ranks that are non-local IMPI procs.
44
45
47 All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK ) have
48 an additional argument ierr at the end of the argument list. ierr is
49 an integer and has the same meaning as the return value of the routine
50 in C. In Fortran, MPI routines are subroutines, and are invoked with
51 the call statement.
52
53 All MPI objects (e.g., MPI_Datatype , MPI_Comm ) are of type INTEGER in
54 Fortran.
55
56
58 If an error occurs in an MPI function, the current MPI error handler is
59 called to handle it. By default, this error handler aborts the MPI
60 job. The error handler may be changed with MPI_Errhandler_set ; the
61 predefined error handler MPI_ERRORS_RETURN may be used to cause error
62 values to be returned (in C and Fortran; this error handler is less
63 useful in with the C++ MPI bindings. The predefined error handler
64 MPI::ERRORS_THROW_EXCEPTIONS should be used in C++ if the error value
65 needs to be recovered). Note that MPI does not guarantee that an MPI
66 program can continue past an error.
67
68 All MPI routines (except MPI_Wtime and MPI_Wtick ) return an error
69 value; C routines as the value of the function and Fortran routines in
70 the last argument. The C++ bindings for MPI do not return error val‐
71 ues; instead, error values are communicated by throwing exceptions of
72 type MPI::Exception (but not by default). Exceptions are only thrown
73 if the error value is not MPI::SUCCESS .
74
75
76 Note that if the MPI::ERRORS_RETURN handler is set in C++, while MPI
77 functions will return upon an error, there will be no way to recover
78 what the actual error value was.
79 MPI_SUCCESS
80 - No error; MPI routine completed successfully.
81 MPI_ERR_COMM
82 - Invalid communicator. A common error is to use a null commu‐
83 nicator in a call (not even allowed in MPI_Comm_rank ).
84 MPI_ERR_OTHER
85 - A collective implementation was not able to be located at run-
86 time for this communicator.
87 MPI_ERR_OTHER
88 - A communicator that contains some non-local IMPI procs was
89 used for some function which has not yet had the IMPI extensions
90 implemented yet. For example, most collectives on IMPI communi‐
91 cators have not been implemented yet.
92 MPI_ERR_TYPE
93 - Invalid datatype argument. May be an uncommitted MPI_Datatype
94 (see MPI_Type_commit ).
95 MPI_ERR_BUFFER
96 - Invalid buffer pointer. Usually a null buffer where one is
97 not valid.
98 MPI_ERR_ROOT
99 - Invalid root. The root must be specified as a rank in the
100 communicator. Ranks must be between zero and the size of the
101 communicator minus one.
102 MPI_ERR_ARG
103 - Invalid argument. Some argument is invalid and is not identi‐
104 fied by a specific error class. This is typically a NULL
105 pointer or other such error.
106
107
109 For more information, please see the official MPI Forum web site, which
110 contains the text of both the MPI-1 and MPI-2 standards. These docu‐
111 ments contain detailed information about each MPI function (most of
112 which is not duplicated in these man pages).
113
114 http://www.mpi-forum.org/
115
116
117
119 The LAM Team would like the thank the MPICH Team for the handy program
120 to generate man pages ("doctext" from ftp://ftp.mcs.anl.gov/pub/sow‐
121 ing/sowing.tar.gz ), the initial formatting, and some initial text for
122 most of the MPI-1 man pages.
123
125 gatherv.c
126
127
128
129LAM/MPI 7.1.2 2/23/2006 MPI_Gatherv(3)