MPI_T_event_get_index(3)
π MPI_T_event_get_index β the manual page, but make it make sense π
okay bestie, this is the MPI manual, section 3 β so it's a library routine, not a command you type, iykyk. Today's main character is MPI_T_event_get_index, and she's here to hand you the index of an event type when you already know its name. Let's get into it π
β¨ NAME β¨
MPI_T_event_get_index β returns the index of an event type identified by a known event type name. that's it. that's the whole job. she's focused, she's efficient, she ate π
πΈ SYNOPSIS πΈ
int MPI_T_event_get_index(const char *name, int *event_index)
π¦ INPUT PARAMETERS π¦
nameβ the name of the event type, and yes it's a string (aconst char *, to be exact). this is the known name you're bringing to the function. like, you already know her name, you just need her number.
π OUTPUT PARAMETERS π
event_indexβ the index of the event type, and it's an integer. this is the int pointer the routine fills in for you. the whole reason we're here fr fr.
π THREAD AND INTERRUPT SAFETY π
okay so this routine is thread-safe. what that means, bestie: multiple threads can safely use it at the same time, and you do not need to bring your own user-provided thread locks. slay, no babysitting required π«Ά
<b>but</b> β and this is the plot twist π β it is not interrupt safe. typically that's because it uses memory allocation routines such as malloc, or other non-MPICH runtime routines that are themselves not interrupt-safe. so like, the block's cute, but don't interrupt her mid-glow-up.
π ERRORS π
okay so literally all MPI routines return an error value β except MPI_Wtime and MPI_Wtick, those two are the exceptions, they're built different. C routines return it as the value of the function, and Fortran routines put it in the last argument.
and before that value comes back, the current MPI error handler gets called. by default? that error handler aborts the MPI job. π so yeah, matters.
you can change the error handler with these:
MPI_Comm_set_errhandlerβ for communicatorsMPI_File_set_errhandlerβ for filesMPI_Win_set_errhandlerβ for RMA windows
you can also use the MPI-1 routine MPI_Errhandler_set, but heads up bestie, its use is deprecated. no cap, just don't.
you can also use the predefined error handler MPI_ERRORS_RETURN to cause error values to be returned instead. and remember: 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 full error roster:
MPI_SUCCESSβ no error; the MPI routine completed successfully. we love a happy ending β¨MPI_T_ERR_INVALIDβ invalid use of the interface or bad parameter values(s). (thatvalues(s)is theirs, not mine, I'm preserving the artifact π)MPI_T_ERR_INVALID_NAMEβ the variable or category name is invalidMPI_T_ERR_NOT_INITIALIZEDβ the MPI tool information interface is not initialized. like, she's not awake yet, give her a sec πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more information about this error code
aaaand that's the whole page, bestie π go forth and index those events responsibly. this has been the MPI manual, MPI_T_event_get_index(3), dated 4/10/2026 β thanks for scrolling with me, ily, bye π«ΆπΈ
π¦ 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