PAPI 7.1.0.0
Loading...
Searching...
No Matches
papi_multiplex_cost.c File Reference
Include dependency graph for papi_multiplex_cost.c:

Go to the source code of this file.

Data Structures

struct  options_t
 

Functions

void do_output (char *fn, char *message, long long *array, int noc)
 
void init_test (int SoftwareMPX, int KernelMPX, int *Events)
 
void finalize_test (void)
 
static void usage (void)
 
int main (int argc, char **argv)
 

Variables

static int first_time = 1
 
static int skip = 0
 
static FILE * fp
 
static options_t options
 

Function Documentation

◆ do_output()

void do_output ( char *  fn,
char *  message,
long long array,
int  noc 
)

Definition at line 62 of file papi_multiplex_cost.c.

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\
78std 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}
double do_stats(long long *array, long long *min, long long *max, double *average)
Definition: cost_utils.c:12
int num_iters
Definition: cost_utils.c:8
#define min(x, y)
Definition: darwin-common.h:4
FILE * stderr
static double array[ARRAYSIZE]
Definition: papi_l1_dca.c:23
static int skip
static int first_time
static FILE * fp
Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalize_test()

void finalize_test ( void  )

Definition at line 151 of file papi_multiplex_cost.c.

152{
153 if (fp) fclose(fp);
154 first_time = 1;
155}
int fclose(FILE *__stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_test()

void init_test ( int  SoftwareMPX,
int  KernelMPX,
int Events 
)

Definition at line 93 of file papi_multiplex_cost.c.

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
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}
int i
add PAPI preset or native hardware event to an event set
Assign a component index to an existing but empty EventSet.
Get PAPI library or event set options.
Convert a standard event set to a multiplexed event set.
Set PAPI library or event set options.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_MULTIPLEX_FORCE_SW
Definition: f90papi.h:62
#define PAPI_MULTIPLEX
Definition: f90papi.h:223
#define PAPI_DEF_ITIMER
Definition: papi.h:462
static options_t options
A pointer to the following is passed to PAPI_set/get_opt()
Definition: papi.h:843
PAPI_itimer_option_t itimer
Definition: papi.h:854
PAPI_multiplex_option_t multiplex
Definition: papi.h:853
int retval
Definition: zero_fork.c:53
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 170 of file papi_multiplex_cost.c.

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;
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':
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
230 if ( values == NULL || array == NULL || Events == NULL ) {
231 fprintf(stderr,"Error allocating memory!\n");
232 exit(1);
233 }
234
236 if (retval != PAPI_VER_CURRENT ) {
237 fprintf(stderr, "Error! PAPI_library_init\n");
238 exit(retval);
239 }
240
242 if (retval != PAPI_OK ) {
243 fprintf(stderr,"Error! PAPI_set_debug\n");
244 exit(retval );
245 }
246
248 if (retval != PAPI_OK ) {
249 fprintf(stderr,"Error! PAPI_multiplex_init\n");
250 exit(retval);
251 }
252
253 info = PAPI_get_component_info(0);
255
256 if ( options.kernel_mpx && !info->kernel_multiplex ) {
257 fprintf(stderr,"Error! Kernel multiplexing is "
258 "not supported on this platform, bailing!\n");
259 exit(1);
260 }
261
262 retval = PAPI_create_eventset( &SoftwareMPX );
263 if (retval != PAPI_OK) {
264 fprintf(stderr,"Error! PAPI_create_eventset\n");
265 exit(retval);
266 }
267
268 retval = PAPI_create_eventset( &KernelMPX );
269 if (retval != PAPI_OK ) {
270 fprintf(stderr,"PAPI_create_eventset");
271 exit(retval);
272 }
273
274 retval = PAPI_assign_eventset_component( KernelMPX, 0 );
275 if (retval != PAPI_OK ) {
276 fprintf(stderr,"PAPI_assign_eventset_component");
277 exit(retval);
278 }
279
280 retval = PAPI_set_multiplex( KernelMPX );
281 if (retval != PAPI_OK ) {
282 fprintf(stderr,"PAPI_set_multiplex");
283 exit(retval);
284 }
285
286 retval = PAPI_assign_eventset_component( SoftwareMPX, 0 );
287 if (retval != PAPI_OK ) {
288 fprintf(stderr,"PAPI_assign_eventset_component");
289 exit(retval);
290 }
291
293
294 memset(&option,0x0,sizeof(option));
295
297 option.multiplex.eventset = SoftwareMPX;
298 option.multiplex.ns = itimer.itimer.ns;
299
300 retval = PAPI_set_opt( PAPI_MULTIPLEX, &option );
301 if (retval != PAPI_OK) {
302 fprintf(stderr,"PAPI_set_opt");
303 exit(retval);
304 }
305
306 if ( !options.kernel_mpx && !options.force_sw ) {
307 fprintf(stderr,"No tests to run.");
308 goto cleanup;
309 } else {
310 fprintf(stderr,"Running test[s]\n");
312 fprintf(stderr,"\tKernel multiplexing read\n");
313 if (options.force_sw)
314 fprintf(stderr,"\tSoftware Multiplexing read\n");
315 }
316
317 event = 0 | PAPI_NATIVE_MASK;
319
320 /* Find some events to run the tests with. */
321 for (number_of_counters = 0; number_of_counters < options.max; number_of_counters++) {
322 dont_loop_forever = 0;
323
324 if ( options.kernel_mpx ) {
325 do {
327 dont_loop_forever++;
328 } while ( ( retval = PAPI_add_event( KernelMPX, event ) ) != PAPI_OK &&
329 dont_loop_forever < 512);
330 } else {
331 do {
333 dont_loop_forever++;
334 } while ( ( retval = PAPI_add_event( SoftwareMPX, event) ) != PAPI_OK &&
335 dont_loop_forever < 512);
336 }
337 if ( dont_loop_forever == 512 )
338 fprintf(stderr,"I can't find %d events to count at once.", options.max);
339
340 Events[number_of_counters] = event;
341 }
342
343 PAPI_cleanup_eventset( KernelMPX );
344 PAPI_cleanup_eventset( SoftwareMPX );
345
346 /* Start/Stop test */
347 init_test(SoftwareMPX, KernelMPX, Events);
348
349 for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
350
351 if ( options.kernel_mpx ) {
352 if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
353 fprintf(stderr,"PAPI_add_event");
354 goto cleanup;
355 }
356
357 if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
358 fprintf(stderr,"PAPI_start");
359 exit(retval);
360 }
361 if ( ( retval = PAPI_stop( KernelMPX, values ) ) != PAPI_OK ) {
362 fprintf(stderr,"PAPI_stop");
363 exit(retval);
364 }
365
366 /* KernelMPX Timing loop */
367 for ( i = 0; i < num_iters; i++ ) {
368 totcyc = PAPI_get_real_cyc();
369 retval_start=PAPI_start( KernelMPX );
370 retval_stop=PAPI_stop( KernelMPX, values );
371 array[i] = PAPI_get_real_cyc() - totcyc;
372 if (retval_start || retval_stop)
373 fprintf(stderr,"PAPI start/stop");
374 } /* End 1 timing run */
375
376 } else
377 memset(array, 0, sizeof(long long) * num_iters );
378
379 /* Also test software multiplexing */
380 if ( options.force_sw ) {
381 if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
382 fprintf(stderr,"PAPI_add_event");
383 goto cleanup;
384 }
385
386 if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
387 fprintf(stderr,"PAPI_start");
388 exit(retval);
389 }
390 if ( ( retval = PAPI_stop( SoftwareMPX, values ) ) != PAPI_OK ) {
391 fprintf(stderr,"PAPI_stop");
392 exit(retval);
393 }
394
395 /* SoftwareMPX Timing Loop */
396 for ( i = num_iters; i < 2*num_iters; i++ ) {
397 totcyc = PAPI_get_real_cyc();
398 retval_start=PAPI_start( SoftwareMPX );
399 retval_stop=PAPI_stop( SoftwareMPX, values );
400 array[i] = PAPI_get_real_cyc() - totcyc;
401 if (retval_start || retval_stop)
402 fprintf(stderr,"PAPI start/stop");
403 } /* End 2 timing run */
404
405 } else {
406 memset(array+num_iters, 0, sizeof(long long) * num_iters );
407 }
408
409 do_output( "papi_startstop.dat", "Multiplexed PAPI_read()", array, number_of_counters );
410
411 } /* End counter loop */
412 PAPI_cleanup_eventset( SoftwareMPX );
413 PAPI_cleanup_eventset( KernelMPX );
415
416 /* PAPI_read() test */
417 init_test(SoftwareMPX, KernelMPX, Events);
418
419 for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
420
421 if ( options.kernel_mpx ) {
422 if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
423 fprintf(stderr,"PAPI_add_event");
424 goto cleanup;
425 }
426
427 if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
428 fprintf(stderr,"PAPI_start");
429 exit(retval);
430 }
431 PAPI_read( KernelMPX, values );
432
433 /* KernelMPX Timing loop */
434 for ( i = 0; i < num_iters; i++ ) {
435 totcyc = PAPI_get_real_cyc();
436 retval = PAPI_read( KernelMPX, values );
437 array[i] = PAPI_get_real_cyc() - totcyc;
438 } /* End 1 timing run */
439
440 retval_stop=PAPI_stop( KernelMPX, values );
441 if (retval_stop!=PAPI_OK)
442 fprintf(stderr,"PAPI_stop");
443 } else
444 memset(array, 0, sizeof(long long) * num_iters );
445
446 /* Also test software multiplexing */
447 if ( options.force_sw ) {
448 if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
449 fprintf(stderr,"PAPI_add_event");
450 goto cleanup;
451 }
452
453 if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
454 fprintf(stderr,"PAPI_start");
455 exit(retval);
456 }
457 PAPI_read( SoftwareMPX, values );
458
459 /* SoftwareMPX Timing Loop */
460 for ( i = num_iters; i < 2*num_iters; i++ ) {
461 totcyc = PAPI_get_real_cyc();
462 retval = PAPI_read( SoftwareMPX, values );
463 array[i] = PAPI_get_real_cyc() - totcyc;
464 } /* End 2 timing run */
465
466 retval_stop=PAPI_stop( SoftwareMPX, values );
467 if (retval_stop!=PAPI_OK)
468 fprintf(stderr,"PAPI_stop");
469 } else
470 memset(array+num_iters, 0, sizeof(long long) * num_iters );
471
472 do_output( "papi_read.dat", "Multiplexed PAPI_read()", array, number_of_counters );
473
474 } /* End counter loop */
475 PAPI_cleanup_eventset( SoftwareMPX );
476 PAPI_cleanup_eventset( KernelMPX );
478
479
480
481 /* PAPI_read_ts() test */
482 init_test( SoftwareMPX, KernelMPX, Events);
483
484 for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
485
486 if ( options.kernel_mpx ) {
487 if ( (retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
488 fprintf(stderr,"PAPI_add_event");
489 goto cleanup;
490 }
491
492 if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
493 fprintf(stderr,"PAPI_start");
494 exit(retval);
495 }
496 PAPI_read_ts( KernelMPX, values, &totcyc );
497
498 /* KernelMPX Timing loop */
499 for ( i = 0; i < num_iters; i++ ) {
500 retval = PAPI_read_ts( KernelMPX, values, &array[i] );
501 } /* End 1 timing run */
502
503 /* post-process the timing array */
504 for ( i = num_iters - 1; i > 0; i-- ) {
505 array[i] -= array[i - 1];
506 }
507 array[0] -= totcyc;
508
509 retval_stop=PAPI_stop( KernelMPX, values );
510 if (retval_stop!=PAPI_OK)
511 fprintf(stderr,"PAPI_stop");
512 } else
513 memset(array, 0, sizeof(long long) * num_iters );
514
515 /* Also test software multiplexing */
516 if ( options.force_sw ) {
517 if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
518 fprintf(stderr,"PAPI_add_event");
519 goto cleanup;
520 }
521
522 if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
523 fprintf(stderr,"PAPI_start");
524 exit(retval);
525 }
526 PAPI_read_ts( SoftwareMPX, values, &totcyc);
527
528 /* SoftwareMPX Timing Loop */
529 for ( i = num_iters; i < 2*num_iters; i++ ) {
530 retval = PAPI_read_ts( SoftwareMPX, values, &array[i]);
531 } /* End 2 timing run */
532
533 retval_stop=PAPI_stop( SoftwareMPX, values );
534 if (retval_stop!=PAPI_OK)
535 fprintf(stderr,"PAPI_stop");
536
537 /* post-process the timing array */
538 for ( i = 2*num_iters - 1; i > num_iters; i-- ) {
539 array[i] -= array[i - 1];
540 }
541 array[num_iters] -= totcyc;
542
543 } else
544 memset(array+num_iters, 0, sizeof(long long) * num_iters );
545
546 do_output( "papi_read_ts.dat", "Multiplexed PAPI_read_ts()", array, number_of_counters );
547
548 } /* End counter loop */
549 PAPI_cleanup_eventset( SoftwareMPX );
550 PAPI_cleanup_eventset( KernelMPX );
552
553
554 /* PAPI_accum() test */
555 init_test(SoftwareMPX, KernelMPX, Events);
556
557 for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
558
559 if ( options.kernel_mpx ) {
560 if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
561 fprintf(stderr,"PAPI_add_event");
562 goto cleanup;
563 }
564
565 if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
566 fprintf(stderr,"PAPI_start");
567 exit(retval);
568 }
569 PAPI_read( KernelMPX, values );
570
571 /* KernelMPX Timing loop */
572 for ( i = 0; i < num_iters; i++ ) {
573 totcyc = PAPI_get_real_cyc();
574 retval = PAPI_accum( KernelMPX, values );
575 array[i] = PAPI_get_real_cyc() - totcyc;
576 } /* End 1 timing run */
577
578 retval_stop=PAPI_stop( KernelMPX, values );
579 if (retval_stop!=PAPI_OK)
580 fprintf(stderr,"PAPI_stop");
581 } else {
582 memset(array, 0, sizeof(long long) * num_iters );
583 }
584
585 /* Also test software multiplexing */
586 if ( options.force_sw ) {
587 if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
588 fprintf(stderr,"PAPI_add_event");
589 goto cleanup;
590 }
591
592 if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
593 fprintf(stderr,"PAPI_start");
594 exit(retval);
595 }
596 PAPI_read( SoftwareMPX, values );
597
598 /* SoftwareMPX Timing Loop */
599 for ( i = num_iters; i < 2*num_iters; i++ ) {
600 totcyc = PAPI_get_real_cyc();
601 retval = PAPI_accum( SoftwareMPX, values );
602 array[i] = PAPI_get_real_cyc() - totcyc;
603 } /* End 2 timing run */
604
605 retval_stop=PAPI_stop( SoftwareMPX, values );
606 if (retval_stop!=PAPI_OK)
607 fprintf(stderr,"PAPI_stop");
608 } else {
609 memset(array+num_iters, 0, sizeof(long long) * num_iters );
610 }
611 do_output( "papi_accum.dat", "Multiplexed PAPI_accum()", array, number_of_counters );
612
613 } /* End counter loop */
614 PAPI_cleanup_eventset( SoftwareMPX );
615 PAPI_cleanup_eventset( KernelMPX );
617
618 /* PAPI_reset() test */
619 init_test(SoftwareMPX, KernelMPX, Events);
620
621 for (number_of_counters = options.min; number_of_counters < options.max; number_of_counters++) {
622
623 if ( options.kernel_mpx ) {
624 if ( ( retval = PAPI_add_event( KernelMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
625 fprintf(stderr,"PAPI_add_event");
626 goto cleanup;
627 }
628
629 if ( ( retval = PAPI_start( KernelMPX ) ) != PAPI_OK ) {
630 fprintf(stderr,"PAPI_start");
631 exit(retval);
632 }
633 PAPI_read( KernelMPX, values );
634
635 /* KernelMPX Timing loop */
636 for ( i = 0; i < num_iters; i++ ) {
637 totcyc = PAPI_get_real_cyc();
638 retval = PAPI_reset( KernelMPX );
639 array[i] = PAPI_get_real_cyc() - totcyc;
640 } /* End 1 timing run */
641
642 retval_stop=PAPI_stop( KernelMPX, values );
643 if (retval_stop!=PAPI_OK)
644 fprintf(stderr,"PAPI_stop");
645 } else
646 memset(array, 0, sizeof(long long) * num_iters );
647
648 /* Also test software multiplexing */
649 if ( options.force_sw ) {
650 if ( ( retval = PAPI_add_event( SoftwareMPX, Events[number_of_counters - options.min] ) ) != PAPI_OK ) {
651 fprintf(stderr,"PAPI_add_event");
652 goto cleanup;
653 }
654
655 if ( ( retval = PAPI_start( SoftwareMPX ) ) != PAPI_OK ) {
656 fprintf(stderr,"PAPI_start");
657 exit(retval);
658 }
659 PAPI_read( SoftwareMPX, values );
660
661 /* SoftwareMPX Timing Loop */
662 for ( i = num_iters; i < 2*num_iters; i++ ) {
663 totcyc = PAPI_get_real_cyc();
664 retval = PAPI_reset( SoftwareMPX );
665 array[i] = PAPI_get_real_cyc() - totcyc;
666 } /* End 2 timing run */
667
668 retval_stop=PAPI_stop( SoftwareMPX, values );
669 if (retval_stop!=PAPI_OK)
670 fprintf(stderr,"PAPI_stop");
671 } else {
672 memset(array+num_iters, 0, sizeof(long long) * num_iters );
673 }
674
675 do_output( "papi_reset.dat", "Multiplexed PAPI_reset()", array, number_of_counters );
676
677 } /* End counter loop */
678
679 PAPI_cleanup_eventset( SoftwareMPX );
680 PAPI_cleanup_eventset( KernelMPX );
682
683 if ( values != NULL ) free(values);
684 if ( array != NULL ) free(array);
685 if ( Events != NULL ) free(Events);
686
687 return 0;
688
689cleanup:
690 if ( KernelMPX != PAPI_NULL) PAPI_cleanup_eventset( KernelMPX );
691 if ( SoftwareMPX != PAPI_NULL ) PAPI_cleanup_eventset( KernelMPX );
692
693 if ( values != NULL ) free(values);
694 if ( array != NULL ) free(array);
695 if ( Events != NULL ) free(Events);
696
698 return 1;
699
700}
Accumulate and reset counters in an EventSet.
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Enumerate PAPI preset or native events.
get information about a specific software component
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
initialize the PAPI library.
Initialize multiplex support in the PAPI library.
Read hardware counters with a timestamp.
Read hardware counters from an event set.
Reset the hardware event counts in an event set.
Set the current debug level for error output from PAPI.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
#define PAPI_ENUM_EVENTS
Definition: f90papi.h:224
#define PAPI_ENUM_FIRST
Definition: f90papi.h:85
#define PAPI_NULL
Definition: f90papi.h:78
#define PAPI_QUIET
Definition: f90papi.h:132
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
static double c[MATRIX_SIZE][MATRIX_SIZE]
Definition: libmsr_basic.c:40
#define PAPI_NATIVE_MASK
void do_output(char *fn, char *message, long long *array, int noc)
void init_test(int SoftwareMPX, int KernelMPX, int *Events)
void finalize_test(void)
static void usage(void)
unsigned int kernel_multiplex
Definition: papi.h:654
Here is the call graph for this function:

◆ usage()

static void usage ( void  )
static

Definition at line 158 of file papi_multiplex_cost.c.

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}
Here is the caller graph for this function:

Variable Documentation

◆ first_time

int first_time = 1
static

Definition at line 47 of file papi_multiplex_cost.c.

◆ fp

FILE* fp
static

Definition at line 49 of file papi_multiplex_cost.c.

◆ options

options_t options
static

Definition at line 59 of file papi_multiplex_cost.c.

◆ skip

int skip = 0
static

Definition at line 48 of file papi_multiplex_cost.c.