MPI_Neighbor_allgather_init(3)
π MPI_Neighbor_allgather_init(3) π
okay bestie, so this one lives in the MPI manual section (section 3, the library-calls girlies π ), and it's MPI_Neighbor_allgather_init. she's the persistent-request version of neighbor_allgather, and she's lowkey iconic.
β¨ NAME β¨
MPI_Neighbor_allgather_init β Create a persistent request for neighbor_allgather. slay, that's literally the whole job π
πΈ SYNOPSIS πΈ
int MPI_Neighbor_allgather_init(const void *sendbuf, int sendcount,
MPI_Datatype sendtype, void *recvbuf,
int recvcount, MPI_Datatype recvtype,
MPI_Comm comm, MPI_Info info,
MPI_Request *request)
int MPI_Neighbor_allgather_init_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf,
MPI_Count recvcount, MPI_Datatype recvtype,
MPI_Comm comm, MPI_Info info,
MPI_Request *request)
two flavors, bestie: the regular one with int counts, and the _c one with MPI_Count counts for when you're being Extraβ’ with big numbers π¦
π«Ά INPUT PARAMETERS π«Ά
sendbufβ starting address of send buffer (choice). that's where the tea you're sending lives πsendcountβ number of elements sent to each neighbor (non-negative integer). per neighbor, not total, iykyksendtypeβ data type of send buffer elements (handle)recvcountβ number of elements received from each neighbor (non-negative integer)recvtypeβ data type of receive buffer elements (handle)commβ communicator with topology structure (handle). she needs the topo, no capinfoβ info argument (handle)
π OUTPUT PARAMETERS π
recvbufβ starting address of receive buffer (choice). where the incoming stuff lands πrequestβ communication request (handle). hold onto this one, she's your persistent girlie β¨
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. what that means: you can call it from multiple threads at the same time and you do not need to bring your own user-provided thread locks. no gatekeeping, no drama. periodt.
but heads up β the routine is not interrupt safe. typically this is because of memory allocation routines like malloc or other non-MPICH runtime routines, and those are themselves not interrupt-safe. so like... thread-safe β
, interrupt-safe π«. note the difference bestie, it matters.
π NOTES FOR FORTRAN π
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 β that's just how Fortran does, iconic honestly.
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, even the handles. 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 π (yes, for real, the whole 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 β don't do it bestie, that's not the move π.
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. so... sometimes she bounces back, sometimes she doesn't. no promises π§
MPI_SUCCESSβ No error; MPI routine completed successfully. we love to see it π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.MPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
ok that's the whole page bestie, go forth and make persistent requests responsibly π
and that's a wrap!! this was the MPI manual, dated 4/10/2026, and you've been reading MPI_Neighbor_allgather_init(3). mwah, 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