MPI_T_source_get_info(3)

πŸ’– MPI_T_source_get_info β€” bestie edition πŸ’–

okay so this is a page from the MPI manual (section 3, the library-calls girlies) and it's all about MPI_T_source_get_info. buckle up πŸŽ€

✨ NAME ✨

MPI_T_source_get_info β€” the lil function that returns additional information on the source identified by the source_index argument. that's it. that's the job. 🫢


🌸 SYNOPSIS 🌸

int MPI_T_source_get_info(int source_index, char *name, int *name_len,
       char *desc, int *desc_len,
       MPI_T_source_order *ordering,
       MPI_Count *ticks_per_second, MPI_Count *max_ticks,
       MPI_Info *info)

look at her. eight arguments. she's doing the MOST and honestly? iconic. πŸ‘‘


πŸ¦‹ INPUT PARAMETERS πŸ¦‹

  • source_index β€” the index of the source you wanna interrogate, and it has to be somewhere between 0 and num_sources-1 (integer). stay in your lane, bestie, this is a bounded range πŸ’…

πŸ’« INPUT/OUTPUT PARAMETERS πŸ’«

these ones go both ways, no cap:

  • name_len β€” the length of the string and/or buffer for name (integer)
  • desc_len β€” the length of the string and/or buffer for desc (integer)

πŸŽ€ OUTPUT PARAMETERS πŸŽ€

the goodies she hands back to you:

  • name β€” buffer to return the string containing the name of the source (string)
  • desc β€” buffer to return the string containing the description of the source (string)
  • ordering β€” flag indicating chronological ordering guarantees given by the source (integer). it's giving order ✨
  • ticks_per_second β€” the number of ticks per second for the timer of this source (integer)
  • max_ticks β€” the maximum count of ticks reported by this source before overflow occurs (integer). yes, overflow. she has limits, and that's valid 🫢
  • info β€” info argument (handle)

🌈 THREAD AND INTERRUPT SAFETY 🌈

good news first: this routine is thread-safe. that means it may be safely used by multiple threads with no user-provided thread locks needed. no mutexes, no stress, we love a low-maintenance queen πŸ’…

but bestie… she is not interrupt safe. typically this is because of memory allocation routines like malloc or other non-MPICH runtime routines that are themselves not interrupt-safe. so don't interrupt her mid-glow-up 😭

πŸ’€ ERRORS πŸ’€

okay so ALL MPI routines (except MPI_Wtime and MPI_Wtick) return an error value β€” C routines give it as the value of the function, and Fortran routines put it in the last argument. before that value comes back, the current MPI error handler gets called. by default, this error handler aborts the MPI job. yes, straight up aborts. dramatic but that's her vibe.

the error handler can be changed 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 β€” like, we don't do that anymore, okay? πŸ™ˆ the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned.

note that MPI does not guarantee that an MPI program can continue past an error; however, MPI implementations will attempt to continue whenever possible. so like… good luck but no promises πŸ“

and here's the error code lineup:

  • MPI_SUCCESS β€” No error; MPI routine completed successfully. slay, we ate πŸ’–
  • MPI_T_ERR_INVALID β€” Invalid use of the interface or bad parameter values(s).
  • MPI_T_ERR_INVALID_INDEX β€” Index is invalid or has been deleted. rip to that index πŸͺ¦
  • MPI_T_ERR_NOT_INITIALIZED β€” The MPI tool information interface is not initialized.
  • MPI_ERR_OTHER β€” Other error; use MPI_Error_string to get more information about this error code.

πŸ‘‘ SEE ALSO πŸ‘‘

nothing listed here, bestie β€” this page is a solo main character. periodt. ✨


this was pulled from the MPI manual, MPI_T_source_get_info(3), dated 4/10/2026 β€” mwah, tysm for reading, go query those sources responsibly πŸ«ΆπŸ’œ

πŸ“¦ where this page comes from