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( ) );
145 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
149 if (!
quiet) printf(
"Can't find PAPI_TOT_INS\n");
150 test_skip(__FILE__,__LINE__,
"Event missing",1);
154 if (!
quiet) printf(
"Can't find PAPI_TOT_CYC\n");
155 test_skip(__FILE__,__LINE__,
"Event missing",1);
164 ( omp_get_thread_num ) );
167 if (!
quiet) printf(
"Trouble init threads\n");
176 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
178 omp_set_num_threads( 1 );
179 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
180 omp_set_num_threads( omp_get_max_threads( ) );
183 Thread( 1000000 * ( omp_get_thread_num( ) + 1 ) );
191 printf(
"Master real usec : \t%lld\n",
elapsed_us );
192 printf(
"Master real cycles : \t%lld\n",
elapsed_cyc );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int main(int argc, char **argv)
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
int add_two_events(int *num_events, int *papi_event, int *mask)
void free_test_space(long long **values, int num_tests)
const PAPI_hw_info_t * hw_info
int PAPI_event_code_to_name(int EventCode, char *out)
int PAPI_query_event(int EventCode)
long long PAPI_get_real_usec(void)
int PAPI_unregister_thread(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
long long PAPI_get_real_cyc(void)
int PAPI_start(int EventSet)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static long long values[NUM_EVENTS]
long long ** allocate_test_space(int num_tests, int num_events)
int remove_test_events(int *EventSet, int mask)