MPI_Rget_accumulate(3)
π MPI_Rget_accumulate(3) π
okay so bestie, welcome to the MPI manual page for MPI_Rget_accumulate β literally one of the coolest one-sided calls in the whole MPI universe and I am obsessed. this is the MPI manual, page 3, and we are gonna get you fluent in atomic read-and-accumulate energy. no cap. π¦
β¨ NAME β¨
MPI_Rget_accumulate β Perform an atomic, one-sided read-and-accumulate π
like. you reach into somebody else's window, you grab the value, AND you accumulate into it, and the whole thing happens atomically. it's giving main character energy fr fr. π
πΈ SYNOPSIS πΈ
int MPI_Rget_accumulate(const void *origin_addr, int origin_count,
MPI_Datatype origin_datatype, void *result_addr,
int result_count, MPI_Datatype result_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_Rget_accumulate_c(const void *origin_addr, MPI_Count origin_count,
MPI_Datatype origin_datatype, void *result_addr,
MPI_Count result_count, MPI_Datatype result_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 flavors, same vibe: the big-boy MPI_Count version got a _c on the end, periodt. π
π INPUT PARAMETERS π
origin_addrβ initial address of buffer (choice)origin_countβ number of entries in origin buffer (non-negative integer)origin_datatypeβ datatype of each entry in origin buffer (handle)result_countβ number of entries in result buffer (non-negative integer)result_datatypeβ datatype of entries in result buffer (handle)target_rankβ rank of target (non-negative integer)target_dispβ displacement from start of window to beginning of target buffer (non-negative integer)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)winβ window object (handle)
π« OUTPUT PARAMETERS π«
result_addrβ initial address of result buffer (choice)requestβ RMA request (handle)
π₯ NOTES π₯
this operation is atomic with respect to other "accumulate" operations. so nobody's sneaking in mid-operation, bestie, it's a whole vibe. π«Ά
the get and accumulate steps are executed atomically for each basic element in the datatype (see MPI 3.0 Section 11.7 for details β go read it, iykyk). and the predefined operation MPI_REPLACE provides fetch-and-set behavior. iconic. β¨
lowkey important: the basic components of both the origin and target datatype must be the same predefined datatype (e.g., allMPI_INTor allMPI_DOUBLE_PRECISION). do not mix and match, that's not the move. π
π 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.
all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes really. every single one. π
π 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 β like, full stop, everybody out. π³ 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 β don't do it bestie. 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. π
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 page just leaves this one blank, no description given, so we're matching that energy fr)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 objectMPI_ERR_OTHERβ Other error; useMPI_Error_stringto get more information about this error code.
π¦ SEE ALSO π¦
MPI_Get_accumulateMPI_Fetch_and_op
and that's the whole page bestie, you ate that. π
β¨ this was the MPI manual, version dated 4/10/2026, and yes the footer says MPI_Rget_accumulate(3) one more time because it loves a dramatic exit. go forth and accumulate, you gorgeous little RMA gremlin. πππ
π¦ 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