MPI_T_category_get_num_events(3)

✨ NAME ✨

MPI_T_category_get_num_events β€” bestie, this one tells you how many event types are chillin' inside the category you just queried. That's it, that's the whole job. πŸ’–

(also hi, this is the MPI manual, page MPI_T_category_get_num_events(3), and we're about to get you fluent in it 🫢)


🌸 SYNOPSIS 🌸

int MPI_T_category_get_num_events(int cat_index, int *num_events)

πŸŽ€ INPUT PARAMETERS πŸŽ€

  • cat_index β€” the index of the category you wanna query, an integer obvi. It's giving "which one tho" energy πŸ¦‹

πŸ’… OUTPUT PARAMETERS πŸ’…

  • num_events β€” out comes the number of event types in that category (also an integer, no cap) ✨

🧚 THREAD AND INTERRUPT SAFETY 🧚

Okay so the good news first: this routine is thread-safe. That means multiple threads can use it at the same time and you do not need to bring your own thread locks. She handles herself. πŸ‘‘

But β€” and I need you to hear this β€” she 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 like, she's fine in the group chat but don't jump-scare her mid-allocation, periodt.


πŸ’€ ERRORS πŸ’€

So every MPI routine (except MPI_Wtime and MPI_Wtick, the lucky ones) is gonna hand you back an error value. In C it's the return value of the function; in Fortran it's the last argument. And before that value comes back, the current MPI error handler gets called.

By default, that error handler aborts the whole MPI job. πŸ’€ Yes really. It's dramatic like that.

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

There's also the MPI-1 routine MPI_Errhandler_set, and you may use it, but its use is deprecated β€” so like, she's still around but we don't stan. πŸ™ˆ

If you'd rather get error values returned to you instead of the job getting nuked, use the predefined error handler MPI_ERRORS_RETURN. 🫢

Heads up: MPI does not guarantee that an MPI program can keep going past an error. However, MPI implementations will attempt to continue whenever possible. So it's a vibe check, not a promise. 🌈

Now the actual error codes, our little roster:

  • MPI_SUCCESS β€” no error, the routine completed successfully. The dream. ✨
  • MPI_T_ERR_INVALID β€” invalid use of the interface or bad parameter value(s). Rude of you tbh.
  • MPI_T_ERR_INVALID_INDEX β€” the index is invalid or has been deleted. She's not here anymore, bestie. πŸ‘»
  • MPI_T_ERR_NOT_INITIALIZED β€” the MPI tool information interface is not initialized. You gotta wake her up first 😭
  • MPI_ERR_OTHER β€” other error; use MPI_Error_string to get more info about this error code. The catch-all, the mystery box 🎁

πŸ¦‹ SEE ALSO πŸ¦‹

Nothing else listed on this page, so I guess it's just us two and this function. Iconic honestly. πŸ’œ


kisses bestie, you're officially fluent in counting event types πŸŽ€πŸŒΈπŸ’…

This was the MPI manual, page MPI_T_category_get_num_events(3), dated 4/10/2026 β€” go forth and query those categories, you absolute main character πŸ‘‘βœ¨

πŸ“¦ where this page comes from