51#error "This compiler does not understand OPENMP"
68 printf(
"Thread %#x started\n", omp_get_thread_num( ) );
78 test_fail(__FILE__,__LINE__,
"No events",0);
108 printf(
"Thread %#x %-12s : \t%lld\n", omp_get_thread_num( ),
110 printf(
"Thread %#x PAPI_TOT_CYC: \t%lld\n", omp_get_thread_num( ),
112 printf(
"Thread %#x Real usec : \t%lld\n", omp_get_thread_num( ),
114 printf(
"Thread %#x Real cycles : \t%lld\n", omp_get_thread_num( ),
124 printf(
"Thread %#x finished\n", omp_get_thread_num( ) );
129 return (
unsigned long)omp_get_thread_num();
149 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
153 if (!
quiet) printf(
"Can't find PAPI_TOT_INS\n");
154 test_skip(__FILE__,__LINE__,
"Event missing",1);
158 if (!
quiet) printf(
"Can't find PAPI_TOT_CYC\n");
159 test_skip(__FILE__,__LINE__,
"Event missing",1);
170 if (!
quiet) printf(
"Trouble init threads\n");
179 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
181 omp_set_num_threads( 1 );
182 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
183 omp_set_num_threads( omp_get_max_threads( ) );
186 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
194 printf(
"Master real usec : \t%lld\n",
elapsed_us );
195 printf(
"Master real cycles : \t%lld\n",
elapsed_cyc );
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.
Query if PAPI event exists.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Initialize thread support in the PAPI library.
Notify PAPI that a thread has 'disappeared'.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
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)
int add_two_events(int *num_events, int *papi_event, int *mask)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
int remove_test_events(int *EventSet, int mask)
const PAPI_hw_info_t * hw_info
unsigned long omp_get_thread_num_wrapper(void)