23 #define MINCOUNTS 100000 24 #define MPX_TOLERANCE 0.20 25 #define NUM_FLOPS 20000000 29 main(
int argc,
char **argv )
34 double x = 1.1,
y, dtmp;
56 if ( !strcmp( argv[1],
"TESTS_QUIET" ) ) {
59 sleep_time =
atoi( argv[1] );
60 if ( sleep_time <= 0 )
82 printf(
"\nAccuracy check of multiplexing routines.\n" );
83 printf(
"Investigating the variance of multiplexed measurements.\n\n" );
95 "PAPI multiplex init fail\n",
retval );
110 test_fail( __FILE__, __LINE__,
"PAPI_assign_eventset_component",
116 test_skip(__FILE__, __LINE__,
"Multiplex not supported", 1);
124 for (
i = 0;
i < nevents;
i++ ) {
136 test_skip( __FILE__, __LINE__,
"Not enough events left...", 0 );
144 t2 = 10000 * 20 * nevents;
146 test_skip( __FILE__, __LINE__,
"This test takes too much time",
157 iters = iters * ( int ) (
t2 /
t1 );
160 else if (
t1 > 30e6 ) {
161 test_skip( __FILE__, __LINE__,
"This test takes too much time",
183 printf(
"\nTest %d (of %d):\n",
i,
REPEATS );
192 printf(
"\n(calculated independent of PAPI)\n" );
193 printf(
"\tOperations= %.1f Mflop",
y * 1e-6 );
194 printf(
"\t(%g Mflop/s)\n\n",
195 (
y / (
double ) (
t2 -
t1 ) ) );
196 printf(
"PAPI measurements:\n" );
198 for ( j = 0; j < nevents; j++ ) {
201 printf(
"%lld",
values[j] );
208 for ( j = 0; j < nevents; j++ ) {
209 dtmp = ( double )
values[j];
211 valsample[j][
i - 1] = dtmp;
219 printf(
"\n\nEstimated variance relative " 220 "to average counts:\n" );
221 for ( j = 0; j < nevents; j++ )
222 printf(
" Event %.2d", j );
232 for ( j = 0; j < nevents; j++ ) {
236 double diff = ( valsample[j][
i] - avg[j] );
237 spread[j] += diff * diff;
239 spread[j] = sqrt( spread[j] /
REPEATS ) / avg[j];
241 printf(
"%9.2g ", spread[j] );
254 for ( j = 0; j < nevents; j++ ) {
256 printf(
"Event %.2d: mean=%10.0f, " 257 "sdev/mean=%7.2g nrpt=%2d -- %s\n",
258 j, avg[j], spread[j],
266 "Values outside threshold", fails );
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
int PAPI_reset(int EventSet)
double do_flops3(double x, int iters, int quiet)
Return codes and api definitions.
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
void test_skip(const char *file, int line, const char *call, int retval)
char events[MAX_EVENTS][BUFSIZ]
int PAPI_library_init(int version)
char short_descr[PAPI_MIN_STR_LEN]
int PAPI_assign_eventset_component(int EventSet, int cidx)
int PAPI_create_eventset(int *EventSet)
int PAPI_multiplex_init(void)
long long PAPI_get_real_usec(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_set_multiplex(int EventSet)
int PAPI_read(int EventSet, long long *values)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]
int main(int argc, char **argv)