36#error "This compiler does not understand OPENMP"
98 printf(
"Thread %#x PAPI_TOT_CYC: \t%lld\n", omp_get_thread_num( ),
100 printf(
"Thread %#x Real usec : \t%lld\n", omp_get_thread_num( ),
102 printf(
"Thread %#x Real cycles : \t%lld\n", omp_get_thread_num( ),
120 int maxthr = omp_get_max_threads( );
122 long long *flops = calloc( maxthr,
sizeof (
long long ) );
123 long long *flopi = calloc( maxthr,
sizeof (
long long ) );
130 if ( ( flops == NULL ) || ( flopi == NULL ) )
139 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
143 long ( * )(
void ) ) ( omp_get_thread_num ) );
150 flopper =
Thread( 65536 ) / 65536;
151 printf(
"flopper=%d\n", flopper );
153 for (
int i = 0;
i < 100000;
i++ )
154#pragma omp parallel
private(tid)
156 tid = omp_get_thread_num( );
157 flopi[tid] = rand( ) * 3;
161 if ( flops[tid] < flopi[tid] ) {
162 printf(
"test iteration=%d\n",
i );
163 for (
int j = 0; j < omp_get_num_threads( ); j++ ) {
164 printf(
"Thread %#x Value %6lld %c %6lld", j, flops[j],
165 ( flops[j] < flopi[j] ) ?
'<' :
'=', flopi[j] );
166 for (
int k = 0; k < omp_get_num_threads( ); k++ )
167 if ( ( k != j ) && ( flops[k] == flops[j] ) )
168 printf(
" == Thread %#x!", k );
171 test_fail( __FILE__, __LINE__,
"value returned for thread",
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.
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]
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