24#define THRESHOLD 200000
25#define OVER_FMT "handler(%d ) Overflow at %p! bit=%#llx \n"
26#define ERROR_RETURN(retval) { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }
111 printf(
"Thread %#x PAPI_TOT_INS : \t%lld\n",(
int)
PAPI_thread_id(),
113 printf(
" PAPI_TOT_CYC: \t%lld\n",
values[1]);
133 printf(
"Library initialization error! \n");
149 pthread_attr_init(&attr);
150 pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
154 rc = pthread_create(&thread_one, &attr,
Thread, (
void *)&flops1);
160 rc = pthread_create(&thread_two, &attr,
Thread, (
void *)&flops2);
165 pthread_attr_destroy(&attr);
166 pthread_join(thread_one, NULL);
167 pthread_join(thread_two, NULL);
174 printf(
"Master real usec : \t%lld\n",
elapsed_us);
175 printf(
"Master real cycles : \t%lld\n",
elapsed_cyc);
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
get real time counter value in microseconds
initialize the PAPI library.
Set up an event set to begin registering overflows.
Query if PAPI event exists.
removes a hardware event from a PAPI event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Get the thread identifier of the current thread.
Initialize thread support in the PAPI library.
#define ERROR_RETURN(retval)
void handler(int EventSet, void *address, long long overflow_vector, void *context)
static long long values[NUM_EVENTS]
static double a[MATRIX_SIZE][MATRIX_SIZE]
static double b[MATRIX_SIZE][MATRIX_SIZE]
static double c[MATRIX_SIZE][MATRIX_SIZE]
Return codes and api definitions.
unsigned long int pthread_t