14main(
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 );
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Convert a name to a numeric hardware event code.
initialize the PAPI library.
Notify PAPI that a thread has 'appeared'.
Returns a string describing the PAPI error code.
Initialize thread support in the PAPI library.
Notify PAPI that a thread has 'disappeared'.
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)