MPI_Request_get_status_some(3)

πŸ’– MPI_Request_get_status_some(3) β€” the MPI manual page, but make it make sense πŸ’–

okay bestie, pull up a chair 🫢 this one is from the MPI manual, and it's genuinely one of the cutest non-blocking tricks in the whole toolkit. no cap.


✨ NAME ✨

MPI_Request_get_status_some β€” a nondestructive test to see if some of your requests have finished. like, a little peek. a vibe check. you look, but you don't touch. πŸ‘€


🌸 SYNOPSIS 🌸

int MPI_Request_get_status_some(int incount,
const MPI_Request array_of_requests[],
int *outcount, int array_of_indices[],
MPI_Status *array_of_statuses)

πŸŽ€ INPUT PARAMETERS πŸŽ€

  • incount β€” how long array_of_requests is (a non-negative integer, so no negatives, we don't do that here πŸ’…)
  • array_of_requests β€” the array of requests (handle). yes, it's a handle situation. iconic.

πŸ¦‹ OUTPUT PARAMETERS πŸ¦‹

  • outcount β€” how many requests actually completed (integer)
  • array_of_indices β€” the array of indices of the operations that completed (integer). so like, which ones popped off.
  • array_of_statuses β€” the array of status objects for the operations that completed (Status)

🧡 THREAD AND INTERRUPT SAFETY 🧡

This routine is thread-safe. that means multiple threads can use it at the same time and you do not need to bring your own thread locks β€” she handles herself. πŸ’β€β™€οΈ

but bestie. she is not interrupt safe. 😭 typically that's because of memory allocation routines like malloc or other non-MPICH runtime routines that themselves are not interrupt-safe. so like, don't interrupt her mid-glow-up.

🌈 NOTES FOR FORTRAN 🌈

Every MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) gets an extra argument called ierr tacked on at the end of the argument list. ierr is an integer and it means the exact 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.

Also, all MPI objects (e.g., MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them. periodt.


πŸ’€ 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 that last argument. Before the value is returned, the current MPI error handler is called. And by default? that error handler aborts the MPI job. like, full dramatic exit. πŸšͺπŸ’₯

The error handler can 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 (old news, move on bestie). The predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be 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... fingers crossed. 🀞
  • 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_COUNT β€” invalid count argument. count arguments must be non-negative; a count of zero is often valid.
  • MPI_ERR_REQUEST β€” invalid MPI_Request. either null or, in the case of a MPI_Start or MPI_Startall, not a persistent request.
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more information about this error code.

and that's the whole page, bestie πŸ«ΆπŸ’œ you ate. no crumbs. MPI manual, dated 4/10/2026 β€” go forth and check your requests without wrecking them. mwah. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from