MPI_Neighbor_alltoall_init(3)
๐ฆ MPI_Neighbor_alltoall_init(3) ๐ฆ
okay bestie, welcome to the MPI manual, section 3, and today's main character is MPI_Neighbor_alltoall_init. it's giving persistent-request energy and honestly? we're obsessed. ๐
โจ NAME โจ
MPI_Neighbor_alltoall_init โ Create a persistent request for neighbor_alltoall.
like, it makes you a persistent request. that's the whole vibe. ๐ซถ
๐ธ SYNOPSIS ๐ธ
int MPI_Neighbor_alltoall_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_alltoall_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 icons, same function, one of them just does MPI_Count instead of int for the counts. pick your fighter. โจ
๐ INPUT PARAMETERS ๐
sendbufโ starting address of send buffer (choice). it's where your lil elements live before they go out into the world.sendcountโ number of elements sent to each neighbor (non-negative integer). to each neighbor, babes, not total. do the math. ๐งฎsendtypeโ 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). yes it needs the topology. it's a neighbor thing, iykyk.infoโ info argument (handle).
๐ OUTPUT PARAMETERS ๐
recvbufโ starting address of receive buffer (choice). the after-party location for all the incoming data.requestโ communication request (handle). hold onto this one, bestie. it's your persistent request fr fr.
๐ฅ THREAD AND INTERRUPT SAFETY ๐ฅ
This routine is thread-safe. what does that mean? it means you can safely use this routine from multiple threads and you do not need to bring your own user-provided thread locks. slay. ๐
However โ and this is the plot twist ๐ญ โ 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, thread-safe yes, interrupt-safe no. we contain multitudes.
๐ง 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.
Fortran besties, do not forget the ierr at the end. he is always invited. ๐
All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in 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. ๐ so yeah, dramatic.
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 roster, no skips:
MPI_SUCCESSโ No error; MPI routine completed successfully. ๐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.
and that's the whole page, bestie!! ๐ go forth and init those persistent requests. vibe check: passed. โญ
mwah ๐ this was MPI_Neighbor_alltoall_init(3) from the MPI manual, dated 4/10/2026. that's the source, that's the version, that's the date, periodt. ๐
๐ฆ 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