1PAPI_thread_id(3)                    PAPI                    PAPI_thread_id(3)
2
3
4

NAME

6       PAPI_thread_id - get the thread identifier of the current thread
7
8

SYNOPSIS

10       C Interface
11       #include <papi.h>
12       unsigned long PAPI_thread_id(void);
13       Fortran Interface
14       #include fpapi.h
15       PAPIF_thread_id(C_INT id)
16
17

DESCRIPTION

19       This  function returns a valid thread identifier. It calls the function
20       registered with PAPI through a call to PAPI_thread_init().
21
22

ARGUMENTS

24       None.
25
26

RETURN VALUES

28       On success, this function returns PAPI_OK.
29        On error, a negative error value is returned.
30
31

ERRORS

33       PAPI_EMISC
34              is returned if there are no threads registered.
35
36       -1     is returned if the thread id function returns an error.
37
38

EXAMPLE

40       unsigned long tid;
41
42       if ((tid = PAPI_thread_id()) == (unsigned long int)-1)
43         exit(1);
44
45       printf("Initial thread id is: %lu\n",tid);
46
47

BUGS

49       This function has no known bugs.
50
51

SEE ALSO

53       PAPI_thread_init(3)
54
55
56
57PAPI Programmer's Reference     September, 2004              PAPI_thread_id(3)
Impressum