NAME

PAPI_thread_init - initialize thread support in the PAPI library

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Authors
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_thread_init (unsigned long int (*handle)()); 

Fortran Interface

#include fpapi.h 

PAPIF_thread_init(C_INT FUNCTION handle, 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.

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) != PAPI_OK)
  handle_error(1);


For OpenMP:


if (PAPI_thread_init(omp_get_thread_num) != PAPI_OK)
  handle_error(1);


AUTHORS

The PAPI Team. See them at the PAPI Web Site: http://icl.cs.utk.edu/projects/papi

BUGS

This function causes the application to exit if it is called more than once.

SEE ALSO

PAPI_library_init (3), PAPI_thread_id (3), PAPI_get_thr_specific (3), PAPI_set_thr_specific (3)


PAPI Programmer’s Reference PAPI_thread_init (3) November, 2003

  Innovative Computing Laboratory
2001 R&D Winner  
Contact PAPI: papi@cs.utk.edu Computer Science Department
  University of Tennessee