MPI_Neighbor_alltoall_init(3)

๐Ÿ“ฆ
version 5.0.1 ยท 5 versions
, in nixos 26.05, ubuntu stonking

๐Ÿฆ‹ 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 in MPI_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 Info
  • MPI_ERR_TYPE โ€” Invalid datatype argument. Additionally, this error can occur if an uncommitted MPI_Datatype (see MPI_Type_commit) is used in a communication call.
  • MPI_ERR_OTHER โ€” Other error; use MPI_Error_string to 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