MPI_Alltoallv_init(3)
๐ 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 tosendbuf) 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 torecvbuf) 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 inMPI_Comm_rank). not evenMPI_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 uncommittedMPI_Datatype(seeMPI_Type_commit) is used in a communication call. commit your types, i'm on my knees ๐งMPI_ERR_OTHERโ Other error; useMPI_Error_stringto 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
- 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