21{
22 int ncpu, nctr,
i, actual_domain;
28
31 fprintf(
stderr,
"Library mismatch: code %d, library %d\n",
retval,
33 exit( 1 );
34 }
35
37 exit( 1 );
38
39
40
45 exit( 1 );
46 actual_domain =
options.domain.domain;
47
48
49
54 exit( 1 );
55
56
57
60 values = (
long long * ) malloc( ncpu * nctr *
sizeof (
long long ) );
61 memset(
values, 0x0, ( ncpu * nctr *
sizeof (
long long ) ) );
62
63
64
66 exit( 1 );
67
69 exit( 1 );
70
72
74
77 exit( 1 );
78
79 sleep( 5 );
80
83 exit( 1 );
84
86
88
89 printf( "Test case: per node\n" );
90 printf( "-------------------\n\n" );
91
92 printf( "This machine has %d cpus, each with %d counters.\n", ncpu, nctr );
93 printf( "Test case asked for: PAPI_DOM_ALL\n" );
94 printf( "Test case got: " );
96 printf( "PAPI_DOM_USER " );
98 printf( "PAPI_DOM_KERNEL " );
100 printf( "PAPI_DOM_OTHER " );
101 printf( "\n" );
102
103 for (
i = 0;
i < ncpu;
i++ ) {
104 printf(
"CPU %d\n",
i );
105 printf(
"PAPI_TOT_CYC: \t%lld\n",
values[0 +
i * nctr] );
106 printf(
"PAPI_TOT_INS: \t%lld\n",
values[1 +
i * nctr] );
107 }
108
109 printf
110 ( "\n-------------------------------------------------------------------------\n" );
111
114
115 printf
116 ( "-------------------------------------------------------------------------\n" );
117
119
121
122 exit( 0 );
123}
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Get PAPI library or event set options.
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.
Set PAPI library or event set options.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]
A pointer to the following is passed to PAPI_set/get_opt()