int retval;
/* Initialize the library */
retval = PAPI_library_init(PAPI_VER_CURRENT);
if (retval > 0 && retval != PAPI_VER_CURRENT) {
fprintf(stderr,"PAPI library version mismatch!0);
exit(1); }
if (retval < 0)
handle_error(retval);
/* Set the default granularity for the cpu component */
if ((retval = PAPI_set_cmp_granularity(PAPI_GRN_PROC,0)) != PAPI_OK)
handle_error(retval);
if ((retval = PAPI_create_eventset(&EventSet)) != PAPI_OK)
handle_error(retval);