MPI_Raccumulate(3)

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

πŸ’« 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_WTIME and MPI_WTICK) has an additional argument called ierr hanging out at the end of the argument list. ierr is 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 call statement. periodt.
  • all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in 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 communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_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 be MPI_ANY_SOURCE.
  • 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.
  • MPI_ERR_WIN β€” invalid MPI window object.
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to 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