MPI_T_category_get_index(3)
π MPI_T_category_get_index(3) π
okay bestie, welcome to the MPI manual, section 3 β yes we're in the library-calls chapter, we're fancy like that β¨. This one is MPI_T_category_get_index, and it does exactly what it says on the tin, no cap.
πΈ NAME πΈ
MPI_T_category_get_index β get the index of a category π
β¨ SYNOPSIS β¨
int MPI_T_category_get_index(const char *name, int *cat_index)
like. that's it. that's the whole vibe. π«Ά
π INPUT PARAMETERS π
nameβ the name of the category, and it's a string (const char *) π
π¦ OUTPUT PARAMETERS π¦
cat_indexβ the index of the category, an integer. it gets written here, and then it's yours π
π₯ THREAD AND INTERRUPT SAFETY π₯
okay so this one is thread-safe β which literally means multiple threads can all call it at the same time without you having to hand them any user-provided thread locks. no lock babysitting required, we love that for us π
But. And this is the important part, bestie. It is not interrupt safe. Typically that's because of memory allocation routines like malloc, or other non-MPICH runtime routines, which are themselves not interrupt-safe. So yeah β thread safe, not interrupt safe. two different things, don't mix them up π
π ERRORS π
So every single MPI routine (except MPI_Wtime and MPI_Wtick, those two are the rebels) returns an error value. In C routines it comes back as the value of the function, and in Fortran routines it's in the last argument.
Before that value gets returned, the current MPI error handler gets called. And by default? That error handler aborts the MPI job. like. full stop. π
You can change the error handler with:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
There's also the MPI-1 routine MPI_Errhandler_set, which may be used, but its use is deprecated β so like, it's giving legacy, proceed with caution π«
The predefined error handler MPI_ERRORS_RETURN may be used to make error values actually get returned instead of nuking everything. and ngl, note this: MPI does not guarantee that an MPI program can continue past an error. However β MPI implementations will attempt to continue whenever possible. so. fingers crossed bestie π€
Here's the error codes:
MPI_SUCCESSβ no error, the routine completed successfully. slay β¨MPI_T_ERR_INVALIDβ invalid use of the interface, or bad parameter value(s). π©MPI_T_ERR_INVALID_NAMEβ the variable or category name is invalid. that name did NOT pass the vibe check πMPI_T_ERR_NOT_INITIALIZEDβ the MPI tool information interface is not initialized. it's not even awake yet π΄MPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code. the mystery box option π
and that's the whole page, bestie!! π§ go forth and get that category index π
signing off from the 4/10/2026 edition of MPI_T_category_get_index(3) β mwah π
π
π¦ 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