15{
17 int ret;
18 int nthreads;
19 int *evtset;
20 int *ctrcode;
21
22 nthreads = omp_get_max_threads( );
23 evtset = ( int * ) malloc( sizeof ( int ) * nthreads );
24 ctrcode = ( int * ) malloc( sizeof ( int ) * nthreads );
25
27
30 fprintf(
stderr,
"PAPI library version mismatch '%s'\n",
32 exit( 1 );
33 }
34
35 if ( ret < 0 ) {
36 fprintf(
stderr,
"PAPI initialization error '%s'\n",
38 exit( 1 );
39 }
40
41 if ( ( ret =
44 fprintf(
stderr,
"PAPI thread initialization error '%s'\n",
46 exit( 1 );
47 }
48
49 for (
i = 0;
i < nthreads;
i++ ) {
51
54 fprintf(
stderr,
"PAPI evt-name-to-code error '%s'\n",
56 }
57
58 }
59
61#pragma omp parallel
62 {
63 int tid;
65 tid = omp_get_thread_num( );
66
67 pid = pthread_self( );
68
72 "[%5d] Error in register thread (tid=%d pid=%d) '%s'\n",
74 test_fail( __FILE__, __LINE__,
"omptough", 1 );
75 }
76 }
77
82 "[%5d] Error creating eventset (tid=%d pid=%d) '%s'\n",
84 test_fail( __FILE__, __LINE__,
"omptough", 1 );
85 }
86 }
87
88
89 if ( ( ret =
93 "[%5d] Error destroying eventset (tid=%d pid=%d) '%s'\n",
96 test_fail( __FILE__, __LINE__,
"omptough", 1 );
97 }
98 }
99
103 "[%5d] Error in unregister thread (tid=%d pid=%d) ret='%s'\n",
105 test_fail( __FILE__, __LINE__,
"omptough", 1 );
106 }
107 }
108 }
109 }
111
112 return 0;
113}
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'.
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)