MPI_Neighbor_allgatherv_init(3)
π MPI_Neighbor_allgatherv_init(3) π
okay bestie, welcome to the MPI manual page for MPI_Neighbor_allgatherv_init, and yes we are doing this, we are learning MPI at 3am, this is the vibe π¦
β¨ NAME β¨
MPI_Neighbor_allgatherv_init β Create a persistent request for neighbor_allgatherv. that's it, that's the whole job π
πΈ SYNOPSIS πΈ
like literally just look at the signature bestie:
int MPI_Neighbor_allgatherv_init(const void *sendbuf, int sendcount,
MPI_Datatype sendtype, void *recvbuf,
const int recvcounts[], const int displs[],
MPI_Datatype recvtype, MPI_Comm comm,
MPI_Info info, MPI_Request *request)
int MPI_Neighbor_allgatherv_init_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf,
const MPI_Count recvcounts[],
const MPI_Aint displs[],
MPI_Datatype recvtype, MPI_Comm comm,
MPI_Info info, MPI_Request *request)
two of them!! the regular one and the _c one with the big MPI_Count / MPI_Aint energy, slay π
π INPUT PARAMETERS π
these are the things you hand over, no take-backs, they're the inputs:
sendbufβ starting address of send buffer (choice). where your lil data lives before it goes out into the world π«Άsendcountβ number of elements sent to each neighbor (non-negative integer). non-negative, bestie, don't try it πsendtypeβ data type of send buffer elements (handle)recvcountsβ non-negative integer array (of length indegree) containing the number of elements that are received from each neighbor (non-negative integer). one number per neighbor, keep track fr frdisplsβ integer array (of length indegree). Entryispecifies the displacement (relative torecvbuf) at which to place the incoming data from neighbori(integer). it's giving "coordinates, but for where stuff lands" β¨recvtypeβ data type of receive buffer elements (handle)commβ communicator with topology structure (handle). topology structure is the key phrase here, it's not just any old comm πinfoβ info argument (handle)
π OUTPUT PARAMETERS π
these are the things that come back to you, the glow-up your function gives you:
recvbufβ starting address of receive buffer (choice)requestβ communication request (handle). the persistent request!! that's the whole point, that's the main character π¦
π THREAD AND INTERRUPT SAFETY π
good news first: this routine is thread-safe. This means that this routine may be safely used by multiple threads without the need for any user-provided thread locks. yes queen, go parallel π
but. and it's a but. 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: yes. interrupts: absolutely not π
β NOTES FOR FORTRAN β
fortran besties, this part is for you:
- 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 are invoked with the
callstatement. - All MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran.
no cap, that's just how fortran rolls π
π ERRORS π
okay so buckle up, because this is the part where we talk about things going wrong:
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. π«Ά
here's the error tea:
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. bestie. the buffer. it's null. it's not supposed to be π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. the catch-all, the "idk what happened" of error codes π
and that's the page!! you understood it, I understood it, we're both MPI girlies now π
mwah π this has been the MPI manual, dated 4/10/2026, page MPI_Neighbor_allgatherv_init(3) β go write some persistent neighbor comms and text me when it compiles π¦β¨π
π¦ 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