NAME
PAPI_thread_id - get the thread identifier of the current thread
Synopsis Description Arguments Return Values Errors Example Bugs See Also
C Interface #include <papi.h> unsigned long PAPI_thread_id(void); Fortran Interface #include fpapi.h PAPIF_thread_id(C_INT id)
#include <papi.h> unsigned long PAPI_thread_id(void);
#include fpapi.h PAPIF_thread_id(C_INT id)
This function returns a valid thread identifier. It calls the function registered with PAPI through a call to PAPI_thread_init().
None.
On success, this function returns a valid unsigned long thread id. On error, an unsigned cast of a negative error value is returned.
PAPI_EMISC is returned if there are no threads registered. -1 is returned if the thread id function returns an error.
unsigned long tid; if ((tid = PAPI_thread_id()) == (unsigned long int)-1) exit(1); printf("Initial thread id is: %lu\n",tid);
if ((tid = PAPI_thread_id()) == (unsigned long int)-1) exit(1);
printf("Initial thread id is: %lu\n",tid);
This function has no known bugs.
PAPI_thread_init (3)