PAPI  5.7.0.0
papi_multiplex_cost.c
Go to the documentation of this file.
1 
33 /* Open Issues:
34  * Selecting events to add is very primitive right now.
35  * Output format, right now the format targets a gnuplot script I have,
36  * We will probably end up generating a csv per test
37  */
38 
39 #include <stdio.h>
40 #include <stdlib.h>
41 #include <string.h>
42 #include <unistd.h>
43 
44 #include "papi.h"
45 #include "cost_utils.h"
46 
47 static int first_time = 1;
48 static int skip = 0;
49 static FILE* fp;
50 
51 typedef struct {
53  int force_sw;
55  int min;
56  int max;
57 } options_t;
58 
60 
61 void
62 do_output( char *fn, char *message, long long* array, int noc )
63 {
64  long long min, max;
65  double average, std;
66 
67  std = do_stats( array, &min, &max, &average );
68 
69  if ( first_time ) {
70  skip = 0;
71 
72  fp = fopen(fn, "w");
73  if (fp == NULL) {
74  fprintf(stderr,"Unable to open output file, %s, output will not be saved.\n", fn);
75  skip = 1;
76  } else
77  fprintf(fp, "###%s\n#number of events\tmin cycles\tmax cycles\tmean cycles\t\
78 std deviation\tsw min cycles\tsw max cycles\tsw avg cycles\tsw std dev\n", message);
79 
80  first_time = 0;
81  }
82 
83  if ( !skip ) {
84  fprintf(fp, "%20d\t%10lld\t%10lld\t%10lf\t%10lf", noc, min, max, average, std);
85 
86  std = do_stats( array+num_iters, &min, &max, &average );
87  fprintf(fp, "\t%10lld\t%10lld\t%10lf\t%10lf\n", min, max, average, std);
88  fflush(fp);
89  }
90 }
91 
92 void
93 init_test(int SoftwareMPX, int KernelMPX, int* Events)
94 {
95  int i;
96  int retval;
97  PAPI_option_t option, itimer;
98 
99  retval = PAPI_assign_eventset_component( SoftwareMPX, 0 );
100  if (retval != PAPI_OK ) {
101  fprintf(stderr,"Error! PAPI_assign_eventset_component\n");
102  exit(retval);
103  }
104 
105  retval = PAPI_assign_eventset_component( KernelMPX, 0 );
106  if (retval != PAPI_OK ) {
107  fprintf(stderr,"Error! PAPI_assign_eventset_component\n");
108  exit(retval);
109  }
110 
111  retval = PAPI_set_multiplex( KernelMPX );
112  if (retval != PAPI_OK ) {
113  fprintf(stderr,"Error! PAPI_set_multiplex\n");
114  exit(retval);
115  }
116 
117  PAPI_get_opt(PAPI_DEF_ITIMER,&itimer);
118 
119  memset(&option,0x0,sizeof(option));
120 
122  option.multiplex.eventset = SoftwareMPX;
123  option.multiplex.ns = itimer.itimer.ns;
124 
125  retval = PAPI_set_opt( PAPI_MULTIPLEX, &option );
126  if (retval != PAPI_OK ) {
127  fprintf(stderr,"Error! PAPI_set_opt\n");
128  exit(retval);
129  }
130 
131  for (i = 0; i < options.min - 1; i++) {
132  if ( options.kernel_mpx ) {
133  retval = PAPI_add_event( KernelMPX, Events[i]);
134  if (retval != PAPI_OK ) {
135  fprintf(stderr,"Error! PAPI_add_event\n");
136  exit(retval);
137  }
138  }
139 
140  if ( options.force_sw ) {
141  retval = PAPI_add_event( SoftwareMPX, Events[i]);
142  if (retval != PAPI_OK ) {
143  fprintf(stderr,"Error! PAPI_add_event\n");
144  exit(retval);
145  }
146  }
147  }
148 }
149 
150 void
152 {
153  if (fp) fclose(fp);
154  first_time = 1;
155 }
156 
157 static void
158 usage(void)
159 {
160  printf( "Usage: papi_multiplex_cost [options]\n"
161  "\t-m num, number of events to count\n"
162  "\t-x num, number of events to count\n"
163  "\t-s, Do not run software multiplexing test.\n"
164  "\t-k, Do not attempt kernel multiplexed test.\n"
165  "\t-t THRESHOLD set the threshold for the number "
166  "of iterations. Default: 100,000\n" );
167 }
168 
169 int
170 main( int argc, char **argv )
171 {
172  int retval, retval_start, retval_stop;
173  int KernelMPX = PAPI_NULL;
174  int SoftwareMPX = PAPI_NULL;
175  int *Events = NULL;
176  int number_of_counters;
177  int i;
178  int c;
179  int dont_loop_forever;
180  long long totcyc, *values = NULL;
181  long long *array = NULL;
182  int event;
183 
184  PAPI_option_t option, itimer;
185  const PAPI_component_info_t *info;
186 
188  options.min = 1;
189  options.max = 10;
190  options.force_sw = 1;
191  options.kernel_mpx = 1;
192 
193  while ( ( c=getopt(argc, argv, "hm:x:skt:") ) != -1 ) {
194  switch (c) {
195  case 'h':
196  usage();
197  exit(0);
198  case 'm':
199  options.min = atoi(optarg);
200  break;
201  case 'x':
202  options.max = atoi(optarg);
203  break;
204  case 's':
205  options.force_sw = 0;
206  break;
207  case 'k':
208  options.kernel_mpx = 0;
209  break;
210  case 't':
211  num_iters = atoi(optarg);
212  default:
213  break;
214  }
215  }
216 
217  printf("This utility benchmarks the overhead of PAPI multiplexing\n");
218  printf("Warning! This can take a long time (many minutes) to run\n");
219  printf("The output goes to multiple .dat files in the current directory\n\n");
220 
221  if ( options.min > options.max ) {
222  fprintf(stderr,"Error! Min # of Events > Max # of Events");
223  goto cleanup;
224  }
225 
226  values = (long long*)malloc(sizeof(long long) * options.max);
227  array = (long long *)malloc(sizeof(long long) * 2 * num_iters);
228  Events = ( int* )malloc(sizeof(int) * options.max);
229 
231  if (retval != PAPI_VER_CURRENT ) {
232  fprintf(stderr, "Error! PAPI_library_init\n");
233  exit(retval);
234  }
235 
237  if (retval != PAPI_OK ) {
238  fprintf(stderr,"Error! PAPI_set_debug\n");
239  exit(retval );
240  }
241 
243  if (retval != PAPI_OK ) {
244  fprintf(stderr,"Error! PAPI_multiplex_init\n");
245  exit(retval);
246  }
247 
248  info = PAPI_get_component_info(0);
250 
251  if ( options.kernel_mpx && !info->kernel_multiplex ) {
252  fprintf(stderr,"Error! Kernel multiplexing is "
253  "not supported on this platform, bailing!\n");
254  exit(1);
255  }
256 
257  retval = PAPI_create_eventset( &SoftwareMPX );
258  if (retval != PAPI_OK) {
259  fprintf(stderr,"Error! PAPI_create_eventset\n");
260  exit(retval);
261  }
262 
263  retval = PAPI_create_eventset( &KernelMPX );
264  if (retval != PAPI_OK ) {
265  fprintf(stderr,"PAPI_create_eventset");
266  exit(retval);
267  }
268 
269  retval = PAPI_assign_eventset_component( KernelMPX, 0 );
270  if (retval != PAPI_OK ) {
271  fprintf(stderr,"PAPI_assign_eventset_component");
272  exit(retval);
273  }
274 
275  retval = PAPI_set_multiplex( KernelMPX );
276  if (retval != PAPI_OK ) {
277  fprintf(stderr,"PAPI_set_multiplex");
278  exit(retval);
279  }
280 
281  retval = PAPI_assign_eventset_component( SoftwareMPX, 0 );
282  if (retval != PAPI_OK ) {
283  fprintf(stderr,"PAPI_assign_eventset_component");
284  exit(retval);
285  }
286 
287  PAPI_get_opt(PAPI_DEF_ITIMER,&itimer);
288 
289  memset(&option,0x0,sizeof(option));
290 
292  option.multiplex.eventset = SoftwareMPX;
293  option.multiplex.ns = itimer.itimer.ns;
294 
295  retval = PAPI_set_opt( PAPI_MULTIPLEX, &option );
296  if (retval != PAPI_OK) {
297  fprintf(stderr,"PAPI_set_opt");
298  exit(retval);
299  }
300 
301  if ( !options.kernel_mpx && !options.force_sw ) {
302  fprintf(stderr,"No tests to run.");
303  goto cleanup;
304  } else {
305  fprintf(stderr,"Running test[s]\n");
306  if (options.kernel_mpx)
307  fprintf(stderr,"\tKernel multiplexing read\n");
308  if (options.force_sw)
309  fprintf(stderr,"\tSoftware Multiplexing read\n");
310  }
311 
312  event = 0 | PAPI_NATIVE_MASK;
313  PAPI_enum_event( &event, PAPI_ENUM_FIRST );
314 
315  /* Find some events to run the tests with. */
316  for (number_of_counters = 0; number_of_counters < options.max; number_of_counters++) {
317  dont_loop_forever = 0;
318 
319  if ( options.kernel_mpx ) {
320  do {
322  dont_loop_forever++;
323  } while ( ( retval = PAPI_add_event( KernelMPX, event ) ) != PAPI_OK &&
324  dont_loop_forever < 512);
325  } else {
326  do {
328  dont_loop_forever++;
329  } while ( ( retval = PAPI_add_event( SoftwareMPX, event) ) != PAPI_OK &&
330  dont_loop_forever < 512);
331  }
332  if ( dont_loop_forever == 512 )
333  fprintf(stderr,"I can't find %d events to count at once.", options.max);
334 
335  Events[number_of_counters] = event;
336  }
337 
338  PAPI_cleanup_eventset( KernelMPX );
339  PAPI_cleanup_eventset( SoftwareMPX );
340 
341  /* Start/Stop test */
342  init_test(SoftwareMPX, KernelMPX, Events);
343 
344  for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
345 
346  if ( options.kernel_mpx ) {
347  if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
348  fprintf(stderr,"PAPI_add_event");
349  goto cleanup;
350  }
351 
352  if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
353  fprintf(stderr,"PAPI_start");
354  exit(retval);
355  }
356  if ( ( retval = PAPI_stop( KernelMPX, values ) ) != PAPI_OK ) {
357  fprintf(stderr,"PAPI_stop");
358  exit(retval);
359  }
360 
361  /* KernelMPX Timing loop */
362  for ( i = 0; i < num_iters; i++ ) {
363  totcyc = PAPI_get_real_cyc();
364  retval_start=PAPI_start( KernelMPX );
365  retval_stop=PAPI_stop( KernelMPX, values );
366  array[i] = PAPI_get_real_cyc() - totcyc;
367  if (retval_start || retval_stop)
368  fprintf(stderr,"PAPI start/stop");
369  } /* End 1 timing run */
370 
371  } else
372  memset(array, 0, sizeof(long long) * num_iters );
373 
374  /* Also test software multiplexing */
375  if ( options.force_sw ) {
376  if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
377  fprintf(stderr,"PAPI_add_event");
378  goto cleanup;
379  }
380 
381  if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
382  fprintf(stderr,"PAPI_start");
383  exit(retval);
384  }
385  if ( ( retval = PAPI_stop( SoftwareMPX, values ) ) != PAPI_OK ) {
386  fprintf(stderr,"PAPI_stop");
387  exit(retval);
388  }
389 
390  /* SoftwareMPX Timing Loop */
391  for ( i = num_iters; i < 2*num_iters; i++ ) {
392  totcyc = PAPI_get_real_cyc();
393  retval_start=PAPI_start( SoftwareMPX );
394  retval_stop=PAPI_stop( SoftwareMPX, values );
395  array[i] = PAPI_get_real_cyc() - totcyc;
396  if (retval_start || retval_stop)
397  fprintf(stderr,"PAPI start/stop");
398  } /* End 2 timing run */
399 
400  } else {
401  memset(array+num_iters, 0, sizeof(long long) * num_iters );
402  }
403 
404  do_output( "papi_startstop.dat", "Multiplexed PAPI_read()", array, number_of_counters );
405 
406  } /* End counter loop */
407  PAPI_cleanup_eventset( SoftwareMPX );
408  PAPI_cleanup_eventset( KernelMPX );
409  finalize_test();
410 
411  /* PAPI_read() test */
412  init_test(SoftwareMPX, KernelMPX, Events);
413 
414  for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
415 
416  if ( options.kernel_mpx ) {
417  if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
418  fprintf(stderr,"PAPI_add_event");
419  goto cleanup;
420  }
421 
422  if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
423  fprintf(stderr,"PAPI_start");
424  exit(retval);
425  }
426  PAPI_read( KernelMPX, values );
427 
428  /* KernelMPX Timing loop */
429  for ( i = 0; i < num_iters; i++ ) {
430  totcyc = PAPI_get_real_cyc();
431  retval = PAPI_read( KernelMPX, values );
432  array[i] = PAPI_get_real_cyc() - totcyc;
433  } /* End 1 timing run */
434 
435  retval_stop=PAPI_stop( KernelMPX, values );
436  if (retval_stop!=PAPI_OK)
437  fprintf(stderr,"PAPI_stop");
438  } else
439  memset(array, 0, sizeof(long long) * num_iters );
440 
441  /* Also test software multiplexing */
442  if ( options.force_sw ) {
443  if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
444  fprintf(stderr,"PAPI_add_event");
445  goto cleanup;
446  }
447 
448  if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
449  fprintf(stderr,"PAPI_start");
450  exit(retval);
451  }
452  PAPI_read( SoftwareMPX, values );
453 
454  /* SoftwareMPX Timing Loop */
455  for ( i = num_iters; i < 2*num_iters; i++ ) {
456  totcyc = PAPI_get_real_cyc();
457  retval = PAPI_read( SoftwareMPX, values );
458  array[i] = PAPI_get_real_cyc() - totcyc;
459  } /* End 2 timing run */
460 
461  retval_stop=PAPI_stop( SoftwareMPX, values );
462  if (retval_stop!=PAPI_OK)
463  fprintf(stderr,"PAPI_stop");
464  } else
465  memset(array+num_iters, 0, sizeof(long long) * num_iters );
466 
467  do_output( "papi_read.dat", "Multiplexed PAPI_read()", array, number_of_counters );
468 
469  } /* End counter loop */
470  PAPI_cleanup_eventset( SoftwareMPX );
471  PAPI_cleanup_eventset( KernelMPX );
472  finalize_test();
473 
474 
475 
476  /* PAPI_read_ts() test */
477  init_test( SoftwareMPX, KernelMPX, Events);
478 
479  for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
480 
481  if ( options.kernel_mpx ) {
482  if ( (retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
483  fprintf(stderr,"PAPI_add_event");
484  goto cleanup;
485  }
486 
487  if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
488  fprintf(stderr,"PAPI_start");
489  exit(retval);
490  }
491  PAPI_read_ts( KernelMPX, values, &totcyc );
492 
493  /* KernelMPX Timing loop */
494  for ( i = 0; i < num_iters; i++ ) {
495  retval = PAPI_read_ts( KernelMPX, values, &array[i] );
496  } /* End 1 timing run */
497 
498  /* post-process the timing array */
499  for ( i = num_iters - 1; i > 0; i-- ) {
500  array[i] -= array[i - 1];
501  }
502  array[0] -= totcyc;
503 
504  retval_stop=PAPI_stop( KernelMPX, values );
505  if (retval_stop!=PAPI_OK)
506  fprintf(stderr,"PAPI_stop");
507  } else
508  memset(array, 0, sizeof(long long) * num_iters );
509 
510  /* Also test software multiplexing */
511  if ( options.force_sw ) {
512  if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
513  fprintf(stderr,"PAPI_add_event");
514  goto cleanup;
515  }
516 
517  if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
518  fprintf(stderr,"PAPI_start");
519  exit(retval);
520  }
521  PAPI_read_ts( SoftwareMPX, values, &totcyc);
522 
523  /* SoftwareMPX Timing Loop */
524  for ( i = num_iters; i < 2*num_iters; i++ ) {
525  retval = PAPI_read_ts( SoftwareMPX, values, &array[i]);
526  } /* End 2 timing run */
527 
528  retval_stop=PAPI_stop( SoftwareMPX, values );
529  if (retval_stop!=PAPI_OK)
530  fprintf(stderr,"PAPI_stop");
531 
532  /* post-process the timing array */
533  for ( i = 2*num_iters - 1; i > num_iters; i-- ) {
534  array[i] -= array[i - 1];
535  }
536  array[num_iters] -= totcyc;
537 
538  } else
539  memset(array+num_iters, 0, sizeof(long long) * num_iters );
540 
541  do_output( "papi_read_ts.dat", "Multiplexed PAPI_read_ts()", array, number_of_counters );
542 
543  } /* End counter loop */
544  PAPI_cleanup_eventset( SoftwareMPX );
545  PAPI_cleanup_eventset( KernelMPX );
546  finalize_test();
547 
548 
549  /* PAPI_accum() test */
550  init_test(SoftwareMPX, KernelMPX, Events);
551 
552  for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
553 
554  if ( options.kernel_mpx ) {
555  if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
556  fprintf(stderr,"PAPI_add_event");
557  goto cleanup;
558  }
559 
560  if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
561  fprintf(stderr,"PAPI_start");
562  exit(retval);
563  }
564  PAPI_read( KernelMPX, values );
565 
566  /* KernelMPX Timing loop */
567  for ( i = 0; i < num_iters; i++ ) {
568  totcyc = PAPI_get_real_cyc();
569  retval = PAPI_accum( KernelMPX, values );
570  array[i] = PAPI_get_real_cyc() - totcyc;
571  } /* End 1 timing run */
572 
573  retval_stop=PAPI_stop( KernelMPX, values );
574  if (retval_stop!=PAPI_OK)
575  fprintf(stderr,"PAPI_stop");
576  } else {
577  memset(array, 0, sizeof(long long) * num_iters );
578  }
579 
580  /* Also test software multiplexing */
581  if ( options.force_sw ) {
582  if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
583  fprintf(stderr,"PAPI_add_event");
584  goto cleanup;
585  }
586 
587  if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
588  fprintf(stderr,"PAPI_start");
589  exit(retval);
590  }
591  PAPI_read( SoftwareMPX, values );
592 
593  /* SoftwareMPX Timing Loop */
594  for ( i = num_iters; i < 2*num_iters; i++ ) {
595  totcyc = PAPI_get_real_cyc();
596  retval = PAPI_accum( SoftwareMPX, values );
597  array[i] = PAPI_get_real_cyc() - totcyc;
598  } /* End 2 timing run */
599 
600  retval_stop=PAPI_stop( SoftwareMPX, values );
601  if (retval_stop!=PAPI_OK)
602  fprintf(stderr,"PAPI_stop");
603  } else {
604  memset(array+num_iters, 0, sizeof(long long) * num_iters );
605  }
606  do_output( "papi_accum.dat", "Multiplexed PAPI_accum()", array, number_of_counters );
607 
608  } /* End counter loop */
609  PAPI_cleanup_eventset( SoftwareMPX );
610  PAPI_cleanup_eventset( KernelMPX );
611  finalize_test();
612 
613  /* PAPI_reset() test */
614  init_test(SoftwareMPX, KernelMPX, Events);
615 
616  for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
617 
618  if ( options.kernel_mpx ) {
619  if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
620  fprintf(stderr,"PAPI_add_event");
621  goto cleanup;
622  }
623 
624  if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
625  fprintf(stderr,"PAPI_start");
626  exit(retval);
627  }
628  PAPI_read( KernelMPX, values );
629 
630  /* KernelMPX Timing loop */
631  for ( i = 0; i < num_iters; i++ ) {
632  totcyc = PAPI_get_real_cyc();
633  retval = PAPI_reset( KernelMPX );
634  array[i] = PAPI_get_real_cyc() - totcyc;
635  } /* End 1 timing run */
636 
637  retval_stop=PAPI_stop( KernelMPX, values );
638  if (retval_stop!=PAPI_OK)
639  fprintf(stderr,"PAPI_stop");
640  } else
641  memset(array, 0, sizeof(long long) * num_iters );
642 
643  /* Also test software multiplexing */
644  if ( options.force_sw ) {
645  if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
646  fprintf(stderr,"PAPI_add_event");
647  goto cleanup;
648  }
649 
650  if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
651  fprintf(stderr,"PAPI_start");
652  exit(retval);
653  }
654  PAPI_read( SoftwareMPX, values );
655 
656  /* SoftwareMPX Timing Loop */
657  for ( i = num_iters; i < 2*num_iters; i++ ) {
658  totcyc = PAPI_get_real_cyc();
659  retval = PAPI_reset( SoftwareMPX );
660  array[i] = PAPI_get_real_cyc() - totcyc;
661  } /* End 2 timing run */
662 
663  retval_stop=PAPI_stop( SoftwareMPX, values );
664  if (retval_stop!=PAPI_OK)
665  fprintf(stderr,"PAPI_stop");
666  } else {
667  memset(array+num_iters, 0, sizeof(long long) * num_iters );
668  }
669 
670  do_output( "papi_reset.dat", "Multiplexed PAPI_reset()", array, number_of_counters );
671 
672  } /* End counter loop */
673 
674  PAPI_cleanup_eventset( SoftwareMPX );
675  PAPI_cleanup_eventset( KernelMPX );
676  finalize_test();
677 
678  return 0;
679 
680 cleanup:
681  if ( KernelMPX != PAPI_NULL) PAPI_cleanup_eventset( KernelMPX );
682  if ( SoftwareMPX != PAPI_NULL ) PAPI_cleanup_eventset( KernelMPX );
683 
684  if ( values != NULL ) free(values);
685  if ( array != NULL ) free(array);
686  if ( Events != NULL ) free(Events);
687 
688  PAPI_shutdown();
689  return 1;
690 
691 }
#define PAPI_OK
Definition: fpapi.h:105
int atoi()
int PAPI_stop(int EventSet, long long *values)
Definition: papi.c:2314
#define PAPI_NATIVE_MASK
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
Definition: papi.c:796
static void usage(void)
int PAPI_add_event(int EventSet, int EventCode)
Definition: papi.c:1663
int PAPI_reset(int EventSet)
Definition: papi.c:2459
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
#define PAPI_MULTIPLEX_FORCE_SW
Definition: fpapi.h:46
static int first_time
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
int PAPI_enum_event(int *EventCode, int modifier)
Definition: papi.c:1152
#define PAPI_MULTIPLEX
Definition: fpapi.h:48
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
int retval
Definition: zero_fork.c:53
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:849
static FILE * fp
double c
Definition: multiplex.c:22
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:3465
Return codes and api definitions.
double do_stats(long long *array, long long *min, long long *max, double *average)
Definition: cost_utils.c:12
int PAPI_accum(int EventSet, long long *values)
Definition: papi.c:2745
int PAPI_library_init(int version)
Definition: papi.c:500
void PAPI_shutdown(void)
Definition: papi.c:4461
int PAPI_get_opt(int option, PAPI_option_t *ptr)
Definition: papi.c:4143
void do_output(char *fn, char *message, long long *array, int noc)
#define PAPI_NULL
Definition: fpapi.h:13
unsigned int kernel_multiplex
Definition: papi.h:657
#define min(x, y)
Definition: darwin-common.h:4
PAPI_multiplex_option_t multiplex
Definition: papi.h:860
int PAPI_cleanup_eventset(int EventSet)
Definition: papi.c:2890
int PAPI_assign_eventset_component(int EventSet, int cidx)
Definition: papi.c:1526
int PAPI_create_eventset(int *EventSet)
Definition: papi.c:1464
void finalize_test(void)
int PAPI_multiplex_init(void)
Definition: papi.c:2982
int PAPI_read_ts(int EventSet, long long *values, long long *cycles)
Definition: papi.c:2648
#define PAPI_DEF_ITIMER
Definition: papi.h:455
int main(int argc, char **argv)
void init_test(int SoftwareMPX, int KernelMPX, int *Events)
static options_t options
int PAPI_set_multiplex(int EventSet)
Definition: papi.c:3333
long long PAPI_get_real_cyc(void)
Definition: papi.c:6217
int PAPI_read(int EventSet, long long *values)
Definition: papi.c:2559
int PAPI_start(int EventSet)
Definition: papi.c:2096
static int skip
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
void exit()
PAPI_itimer_option_t itimer
Definition: papi.h:861
#define PAPI_QUIET
Definition: fpapi.h:38
int PAPI_set_debug(int level)
Definition: papi.c:3126
char * optarg
int i
Definition: fileop.c:140
int num_iters
Definition: cost_utils.c:8