MPI_T_event_get_num(3)
π MPI_T_event_get_num β straight from the MPI manual, bestie π
β¨ NAME β¨
MPI_T_event_get_num β literally just queries how many event types there are. That's it. That's the whole job. π
πΈ SYNOPSIS πΈ
int MPI_T_event_get_num(int *num_events)
π OUTPUT PARAMETERS π
num_eventsβ returns the number of event types (integer). She's giving "here's your count", no cap. π¦
π THREAD AND INTERRUPT SAFETY π
Okay so this routine is thread-safe. Meaning what exactly? Meaning multiple threads can call it at the same time and none of them need you to hand-build a thread lock. It just works. Slay. π«Ά
BUT. And this is the important but β it is not interrupt safe. The routine is not interrupt safe. Typically that's because it uses memory allocation routines like malloc or other non-MPICH runtime routines, and those bad boys are themselves not interrupt-safe. So likeβ¦ don't get cute with interrupts, mkay? π
π ERRORS π
So every MPI routine (except MPI_Wtime and MPI_Wtick) returns an error value β C routines give it back as the value of the function, and Fortran routines put it in the last argument. Before that value comes back to you, the current MPI error handler gets called. And by default? That error handler aborts your whole MPI job. Yeah. Dramatic. π³
You can change the error handler though:
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 you may use, but heads up β its use is deprecated. π You can also use the predefined error handler MPI_ERRORS_RETURN to make error values get returned instead of nuking everything.
Fr fr though: MPI does not guarantee that an MPI program can continue past an error. That said, MPI implementations will attempt to continue whenever possible. Soβ¦ fingers crossed energy. π€
Here's the full error roster:
MPI_SUCCESSβ no error, the routine did the thing successfully. periodt. βMPI_T_ERR_INVALIDβ invalid use of the interface, or bad parameter value(s). πMPI_T_ERR_NOT_INITIALIZEDβ the MPI tool information interface isn't initialized. bestie. you gotta init it first. πMPI_ERR_OTHERβ other error; useMPI_Error_stringto get more info about this error code. π
That's the whole page, no skips, no summaries, every last flag and error code accounted for. π
Signing off from the MPI manual, page MPI_T_event_get_num(3), dated 4/10/2026 β go count those event types, you absolute icon. πβ¨π
π¦ 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