MPI_REQUEST_GET_STATUS(3)

πŸ’– MPI_REQUEST_GET_STATUS πŸ’–

okay bestie, welcome to the Open MPI manual page for MPI_Request_get_status β€” yes it's giving very "peek at ur request without ghosting it" energy and honestly? obsessed. no cap.


🌸 NAME 🌸

MPI_Request_get_status β€” peek at all the info hanging off a request without freeing that request. like reading the text message but not deleting the chat. πŸ’…


✨ SYNTAX ✨

πŸŽ€ C Syntax

#include <mpi.h>

int MPI_Request_get_status(MPI_Request request, int *flag, MPI_Status *status)

πŸŽ€ Fortran Syntax

USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_REQUEST_GET_STATUS(REQUEST, FLAG, STATUS, IERROR)
     INTEGER REQUEST, STATUS(MPI_STATUS_SIZE), IERROR
     LOGICAL FLAG

πŸŽ€ Fortran 2008 Syntax

USE mpi_f08
MPI_Request_get_status(request, flag, status, ierror)
     TYPE(MPI_Request), INTENT(IN) :: request
     LOGICAL, INTENT(OUT) :: flag
     TYPE(MPI_Status) :: status
     INTEGER, OPTIONAL, INTENT(OUT) :: ierror

🫢 INPUT PARAMETER

  • request β€” the communication request, i.e. the handle. it's the little guy you're checking up on. (handle)

🌈 OUTPUT PARAMETERS

  • flag β€” a boolean flag, literally the same one you'd get from MPI_Test πŸ’€ (logical)
  • status β€” the MPI_Status object, but only if flag is true. no flag, no status, that's the rule. (status)

πŸ‘‘ DESCRIPTION πŸ‘‘

MPI_Request_get_status sets flag = true if the operation is complete, or sets flag = false if it's not complete. main character behavior: tell it like it is. πŸ”₯

and if the operation is complete, it hands you the request status in status. so far so good.

BUT β€” and this is the important part, bestie, do not skip this β€” it does not deallocate or deactivate the request. the request is still there, still valid, still yours. you should follow up with a subsequent call to test, wait, or free with that request. periodt. πŸ’…

if your app doesn't actually need to look at the status field, you can save resources by using the predefined constant MPI_STATUS_IGNORE as a special value for the status argument. iconic little shortcut, iykyk. ✨


😭 ERRORS 😭

almost all MPI routines return an error value: C routines hand it back as the return result of the function, and Fortran routines put it in the last argument. fr fr.

before that error value comes back to you, the current MPI error handler associated with the communication object (think: communicator, window, file) gets called. and if there's no communication object associated with the MPI call, then the call counts as attached to MPI_COMM_SELF and it'll call the associated MPI error handler. and when MPI_COMM_SELF isn't initialized β€” i.e. before MPI_Init / MPI_Init_thread, after MPI_Finalize, or when you're using the Sessions Model exclusively β€” the error raises the initial error handler. 🫠

the initial error handler can be changed by calling MPI_Comm_set_errhandler on MPI_COMM_SELF when using the World model, or via the mpi_initial_errhandler CLI argument to mpiexec, or an info key to MPI_Comm_spawn / MPI_Comm_spawn_multiple.

and if no other appropriate error handler has been set, then the MPI_ERRORS_RETURN error handler is called for MPI I/O functions, and the MPI_ERRORS_ABORT error handler is called for all other MPI functions.

Open MPI includes three predefined error handlers you can use:

  • MPI_ERRORS_ARE_FATAL β€” causes the program to abort all connected MPI processes. yeah. all of them. πŸ’€
  • MPI_ERRORS_ABORT β€” an error handler that can be invoked on a communicator, window, file, or session. when called on a communicator, it acts as if MPI_Abort was called on that communicator. if called on a window or file, it acts as if MPI_Abort was called on a communicator containing the group of processes in the corresponding window or file. if called on a session, it aborts only the local process. 🫑
  • MPI_ERRORS_RETURN β€” returns an error code to the application.

MPI applications can also implement their own error handlers by calling:

  • MPI_Comm_create_errhandler then MPI_Comm_set_errhandler
  • MPI_File_create_errhandler then MPI_File_set_errhandler
  • MPI_Session_create_errhandler then MPI_Session_set_errhandler or at MPI_Session_init
  • MPI_Win_create_errhandler then MPI_Win_set_errhandler
⚠️ note that MPI does not guarantee that an MPI program can continue past an error. like, it might just be over. no promises. 😭

see the MPI man page for a full list of MPI error codes.

see the Error Handling section of the MPI-3.1 standard for more information.


2003-2026, The Open MPI Community


aaand that's the whole page bestie, you ate it, go forth and check ur requests responsibly πŸ¦‹βœ¨

Open MPI β€” MPI_REQUEST_GET_STATUS(3) β€” Sep 10, 2026 πŸŽ€

πŸ“¦ where this page comes from