MPI_Session_get_num_psets(3)
π MPI_Session_get_num_psets β bestie, let's count your process sets π
okay so this is the MPI_Session_get_num_psets page from the MPI manual (section 3, we love a library call), and it's literally just here to tell you how many process sets your session has. that's it. that's the whole vibe. β¨
πΈ NAME πΈ
MPI_Session_get_num_psets β get the number of available process sets π
no cap, that's the entire job description.
π¦ SYNOPSIS π¦
int MPI_Session_get_num_psets(MPI_Session session, MPI_Info info,
int *npset_names)
look at her. so short. so iconic. π
π INPUT PARAMETERS π
sessionβ the session, which is a handle (yes, a handle, we love a handle) π«Άinfoβ an info object, also a handle β¨
π OUTPUT PARAMETERS π
npset_namesβ the number of available process sets. it's a non-negative integer, so like, zero is fine, negative is NOT the move π
π₯ THREAD AND INTERRUPT SAFETY π₯
good news first: this routine is thread-safe. that means multiple threads can use it at the same time and you do not have to bring your own thread locks. she handles herself. main character energy fr fr π
but π β she is not interrupt safe. typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so like, keep that in mind, bestie.
β¨ NOTES FOR FORTRAN β¨
- every MPI routine in Fortran (except
MPI_WTIMEandMPI_WTICK) gets an extra argument calledierrtacked onto the end of the argument list.ierris 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
callstatement. periodt. - all MPI objects (e.g.,
MPI_Datatype,MPI_Comm) are of typeINTEGERin Fortran. yes, all of them. even the fancy ones. π
π ERRORS π
so every MPI routine (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 that value comes back to you, the current MPI error handler gets called. by default, that error handler aborts the MPI job π so yeah, know that going in.
you can change the error handler 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 β so like, maybe don't. π
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. π«Ά
here's the error code lineup:
MPI_SUCCESSβ no error; the 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_INFOβ invalid InfoMPI_ERR_SESSIONβ invalid session handleMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. iykyk π
okay that's the whole page, you ate it, go get your npset_names queen π
this was MPI_Session_get_num_psets(3) from the MPI manual, and the footer says it's dated 4/10/2026 β so yeah, mark your calendar, bestie. πβ¨
π¦ 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