logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

PAPI_thread_init - Initialize thread support in the PAPI library.

Author

       Generated automatically by Doxygen for PAPI from the source code.

Version 7.1.0.0                                  Thu Dec 14 2023                             PAPI_thread_init(3)

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. The OpenMP call omp_get_thread_num() violates this rule, as 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
       possible to use omp_get_thread_num() in conjunction with PAPI_unregister_thread() when the OpenMP thread
       has finished. However it is much better to use the underlying thread subsystem's call, which is
       pthread_self() on Linux platforms.

       if ( PAPI_thread_init(pthread_self) != PAPI_OK )
           exit(1);

       SeealsoPAPI_register_threadPAPI_unregister_threadPAPI_get_thr_specificPAPI_set_thr_specificPAPI_thread_idPAPI_list_threads

Name

       PAPI_thread_init - Initialize thread support in the PAPI library.

Synopsis

See Also