unsigned long tid;
if (PAPI_library_init(PAPI_VER_CURRENT) != PAPI_VER_CURRENT)
exit(1);
if (PAPI_thread_init(pthread_self) != PAPI_OK)
exit(1);
if ((tid = PAPI_thread_id()) == (unsigned long int)-1)
exit(1);
printf("Initial thread id is: %lu\n",tid);