PAPI_thread_init(3)
π PAPI_thread_init(3) β the PAPI manual page, bestie π
β¨ NAME β¨
PAPI_thread_init β initialize thread support in the PAPI library.
πΈ SYNOPSIS πΈ
The real synopsis tea is all in the Detailed Description below, bestie. Keep scrolling. π
π Detailed Description π
π Parameters π
*id_fnβ pointer to a function that returns current thread ID.
PAPI_thread_init initializes thread support in the PAPI library. Applications that make no use of threads do not need to call this routine. π«Ά
This function MUST return a UNIQUE thread ID for every new thread/LWP created. No cap. π¨
The OpenMP call omp_get_thread_num() violates this rule, because the underlying LWPs may have been killed off by the run-time system or by a call to omp_set_num_threads(). π In that case, it may still be possible to use omp_get_thread_num() in conjunction with PAPI_unregister_thread() when the OpenMP thread has finished. But honestly? It is much better to use the underlying thread subsystemβs call, which is pthread_self() on Linux platforms. Slay. π§β¨
if ( PAPI_thread_init(pthread_self) != PAPI_OK )
exit(1);
Thatβs the whole vibe check: if itβs not PAPI_OK, you bail. π
π See also π
PAPI_register_threadPAPI_unregister_threadPAPI_get_thr_specificPAPI_set_thr_specificPAPI_thread_idPAPI_list_threads
π Author π
Generated automatically by Doxygen for PAPI from the source code.
This page came from the PAPI source, version 7.2.0.0, dated Wed Jun 25 2025 19:30:49. PAPI_thread_init(3) signing off β mwah ππ
π¦ where this page comes from
- nixos 26.05: papi 7.2.0
- nixpkgs unstable: papi 7.2.0
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: papi-devel 7.2.0-160000.2.2 Β· BSD-3-Clause
- ubuntu resolute: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- ubuntu stonking: libpapi-dev 7.2.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms