MPI_Pready_range(3)

πŸ’– MPI_Pready_range(3) πŸ’–

okay bestie, welcome to the MPI manual, page MPI_Pready_range(3). this one's about partitioned communication and telling the world "yo, THIS chunk of my send buffer is ready to go" 🫢


✨ NAME ✨

MPI_Pready_range β€” Indicates that a given range of the send buffer in a partitioned

(yes the original sentence just... ends there. we love a cliffhanger πŸ’€ but that's literally what the NAME section says, so it stays.)


🌸 SYNOPSIS 🌸

int MPI_Pready_range(int partition_low, int partition_high,
                     MPI_Request request)

πŸŽ€ INPUT PARAMETERS πŸŽ€

  • partition_low β€” the partition you're marking as the lowest partition that's ready for transfer. it's a non-negative integer, no cap. πŸ’…
  • partition_high β€” the partition you're marking as the highest partition that's ready for transfer. also a non-negative integer. so like, you're saying "everything from partition_low to partition_high inclusive is ready, go off." πŸ”₯
  • request β€” the partitioned communication request handle. that's your lil ticket stub for the whole operation. 🎟️

🧚 THREAD AND INTERRUPT SAFETY 🧚

good news first: this routine is thread-safe. that means multiple threads can call it and nobody needs to bring their own thread locks, it just handles it. slay. ✨

bad news second: it is not interrupt safe. this is usually because it uses memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so don't go interrupting it mid-vibe, fr fr. 😭


🌈 NOTES FOR FORTRAN 🌈

okay Fortran besties, this part is for you:

  • Every MPI routine in Fortran (except MPI_WTIME and MPI_WTICK) gets an extra argument 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.
  • All MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. yes, all of them. iconic behavior honestly. πŸ‘‘

πŸ’€ ERRORS πŸ’€

so, all MPI routines (except MPI_Wtime and MPI_Wtick) return an error value. C routines return it as the value of the function, and Fortran routines stick 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 β€” like, entire job, gone, no survivors. πŸ™ˆ

you 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 be used but its use is deprecated (please don't, bestie, it's giving 1994).

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. that said, MPI implementations will attempt to continue whenever possible. so it's a try your best situation.

here's the error codes:

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. πŸŽ‰
  • 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, no cap. this was MPI's MPI_Pready_range(3), dated 4/10/2026, and honestly? she ate. πŸ’…βœ¨πŸŽ€ go mark some partitions ready, you main character. πŸ¦‹πŸ’–

πŸ“¦ where this page comes from