|
NAME
PAPI_thread_init - initialize thread support in the PAPI library
CONTENTS
Synopsis
Description
Arguments
Return Values
Errors
Examples
Author
Bugs
See Also
SYNOPSIS
C Interface
#include <papi.h>
int PAPI_thread_init (unsigned long int (*handle)(), int flag);
Fortran Interface
#include fpapi.h
PAPIF_thread_init(C_INT FUNCTION handle, C_INT flag, C_INT check)
DESCRIPTION
PAPI_thread_init initializes thread support in the PAPI library. Itshould be called
only once, just after
PAPI_library_init (3),
and before any other PAPI calls. Applications that make no use of threads
do not need to call this routine.
ARGUMENTS
handle -- Pointer to a function that returns current thread ID.
flag -- This is reserved for future use and should be set to zero.
RETURN VALUES
On success, this function returns
PAPI_OK.
On error, a non-zero error code is returned.
ERRORS
|
PAPI_EINVAL | | |
One or more of the arguments is invalid.
|
|
EXAMPLES
For Pthreads:
if (PAPI_thread_init(pthread_self, 0) != PAPI_OK)
handle_error(1);
For OpenMP:
if (PAPI_thread_init(omp_get_thread_num,0) != PAPI_OK)
handle_error(1);
AUTHOR
Philip J. Mucci <mucci@cs.utk.edu>
BUGS
This function causes the application to exit if it is called more than once.
SEE ALSO
The PAPI Web Site:
http://icl.cs.utk.edu/projects/papi
| PAPI Function Reference | PAPI_thread_init (3) | December, 2001 |
|
|