MPI_Ineighbor_allgather(3)

πŸ“¦
version 5.0.1 Β· 5 versions
, in nixos 26.05, ubuntu stonking

πŸ’– MPI_Ineighbor_allgather(3) πŸ’–

okay bestie so this is the MPI manual page for MPI_Ineighbor_allgather, and it is literally the nonblocking glow-up of MPI_Neighbor_allgather. same vibe, but it doesn't make you wait around for it β€” it hands you back a request and lets you get on with your life. iconic behavior honestly.


✨ NAME ✨

MPI_Ineighbor_allgather β€” the nonblocking version of MPI_Neighbor_allgather. that's it, that's the name, and it ate.


✨ SYNOPSIS ✨

int MPI_Ineighbor_allgather(const void *sendbuf, int sendcount,
MPI_Datatype sendtype, void *recvbuf, int recvcount,
MPI_Datatype recvtype, MPI_Comm comm,
MPI_Request *request)

int MPI_Ineighbor_allgather_c(const void *sendbuf, MPI_Count sendcount,
MPI_Datatype sendtype, void *recvbuf,
MPI_Count recvcount, MPI_Datatype recvtype,
MPI_Comm comm, MPI_Request *request)

two flavors, same energy πŸ’… β€” the classic one and the _c one that takes MPI_Count for the counts, iykyk.


✨ INPUT PARAMETERS ✨

  • sendbuf β€” starting address of send buffer (choice). where the stuff you're sending lives. 🫢
  • sendcount β€” number of elements sent to each neighbor (non-negative integer). not to all of them combined, bestie β€” to each one. read it carefully.
  • sendtype β€” data type of send buffer elements (handle).
  • recvcount β€” number of elements received from each neighbor (non-negative integer). again: each. πŸ’€
  • recvtype β€” data type of receive buffer elements (handle).
  • comm β€” communicator with topology structure (handle). it needs the topology one, okay? not just any random comm, it's giving "must have structure."

✨ OUTPUT PARAMETERS ✨

  • recvbuf β€” starting address of receive buffer (choice).
  • request β€” communication request (handle). hold onto this one, you're gonna need it later to check in on things. πŸ’Œ

✨ THREAD AND INTERRUPT SAFETY ✨

this routine is thread-safe. translating: multiple threads can use it at the same time, no cap, and you don't have to write your own thread locks to keep it from falling apart. slay.

but β€” and this is the plot twist 😭 β€” it is not interrupt safe. typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines, which are themselves not interrupt-safe. so like, threads? fine. interrupts? girl, no.


✨ NOTES FOR FORTRAN ✨

okay Fortran besties, gather round πŸŽ€

  • every MPI routine in Fortran (except MPI_WTIME and MPI_WTICK) has an extra argument ierr tacked on at the end of the argument list. it's an integer and it means exactly the same thing as the return value of the routine in C.
  • in Fortran, MPI routines are subroutines, and you invoke them with the call statement. periodt.
  • all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. πŸ’œ

✨ ERRORS ✨

every MPI routine (again, except MPI_Wtime and MPI_Wtick) returns an error value β€” C routines as the value of the function, Fortran routines in that last argument. before that value comes back to you, the current MPI error handler gets called. by default, that handler aborts the whole MPI job. yes, really. dramatic? maybe. accurate? yes. πŸ’€

you can change the error handler with:

  • MPI_Comm_set_errhandler β€” for communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_Win_set_errhandler β€” for RMA windows

the MPI-1 routine MPI_Errhandler_set may be used, but heads up: its use is deprecated. lowkey don't.

the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. and ngl, MPI does not guarantee that an MPI program can continue past an error β€” however, MPI implementations will attempt to continue whenever possible. so like, fingers crossed 🀞

the error codes themselves:

  • MPI_SUCCESS β€” no error; MPI routine completed successfully. the dream. ✨
  • 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 one is passing 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. note the "often," bestie.
  • MPI_ERR_TYPE β€” invalid datatype argument. additionally, this can happen 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.

everything listed here is exactly what the page says. no invented lore, no made-up flags. I keep the facts, I just make them cute. 🧚

k that's the whole page babes, go forth and be nonblocking about it πŸ’–πŸŒΈ

β€” this was MPI_Ineighbor_allgather(3) from the MPI manual, dated 4/10/2026. mwah, see u next man page πŸŽ€βœ¨

πŸ“¦ where this page comes from