MPI_Raccumulate(3)
π« MPI_Raccumulate β bestie's guide to the MPI manual π«
okay so. this is a page from the MPI manual, section 3, and it's all about MPI_Raccumulate(3). yes the name is a mouthful, we're gonna get through it together. π«Ά
β¨ NAME β¨
MPI_Raccumulate β accumulate data into the target process using remote memory access π
like. you're reaching into somebody else's memory and doing math on it. from afar. main character energy fr. π
π¦ SYNOPSIS π¦
int MPI_Raccumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, int target_count,
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request)
int MPI_Raccumulate_c(const void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, int target_rank,
MPI_Aint target_disp, MPI_Count target_count,
MPI_Datatype target_datatype, MPI_Op op, MPI_Win win,
MPI_Request *request)
two of them!! ur regular one and the _c one, which is giving "we counted bigger" (the _c variants take MPI_Count instead of int for the counts, iykyk). π
π INPUT PARAMETERS π
origin_addrβ initial address of buffer (choice). it's where ur stuff lives rn πorigin_countβ number of entries in buffer (non-negative integer). don't be negative bestie it's not that kind of party πorigin_datatypeβ datatype of each entry in origin buffer (handle)target_rankβ rank of target (non-negative integer). who we're reaching out to π€target_dispβ displacement from start of window to beginning of target buffer (non-negative integer). how far we're scootin' in π§target_countβ number of entries in target buffer (non-negative integer)target_datatypeβ datatype of each entry in target buffer (handle)opβ reduce operation (handle). the actual math being done β¨winβ window object (handle). the portal bestie, the whole vibe πΈ
β OUTPUT PARAMETERS β
requestβ RMA request (handle). yes queen, hand it back, we'll be checking on it later π₯
π NOTES π
the basic components of both the origin and target datatype have to be the same predefined datatype. like, all MPI_INT or all MPI_DOUBLE_PRECISION. no mixing, no chaos, no "well I thought the types would just vibe" β they will not vibe. π
π NOTES FOR FORTRAN π
okay Fortran besties, this part is for u:
- every single MPI routine in Fortran (except
MPI_WTIMEandMPI_WTICK) has an additional argument calledierrhanging out at the end of the argument list.ierris an integer and 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
callstatement. periodt. - all MPI objects (like
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. iconic, honestly.
π ERRORS π
okay so every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines give it back as the value of the function, and Fortran routines put it in that last argument. before the value comes back, the current MPI error handler gets called. by default, that error handler aborts the MPI job. yes. like, full stop, whole thing down. π³
u can change the error handler with:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
the MPI-1 routine MPI_Errhandler_set may still be used, but its use is deprecated (we don't do that anymore bestie).
u can also use the predefined error handler MPI_ERRORS_RETURN to make error values actually get 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... maybe? no promises. π
here's the error list:
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).MPI_ERR_BUFFERβ invalid buffer pointer. usually a null buffer where one is not valid.MPI_ERR_COUNTβ invalid count argument. count arguments must be non-negative; a count of zero is often valid.MPI_ERR_DISPβ (the manpage gives literally no description here. blank. nothing. the void. π we're just gonna leave it exactly as empty as we found it.)MPI_ERR_RANKβ invalid source or destination rank. ranks must be between zero and the size of the communicator minus one; ranks in a receive (MPI_Recv,MPI_Irecv,MPI_Sendrecv, etc.) may also beMPI_ANY_SOURCE.MPI_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_WINβ invalid MPI window object.MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
π₯ SEE ALSO π₯
MPI_Accumulate
(the non-R one, in case u were wondering where this whole thing came from πΈ)
and that's the page bestie!! π written up in the MPI manual, from the 4/10/2026 version of things β MPI_Raccumulate(3), that's the one. go accumulate something. responsibly. π
β¨π¦π
π¦ 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