/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval != PAPI_VER_CURRENT)
handle_error("PAPI_library_init",__LINE__,retval);
/* Enable multiplexing support */
retval = PAPI_multiplex_init();
if (retval != PAPI_OK)
handle_error("PAPI_multiplex_init",__LINE__,retval);
/* Turn on thread support in PAPI */
if (PAPI_thread_init((unsigned long (*)(void))(pthread_self), 0) != PAPI_OK)
handle_error("PAPI_thread_init",__LINE__,retval);