|
Packit |
0848f5 |
.TH MPI_Allgather 3 "11/10/2017" " " "MPI"
|
|
Packit |
0848f5 |
.SH NAME
|
|
Packit |
0848f5 |
MPI_Allgather \- Gathers data from all tasks and distribute the combined data to all tasks
|
|
Packit |
0848f5 |
.SH SYNOPSIS
|
|
Packit |
0848f5 |
.nf
|
|
Packit |
0848f5 |
int MPI_Allgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
|
|
Packit |
0848f5 |
void *recvbuf, int recvcount, MPI_Datatype recvtype,
|
|
Packit |
0848f5 |
MPI_Comm comm)
|
|
Packit |
0848f5 |
.fi
|
|
Packit |
0848f5 |
.SH INPUT PARAMETERS
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B sendbuf
|
|
Packit |
0848f5 |
- starting address of send buffer (choice)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B sendcount
|
|
Packit |
0848f5 |
- number of elements in send buffer (integer)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B sendtype
|
|
Packit |
0848f5 |
- data type of send buffer elements (handle)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B recvcount
|
|
Packit |
0848f5 |
- number of elements received from any process (integer)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B recvtype
|
|
Packit |
0848f5 |
- data type of receive buffer elements (handle)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B comm
|
|
Packit |
0848f5 |
- communicator (handle)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.SH OUTPUT PARAMETERS
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B recvbuf
|
|
Packit |
0848f5 |
- address of receive buffer (choice)
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.SH NOTES
|
|
Packit |
0848f5 |
The MPI standard (1.0 and 1.1) says that
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
The jth block of data sent from each process is received by every process
|
|
Packit |
0848f5 |
and placed in the jth block of the buffer
|
|
Packit |
0848f5 |
.I recvbuf
|
|
Packit |
0848f5 |
\&.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
This is misleading; a better description is
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
The block of data sent from the jth process is received by every
|
|
Packit |
0848f5 |
process and placed in the jth block of the buffer
|
|
Packit |
0848f5 |
.I recvbuf
|
|
Packit |
0848f5 |
\&.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.br
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
This text was suggested by Rajeev Thakur and has been adopted as a
|
|
Packit |
0848f5 |
clarification by the MPI Forum.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.SH THREAD AND INTERRUPT SAFETY
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
This routine is thread-safe. This means that this routine may be
|
|
Packit |
0848f5 |
safely used by multiple threads without the need for any user-provided
|
|
Packit |
0848f5 |
thread locks. However, the routine is not interrupt safe. Typically,
|
|
Packit |
0848f5 |
this is due to the use of memory allocation routines such as
|
|
Packit |
0848f5 |
.I malloc
|
|
Packit |
0848f5 |
or other non-MPICH runtime routines that are themselves not interrupt-safe.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.SH NOTES FOR FORTRAN
|
|
Packit |
0848f5 |
All MPI routines in Fortran (except for
|
|
Packit |
0848f5 |
.I MPI_WTIME
|
|
Packit |
0848f5 |
and
|
|
Packit |
0848f5 |
.I MPI_WTICK
|
|
Packit |
0848f5 |
) have
|
|
Packit |
0848f5 |
an additional argument
|
|
Packit |
0848f5 |
.I ierr
|
|
Packit |
0848f5 |
at the end of the argument list.
|
|
Packit |
0848f5 |
.I ierr
|
|
Packit |
0848f5 |
is an integer and has the same meaning as the return value of the routine
|
|
Packit |
0848f5 |
in C. In Fortran, MPI routines are subroutines, and are invoked with the
|
|
Packit |
0848f5 |
.I call
|
|
Packit |
0848f5 |
statement.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
All MPI objects (e.g.,
|
|
Packit |
0848f5 |
.I MPI_Datatype
|
|
Packit |
0848f5 |
,
|
|
Packit |
0848f5 |
.I MPI_Comm
|
|
Packit |
0848f5 |
) are of type
|
|
Packit |
0848f5 |
.I INTEGER
|
|
Packit |
0848f5 |
in Fortran.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.SH ERRORS
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
All MPI routines (except
|
|
Packit |
0848f5 |
.I MPI_Wtime
|
|
Packit |
0848f5 |
and
|
|
Packit |
0848f5 |
.I MPI_Wtick
|
|
Packit |
0848f5 |
) return an error value;
|
|
Packit |
0848f5 |
C routines as the value of the function and Fortran routines in the last
|
|
Packit |
0848f5 |
argument. Before the value is returned, the current MPI error handler is
|
|
Packit |
0848f5 |
called. By default, this error handler aborts the MPI job. The error handler
|
|
Packit |
0848f5 |
may be changed with
|
|
Packit |
0848f5 |
.I MPI_Comm_set_errhandler
|
|
Packit |
0848f5 |
(for communicators),
|
|
Packit |
0848f5 |
.I MPI_File_set_errhandler
|
|
Packit |
0848f5 |
(for files), and
|
|
Packit |
0848f5 |
.I MPI_Win_set_errhandler
|
|
Packit |
0848f5 |
(for
|
|
Packit |
0848f5 |
RMA windows). The MPI-1 routine
|
|
Packit |
0848f5 |
.I MPI_Errhandler_set
|
|
Packit |
0848f5 |
may be used but
|
|
Packit |
0848f5 |
its use is deprecated. The predefined error handler
|
|
Packit |
0848f5 |
.I MPI_ERRORS_RETURN
|
|
Packit |
0848f5 |
may be used to cause error values to be returned.
|
|
Packit |
0848f5 |
Note that MPI does
|
|
Packit |
0848f5 |
.B not
|
|
Packit |
0848f5 |
guarentee that an MPI program can continue past
|
|
Packit |
0848f5 |
an error; however, MPI implementations will attempt to continue whenever
|
|
Packit |
0848f5 |
possible.
|
|
Packit |
0848f5 |
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B MPI_ERR_COMM
|
|
Packit |
0848f5 |
- Invalid communicator. A common error is to use a null
|
|
Packit |
0848f5 |
communicator in a call (not even allowed in
|
|
Packit |
0848f5 |
.I MPI_Comm_rank
|
|
Packit |
0848f5 |
).
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B MPI_ERR_COUNT
|
|
Packit |
0848f5 |
- Invalid count argument. Count arguments must be
|
|
Packit |
0848f5 |
non-negative; a count of zero is often valid.
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B MPI_ERR_TYPE
|
|
Packit |
0848f5 |
- Invalid datatype argument. Additionally, this error can
|
|
Packit |
0848f5 |
occur if an uncommitted MPI_Datatype (see
|
|
Packit |
0848f5 |
.I MPI_Type_commit
|
|
Packit |
0848f5 |
) is used
|
|
Packit |
0848f5 |
in a communication call.
|
|
Packit |
0848f5 |
.PD 1
|
|
Packit |
0848f5 |
.PD 0
|
|
Packit |
0848f5 |
.TP
|
|
Packit |
0848f5 |
.B MPI_ERR_BUFFER
|
|
Packit |
0848f5 |
- Invalid buffer pointer. Usually a null buffer where
|
|
Packit |
0848f5 |
one is not valid.
|
|
Packit |
0848f5 |
.PD 1
|