MPI_Ineighbor_alltoall(3)
π MPI_Ineighbor_alltoall β the glow-up edition π
okay bestie, pull up a chair, because we're talking about MPI_Ineighbor_alltoall, and it lives in the MPI manual (yes, section 3, the library-functions girlies). This is the nonblocking version of MPI_Neighbor_alltoall β same vibe, but it hands you a request instead of making you wait around. main character energy fr fr β¨
β¨ NAME β¨
MPI_Ineighbor_alltoall β Nonblocking version of MPI_Neighbor_alltoall. π
πΈ SYNOPSIS πΈ
int MPI_Ineighbor_alltoall(const void *sendbuf, int sendcount,
MPI_Datatype sendtype, void *recvbuf, int recvcount,
MPI_Datatype recvtype, MPI_Comm comm,
MPI_Request *request)
int MPI_Ineighbor_alltoall_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf,
MPI_Count recvcount, MPI_Datatype recvtype,
MPI_Comm comm, MPI_Request *request)
no cap, there are two of them β the classic one with plain int counts, and the _c one where the counts are MPI_Count so they can be big big big. π«Ά
π INPUT PARAMETERS π
sendbufβ starting address of send buffer (choice). this is where your stuff lives, bestie. πsendcountβ number of elements sent to each neighbor (non-negative integer). note the per neighbor part β this isn't the total, it's what each one gets. πsendtypeβ data type of send buffer elements (handle). β¨recvcountβ number of elements received from each neighbor (non-negative integer). again: each neighbor, not the grand total. πrecvtypeβ data type of receive buffer elements (handle). πΈcommβ communicator with topology structure (handle). it's gotta have a topology, iykyk. π¦
π OUTPUT PARAMETERS π
recvbufβ starting address of receive buffer (choice). where the incoming goodies land. πrequestβ communication request (handle). hold onto this one, because you'll need it to actually find out when this thing is done. β
π₯ THREAD AND INTERRUPT SAFETY π₯
This routine is thread-safe. πͺ what that means: multiple threads can use it at the same time and you do not need to bring your own user-provided thread locks. no gatekeeping, no drama. π«Ά
but β and this is the important part β it is not interrupt safe. π typically this is because it uses memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so likeβ¦ thread-safe yes, interrupt-safe no. don't get it twisted. π
π 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. periodt. π
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, even the ones that feel like they should be something fancier. π
π 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 π³ so likeβ¦ yeah, she's dramatic by default.
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. soβ¦ it might survive, it might not. vibe check at your own risk. πΈ
here's the full roster of error codes, no skipping, we don't do that here:
MPI_SUCCESSβ No error; MPI routine completed successfully. slay! β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. 0οΈβ£MPI_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 girlie, and honestlyMPI_Error_stringis your bestie here. π
and that's the whole page, babe. written up in the MPI manual, dated 4/10/2026 β go forth and alltoall your neighbors, nonblockingly, iconically. π¦β¨π
π¦ 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