36 printf(
"handler(%d,%#lx,%llx) Overflow %d in thread %lx\n",
37 EventSet, (
unsigned long ) address, overflow_vector,
42 ( void ) overflow_vector;
55 int mask1, papi_event;
115 printf(
"Thread %#x %s : \t%lld\n", (
int ) pthread_self( ),
117 printf(
"Thread %#x PAPI_TOT_CYC: \t%lld\n", (
int ) pthread_self( ),
119 printf(
"Thread %#x Real usec : \t%lld\n", (
int ) pthread_self( ),
121 printf(
"Thread %#x Real cycles : \t%lld\n", (
int ) pthread_self( ),
155 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
172 pthread_attr_init( &attr );
173#ifdef PTHREAD_CREATE_UNDETACHED
174 pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_UNDETACHED );
176#ifdef PTHREAD_SCOPE_SYSTEM
177 retval = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM );
184 rc = pthread_create( &
id[
i], &attr,
Thread, (
void * ) &flops[
i] );
189 pthread_join(
id[
i], NULL );
191 pthread_attr_destroy( &attr );
194 long long t = 0, r = 0;
200 printf(
"Expected total overflows: %lld\n", t );
201 printf(
"Received total overflows: %lld\n", r );
210 if (!
quiet) printf(
"Overflows thread %d: %d, expected %d\n",
221 pthread_exit( NULL );
Convert a numeric hardware event code to a name.
get information about the system hardware
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.
Notify PAPI that a thread has 'appeared'.
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.
Notify PAPI that a thread has 'disappeared'.
static int total[NUM_THREADS]
static const PAPI_hw_info_t * hw_info
static int expected[NUM_THREADS]
static void handler(int EventSet, void *address, long long overflow_vector, void *context)
static void * Thread(void *arg)
static long long mythreshold
static pthread_t myid[NUM_THREADS]
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
Return codes and api definitions.
unsigned long int pthread_t
int tests_quiet(int argc, char **argv)
int add_two_nonderived_events(int *num_events, int *papi_event, int *mask)
void free_test_space(long long **values, int num_tests)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
long long ** allocate_test_space(int num_tests, int num_events)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
int remove_test_events(int *EventSet, int mask)