MPI_Alltoallv_init(3)

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

๐Ÿ’– MPI_Alltoallv_init โ€” the manual page, bestie edition โœจ

okay so you found the MPI_Alltoallv_init(3) page, part of the MPI manual, and honestly? this one's a vibe. it does one thing and it does it well: it creates a persistent request for alltoallv. that's it, that's the whole personality. ๐ŸŽ€

no cap, if you've ever wished your alltoallv could just... exist ahead of time and be reused instead of being rebuilt every single call, this is the function for you. it's giving prepared, unbothered, ready to fire. periodt.


๐ŸŒŸ SYNOPSIS

int MPI_Alltoallv_init(const void *sendbuf, const int sendcounts[],
const int sdispls[], MPI_Datatype sendtype,
void *recvbuf, const int recvcounts[],
const int rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, MPI_Info info, MPI_Request *request)

int MPI_Alltoallv_init_c(const void *sendbuf, const MPI_Count sendcounts[],
const MPI_Aint sdispls[], MPI_Datatype sendtype,
void *recvbuf, const MPI_Count recvcounts[],
const MPI_Aint rdispls[], MPI_Datatype recvtype,
MPI_Comm comm, MPI_Info info, MPI_Request *request)

two flavors, same energy ๐Ÿ’… the _c version is the one with the big-boy count types (MPI_Count and MPI_Aint) so you don't have to pretend your numbers fit in an int.


๐Ÿ“ฅ INPUT PARAMETERS

  • sendbuf โ€” starting address of send buffer (choice). this is where the stuff you're sending lives ๐Ÿซถ
  • sendcounts โ€” non-negative integer array (of length group size) specifying the number of elements to send to each rank (non-negative integer). one entry per rank, no skipping, no shortcuts โœจ
  • sdispls โ€” Integer array (of length group size). Entry j specifies the displacement (relative to sendbuf) from which to take the outgoing data destined for process j (integer). so like, "hey rank j, your goodies start over here" ๐Ÿ’Œ
  • sendtype โ€” data type of send buffer elements (handle). yes it's a handle, yes you need to commit it, we don't make the rules ๐Ÿ˜ญ
  • recvcounts โ€” non-negative integer array (of length group size) specifying the number of elements that can be received from each rank (non-negative integer). note the can be โ€” it's the capacity, bestie ๐ŸŒธ
  • rdispls โ€” integer array (of length group size). Entry i specifies the displacement (relative to recvbuf) at which to place the incoming data from process i (integer). the landing pad coordinates ๐Ÿ“
  • comm โ€” communicator (handle). the group chat you're doing this in ๐Ÿ‘‘
  • info โ€” info argument (handle). for all your little extra notes and hints ๐ŸŽ€

๐Ÿ“ค OUTPUT PARAMETERS

  • recvbuf โ€” address of receive buffer (choice). this is where everything lands ๐Ÿฆ‹
  • request โ€” communication request (handle). your very own persistent request, hold onto it, you'll need it later โœจ

๐Ÿงต THREAD AND INTERRUPT SAFETY

This routine is thread-safe. ๐Ÿ’ช that means you can absolutely let multiple threads hit it at once without needing to bring your own locks โ€” no user-provided thread locks required, we're that trustworthy.

However, it 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? not today, babes.

โš ๏ธ lowkey important: thread-safe โ‰  interrupt-safe. don't conflate them, i'm begging ๐Ÿ™ˆ

๐ŸŒ€ 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 they're invoked with the call statement. yes, call, like you're summoning something. iconic behavior honestly ๐Ÿ”ฎ

All MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. that's just the law of the land ๐Ÿ’œ


๐Ÿšจ 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. ๐Ÿ’€ yeah. dramatic. you've been warned.

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 (we don't do that anymore, we've grown ๐Ÿซถ). The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. 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, like, they'll try their best ๐Ÿฅบ

  • 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). it's giving vague ๐Ÿ’€
  • MPI_ERR_BUFFER โ€” Invalid buffer pointer. Usually a null buffer where one is not valid. bestie why is it null ๐Ÿ˜ญ
  • MPI_ERR_COMM โ€” Invalid communicator. A common error is to use a null communicator in a call (not even allowed in MPI_Comm_rank). not even MPI_Comm_rank?? that's how bad it is ๐Ÿ™ˆ
  • MPI_ERR_COUNT โ€” Invalid count argument. Count arguments must be non-negative; a count of zero is often valid. zero is fine, negative is not, be normal ๐Ÿ’…
  • MPI_ERR_INFO โ€” Invalid Info. the info handle said no ๐ŸŒธ
  • 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. commit your types, i'm on my knees ๐Ÿงš
  • MPI_ERR_OTHER โ€” Other error; use MPI_Error_string to get more information about this error code. the catch-all, the mystery box ๐ŸŽ

๐ŸŒˆ SEE ALSO

nothing listed here, so go forth and use MPI_Error_string when you're confused, bestie ๐Ÿ’–


and that's the whole page!! you now know everything this manpage knows, no details skipped, no facts invented, all facts intact. ๐Ÿ‘‘

sign-off time, babes: this page comes from the MPI manual, dated 4/10/2026, and the header/footer tag it as MPI_Alltoallv_init(3) โ€” so yeah, you read the right one, and you read it with style. go build something persistent and beautiful ๐Ÿ’œ๐ŸŽ€โœจ

๐Ÿ“ฆ where this page comes from