MPIX_Async_start(3)

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

πŸ’– MPIX_Async_start(3) πŸ’–

okay bestie, welcome to section 3 of the MPI manual 🫢 this one's all about MPIX_Async_start, and yes it's giving "I make async stuff actually happen" energy ✨

🌸 NAME 🌸

MPIX_Async_start β€” [short description] πŸ’… (no cap, that's literally what the page says, we're keeping it exactly as-is)

✨ SYNOPSIS ✨

int MPIX_Async_start(MPIX_Async_poll_function *poll_fn, void *extra_state,
MPIX_Stream stream)

πŸŽ€ INPUT PARAMETERS πŸŽ€

  • poll_fn β€” your very own, user-defined poll function, the one that does the progressing of async things πŸ‘‘ (type: function)
  • extra_state β€” extra state you wanna hand off to the callback function πŸ“ (default: None)
  • stream β€” a stream object, it's a handle, that's the vibe (type: handle)

🌈 THREAD AND INTERRUPT SAFETY 🌈

okay so this routine is thread-safe ✨ which means multiple threads can use it at the same time and you do not need to bring your own thread locks. no gatekeeping, it just works.

BUT πŸ›‘ the routine is not interrupt safe. and lowkey the reason is usually that it calls memory allocation stuff like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. it's giving "blame the allocator," not the vibe. πŸ’€

🧚 NOTES FOR FORTRAN 🧚

every single MPI routine in Fortran (except for MPI_WTIME and MPI_WTICK) gets an extra argument ierr tacked onto the end of the argument list. ierr is an integer and it means exactly the 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, periodt πŸ’…

also!! all MPI objects (like MPI_Datatype, MPI_Comm) are of type INTEGER in Fortran. iconic, we love consistency 🌟

😭 ERRORS 😭

every MPI routine (again, except MPI_Wtime and MPI_Wtick) returns an error value β€” C routines hand it back as the value of the function, and Fortran routines put it in that last argument. before the value comes back to you, the current MPI error handler gets called. by default, this error handler aborts the MPI job πŸ’€ like, full stop, we're done here.

you can swap the error handler with:

  • MPI_Comm_set_errhandler β€” for communicators
  • MPI_File_set_errhandler β€” for files
  • MPI_Win_set_errhandler β€” for RMA windows

and yeah, the MPI-1 routine MPI_Errhandler_set may be used, but heads up bestie: its use is deprecated πŸ™ˆ don't be that girl.

the predefined error handler MPI_ERRORS_RETURN may be used to make error values actually get returned to you instead of nuking everything. and important: MPI does not guarantee that an MPI program can continue past an error, but MPI implementations will attempt to continue whenever possible 🫢

here's the error code lineup:

  • MPI_SUCCESS β€” no error, the MPI routine completed successfully, we ate and left no crumbs πŸ‘‘
  • MPI_ERR_ARG β€” invalid argument. some argument is invalid and it's not identified by a specific error class (for example MPI_ERR_RANK) 😭
  • MPI_ERR_OTHER β€” other error. use MPI_Error_string to get more info about this error code πŸ”

and that's the whole page, bestie, every flag and fact intact, nothing skipped, we kept the receipts πŸ’–

lil sign-off: this was MPIX_Async_start(3) from the MPI manual, dated 4/10/2026 🌸 mwah, go write some async code, ily πŸŽ€βœ¨πŸ’…

πŸ“¦ where this page comes from