MPI_Rget(3)

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

πŸ’– MPI_Rget(3) β€” the "grab data off your bestie's memory window, but make it async" page πŸ’–

okay so welcome to the MPI manual, bestie 🫢 this one's MPI_Rget, and it's the non-blocking sibling of MPI_Get. iykyk.


✨ NAME ✨

MPI_Rget β€” Get data from a memory window on a remote process

like. literally that. you're reaching into somebody else's window and yoinking data out of it, except you don't wait around for it. no cap. πŸ’…


🌸 SYNOPSIS 🌸

int MPI_Rget(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_Win win, MPI_Request *request)

int MPI_Rget_c(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_Win win, MPI_Request *request)

two flavors, same energy: the regular one and the _c one for when your counts are too big for a plain int. slay. ✨


πŸŽ€ INPUT PARAMETERS πŸŽ€

  • origin_count β€” how many entries fit in the origin buffer (a non-negative integer, we do not do negative here πŸ™ˆ)
  • origin_datatype β€” what each entry in the origin buffer actually is (handle)
  • target_rank β€” whose rank we're targeting (non-negative integer, be nice to them)
  • target_disp β€” how far in from the start of the window the target buffer begins (non-negative integer)
  • target_count β€” how many entries live in the target buffer (non-negative integer)
  • target_datatype β€” what each entry in the target buffer actually is (handle)
  • win β€” the window object doing all the communicating (handle)

πŸ’œ OUTPUT PARAMETERS πŸ’œ

  • origin_addr β€” the initial address of the origin buffer (choice)
  • request β€” the RMA request (handle), aka your little receipt for later tracking 🧚

πŸ”₯ THREAD AND INTERRUPT SAFETY πŸ”₯

this routine is thread-safe, bestie. which means multiple threads can use it at the same time and you do not need to bring your own thread locks. group project friendly. 🫢

but β€” and hear me out β€” it is not interrupt safe. 😭 typically that's because it uses memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so like. don't interrupt it. respect its moment. πŸ’€


🌈 NOTES FOR FORTRAN 🌈

every MPI routine in Fortran (except MPI_WTIME and MPI_WTICK) gets one extra argument tacked on at the end: ierr. it's an integer and it means exactly the same thing as the return value does in C. in Fortran, MPI routines are subroutines and you invoke them with the call statement. periodt. ✨

also all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iconic, honestly.


πŸ’€ ERRORS πŸ’€

okay so here's the deal. all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β€” C routines hand it back as the function's value, Fortran routines stick it in that last argument. before that value comes back, the current MPI error handler gets called. by default, that error handler aborts the whole MPI job 😭 so yeah, it's giving dramatic.

you can swap the handler out 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 β€” leave it in the past where it belongs. the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned instead. note that MPI does not guarantee 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. we love a clean run πŸ’–
  • 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 β€”
  • 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. commit ur types girl πŸ™ˆ
  • MPI_ERR_WIN β€” invalid MPI window object
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code.
ngl if you're seeing MPI_ERR_OTHER, go ahead and call MPI_Error_string. it's literally right there waiting to help you. 🧚

πŸ¦‹ SEE ALSO πŸ¦‹

MPI_Get


and that's the whole page, bestie. this was MPI_Rget(3) from the MPI manual, dated 4/10/2026. go forth and async-grab your data responsibly πŸ‘‘πŸ’–

πŸ“¦ where this page comes from