MPI_Rget(3)
π 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 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. commit ur types girl πMPI_ERR_WINβ invalid MPI window objectMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code.
ngl if you're seeingMPI_ERR_OTHER, go ahead and callMPI_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
- 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