MPI_Gather_init(3)
π MPI_Gather_init(3) π
okay bestie, welcome to the MPI manual, page MPI_Gather_init(3) β yes it's the real deal, section 3 of the MPI manual, and we're about to make a persistent request for a gather. no cap.
β¨ NAME β¨
MPI_Gather_init β Create a persistent request for gather. that's it, that's the whole job. she creates, she persists, she serves. π
πΈ SYNOPSIS πΈ
int MPI_Gather_init(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
int root, MPI_Comm comm, MPI_Info info,
MPI_Request *request)
int MPI_Gather_init_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf, MPI_Count recvcount,
MPI_Datatype recvtype, int root, MPI_Comm comm,
MPI_Info info, MPI_Request *request)
look at her. two whole signatures. the _c one is the big-count version, iykyk. π¦
π INPUT PARAMETERS π
sendbufβ starting address of send buffer (choice). where your lil data lives before it goes on its journey.sendcountβ number of elements in send buffer (non-negative integer). must be non-negative, we do not do negative counts here. πsendtypeβ data type of send buffer elements (handle). tell her what she's sending, be specific.recvcountβ number of elements for any single receive (non-negative integer). any single receive, okay? non-negative, always.recvtypeβ data type of recv buffer elements (handle).rootβ rank of receiving process (integer). this is the main character of the operation, everyone's gathering for them. πcommβ communicator (handle). the group chat. π¬infoβ info argument (handle).
π«Ά OUTPUT PARAMETERS π«Ά
recvbufβ address of receive buffer (choice). where the goodies land.requestβ communication request (handle). this is the persistent request itself, the whole point, the moment. β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. and by that we mean: you can let multiple threads hit this routine at the same time and you do not need to bring your own user-provided thread locks. she handles it, she's responsible, she's grown. π
HOWEVER. bestie. she is not interrupt safe. and typically that's because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. it's giving "can multitask but do NOT startle her". π
π§ NOTES FOR FORTRAN π§
- All MPI routines in Fortran (except for
MPI_WTIMEandMPI_WTICK) have an additional argumentierrat the end of the argument list.ierris an integer and has the same meaning as the return value of the routine in C. - In Fortran, MPI routines are subroutines, and they are invoked with the
callstatement. different language, different grammar, same queen behavior. - All MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran.
π ERRORS π
All MPI routines (except MPI_Wtime and MPI_Wtick) return an error value; C routines as the value of the function and Fortran routines in the last argument. Before the value is returned, the current MPI error handler is called. By default, this error handler aborts the MPI job β like, actually ends everything, no coming back. π
The error handler may be changed with MPI_Comm_set_errhandler (for communicators), MPI_File_set_errhandler (for files), and MPI_Win_set_errhandler (for RMA windows). The MPI-1 routine MPI_Errhandler_set may be used but its use is deprecated (we don't do that anymore, she's retired).
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; however, MPI implementations will attempt to continue whenever possible. optimistic queens only. π
MPI_SUCCESSβ No error; MPI routine completed successfully. ate. πMPI_ERR_ARGβ Invalid argument. Some argument is invalid and is not identified by a specific error class (e.g.,MPI_ERR_RANK).MPI_ERR_BUFFERβ Invalid buffer pointer. Usually a null buffer where one is not valid.MPI_ERR_COMMβ Invalid communicator. A common error is to use a null communicator in a call (not even allowed inMPI_Comm_rank). πMPI_ERR_COUNTβ Invalid count argument. Count arguments must be non-negative; a count of zero is often valid.MPI_ERR_INFOβ Invalid InfoMPI_ERR_TYPEβ Invalid datatype argument. Additionally, this error can occur if an uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. commit your types first, bestie!! πMPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
okay that's the whole page, you're welcome, go forth and persist your requests responsibly π
this was MPI_Gather_init(3), dated 4/10/2026 β mwah, love you, bye π
π¦ where this page comes from
- nixos 26.05: mpich 5.0.1
- ubuntu stonking: mpich-doc 5.0.1-9 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms