NAME

PAPI_library_init - initialize the PAPI library

CONTENTS

Synopsis
Description
Arguments
Return Values
Errors
Examples
Author
Bugs
See Also

SYNOPSIS

C Interface

#include <papi.h> 

int PAPI_library_init(int version); 

Fortran Interface

#include fpapi.h 

PAPIF_library_init(C_INT check) 

DESCRIPTION

PAPI_library_init() initializes the PAPI library. It must be called before any PAPI functions can be used. If your application is making use of threads PAPI_thread_init (3) must also be called prior to making any calls to the library other than PAPI_library_init().

ARGUMENTS

version -- upon initialization, PAPI checks the argument against the internal value of PAPI_VER_CURRENT when the library was compiled. This guards against portability problems when updating the PAPI shared libraries on your system.

RETURN VALUES

On success, this function returns PAPI_VER_CURRENT .

A positive return code other than PAPI_VER_CURRENT indicates a library version mis-match.

A negative error code indicates an initialization error.

ERRORS

PAPI_EINVAL
  papi.h is different from the version used to compile the PAPI library.
PAPI_ENOMEM
  Insufficient memory to complete the operation.
PAPI_ESBSTR
  This substrate does not support the underlying hardware.
PAPI_ESYS
  A system or C library call failed inside PAPI, see the errno variable.

EXAMPLES


int retval;

/* Initialize the library */

retval = PAPI_library_init(PAPI_VER_CURRENT);

if (retval != PAPI_VER_CURRENT && retval > 0) { fprintf(stderr,"PAPI library version mismatch!\n"); exit(1); }

if (retval < 0) handle_error(retval);

AUTHOR

Philip J. Mucci <mucci@cs.utk.edu>

BUGS

If you don’t call this before using any of the low level PAPI calls, you’re application could core dump.

SEE ALSO

PAPI_thread_init (3), PAPI_preset (3), PAPI (3),
The PAPI Web Site: http://icl.cs.utk.edu/projects/papi


PAPI Function Reference PAPI_library_init (3) December, 2001

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