MPI_Iallgather(3)
π MPI_Iallgather(3) π
okay bestie, welcome to the MPI manual page for MPI_Iallgather β yes that's the MPI section of the manual, and this is the nonblocking girlie of the gather family. Let's get into it β¨
π₯ NAME π₯
MPI_Iallgather β Gathers data from all tasks and distribute the combined data to all tasks in a nonblocking way
like. everyone yells their lil piece into the void, everyone gets the whole group chat back, and nobody sits around waiting because it's nonblocking. main character energy fr fr π
β¨ SYNOPSIS β¨
int MPI_Iallgather(const void *sendbuf, int sendcount, MPI_Datatype sendtype,
void *recvbuf, int recvcount, MPI_Datatype recvtype,
MPI_Comm comm, MPI_Request *request)
int MPI_Iallgather_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf, MPI_Count recvcount,
MPI_Datatype recvtype, MPI_Comm comm,
MPI_Request *request)
π«Ά INPUT PARAMETERS π«Ά
so these are the things you hand to the function. the gossip you're contributing, basically:
sendbufβ starting address of send buffer (choice). it's where your contribution lives, bestie πsendcountβ number of elements in send buffer (non-negative integer). count 'em, and no negatives allowed periodtsendtypeβ data type of send buffer elements (handle). tells MPI what flavour of thing you're shippingrecvcountβ number of elements received from any process (non-negative integer). again: non-negative, we don't do negative counts here πrecvtypeβ data type of receive buffer elements (handle)commβ communicator (handle). the group chat itself, iykyk
π OUTPUT PARAMETERS π
and these are what you get back. the tea β
recvbufβ address of receive buffer (choice). this is where everybody's contributions land. it's giving potluck πrequestβ communication request (handle). the lil ticket you hold onto so you can check on your nonblocking operation later πΈ
π THREAD AND INTERRUPT SAFETY π
okay important, bestie, listen up:
This routine is thread-safe. That means this routine may be safely used by multiple threads without the need for any user-provided thread locks. slay, no mutex required, we love to see it π
However, the routine is not interrupt safe. Typically, this is due to the use of memory allocation routines such as malloc or other non-MPICH runtime routines that are themselves not interrupt-safe.
so likeβ¦ threads? fine. interrupts? NOT fine. don't come for me π
π NOTES FOR FORTRAN π
fortran besties, this part is for you:
All MPI routines in Fortran (except for MPI_WTIME and MPI_WTICK ) have an additional argument ierr at the end of the argument list. ierr is an integer and has the same meaning as the return value of the routine in C. In Fortran, MPI routines are subroutines, and are invoked with the call statement.
All MPI objects (e.g., MPI_Datatype , MPI_Comm ) are of type INTEGER in Fortran.
like yes, everything is just an INTEGER over there, that's the vibe π¦
π 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. 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. 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.
default behaviour is literally "the whole job dies" so maybe set your errhandler before you get comfy π
here's the error code lineup:
MPI_SUCCESSβ No error; MPI routine completed successfully. the dream, the goal, the bare minimum π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. like bestie you gave me nothing π«MPI_ERR_COMMβ Invalid communicator. A common error is to use a null communicator in a call (not even allowed inMPI_Comm_rank). yes, evenMPI_Comm_rankwon't tolerate that nonsenseMPI_ERR_COUNTβ Invalid count argument. Count arguments must be non-negative; a count of zero is often valid. zero? maybe fine. negative? absolutely not.MPI_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, it's the law πMPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
and that's the whole page, no notes π§
this was MPI_Iallgather(3) from the MPI manual, dated 4/10/2026 β mwah, go forth and gather nonblockingly, bestie πβ¨
π¦ 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