11 #define NITER (100000) 14 main(
int argc,
char *argv[] )
22 nthreads = omp_get_max_threads( );
23 evtset = (
int * ) malloc(
sizeof (
int ) * nthreads );
24 ctrcode = (
int * ) malloc(
sizeof (
int ) * nthreads );
30 fprintf( stderr,
"PAPI library version mismatch '%s'\n",
36 fprintf( stderr,
"PAPI initialization error '%s'\n",
44 fprintf( stderr,
"PAPI thread initialization error '%s'\n",
49 for (
i = 0;
i < nthreads;
i++ ) {
54 fprintf( stderr,
"PAPI evt-name-to-code error '%s'\n",
65 tid = omp_get_thread_num( );
67 pid = pthread_self( );
72 "[%5d] Error in register thread (tid=%d pid=%d) '%s'\n",
74 test_fail( __FILE__, __LINE__,
"omptough", 1 );
82 "[%5d] Error creating eventset (tid=%d pid=%d) '%s'\n",
84 test_fail( __FILE__, __LINE__,
"omptough", 1 );
93 "[%5d] Error destroying eventset (tid=%d pid=%d) '%s'\n",
96 test_fail( __FILE__, __LINE__,
"omptough", 1 );
103 "[%5d] Error in unregister thread (tid=%d pid=%d) ret='%s'\n",
105 test_fail( __FILE__, __LINE__,
"omptough", 1 );
void test_pass(const char *filename)
int PAPI_register_thread(void)
int PAPI_event_name_to_code(const char *in, int *out)
Return codes and api definitions.
int PAPI_thread_init(unsigned long int(*id_fn)(void))
int PAPI_library_init(int version)
int PAPI_create_eventset(int *EventSet)
int PAPI_unregister_thread(void)
char * PAPI_strerror(int errorCode)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int main(int argc, char *argv[])
int PAPI_destroy_eventset(int *EventSet)