57{
61 double cycles_error;
63
64
69
70
74 }
75
76
77 if (sleep_test) {
78 sleep(2);
79 }
80 else {
82 }
83
84
88 }
89
90
95
97 printf( "-------------------------------------------------------------------------\n" );
98 if (sleep_test) printf("Sleeping for 2s\n");
99 else printf( "Using %d iterations of c += a*b\n", numflops );
100 printf( "-------------------------------------------------------------------------\n" );
101
102 printf(
"PAPI_TOT_CYC : \t%10lld\n",
values[0] );
103 printf(
"PAPI_REF_CYC : \t%10lld\n",
values[1] );
104 printf(
"Real usec : \t%10lld\n",
elapsed_us );
106 printf( "Virt usec : \t%10lld\n", elapsed_virt_us );
107 printf( "Virt cycles (estimate) : \t%10lld\n", elapsed_virt_cyc );
109
110 printf( "-------------------------------------------------------------------------\n" );
111 }
112
113
114 if (sleep_test) {
116 printf( "Verification: PAPI_REF_CYC should be much lower than real_usec\n");
117 }
119 if (!
quiet) printf(
"PAPI_REF_CYC too high!\n");
120 test_fail( __FILE__, __LINE__,
"PAPI_REF_CYC too high", 0 );
121 }
122
123 }
124 else {
125
126
128 printf( "Verification: real_cyc should be roughly PAPI_REF_CYC\n");
129 printf( " real_usec should be roughly virt_usec (on otherwise idle system)\n");
130 }
131
132 cycles_error=100.0*
135
136 if ((cycles_error>10.0) || (cycles_error<-10.0)) {
137 if (!
quiet) printf(
"Error of %.2f%%\n",cycles_error);
138 test_fail( __FILE__, __LINE__,
"PAPI_REF_CYC validation", 0 );
139 }
140
141 cycles_error=100.0*
144
145 if ((cycles_error>10.0) || (cycles_error<-10.0)) {
146 if (!
quiet) printf(
"Error of %.2f%%\n",cycles_error);
147 test_warn( __FILE__, __LINE__,
"real_us validation", 0 );
148 }
149 }
150}
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
get virtual time counter value in clock cycles
get virtual time counter values in microseconds
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]
void test_warn(const char *file, int line, const char *call, int retval)