266 int xRC, xEventSet, xEventCode, xState;
270 printf(
"==> Do_Low_Level_Tests(): Beginning of the main body...\n");
278 printf(
"SUCCESS: PAPI has been low-level initialized by main()...\n");
280 printf(
"FAILURE: PAPI has not been properly initialized by main(), xRC=%d, ending...\n", xRC);
293 BGP_UPC_Read_Counters_Struct_t* xTemp;
294 xTemp = (BGP_UPC_Read_Counters_Struct_t*)(
void*)
Native_Buffer;
302 printf(
"PAPI_get_real_cyc: xLLValue=%lld...\n", xLLValue);
306 printf(
"PAPI_get_virt_cyc: xLLValue=%lld...\n", xLLValue);
310 printf(
"PAPI_get_real_usec: xLLValue=%lld...\n", xLLValue);
314 printf(
"PAPI_get_virt_usec: xLLValue=%lld...\n", xLLValue);
318 printf(
"SUCCESS: PAPI_num_hwctrs returned 256 hardware counters...\n");
320 printf(
"FAILURE: PAPI_num_hwctrs failed, returned xRC=%d...\n", xRC);
323 char* xEventName_1 =
"PAPI_L3_LDM";
326 xRC = strcmp(xName,xEventName_1);
328 printf(
"SUCCESS: PAPI_event_code_to_name for PAPI_L3_LDM...\n");
330 printf(
"FAILURE: PAPI_event_code_to_name returned incorrect name, xName=%s\n", xName);
333 printf(
"FAILURE: PAPI_event_code_to_name failed, xRC=%d...\n", xRC);
336 char* xEventName_2 =
"PNE_BGP_PU1_IPIPE_INSTRUCTIONS";
339 xRC = strcmp(xName,xEventName_2);
341 printf(
"SUCCESS: PAPI_event_code_to_name for PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
343 printf(
"FAILURE: PAPI_event_code_to_name returned incorrect name, xName=%s\n", xName);
346 printf(
"FAILURE: PAPI_event_code_to_name failed, xRC=%d...\n", xRC);
348 strcpy(xName,
"PAPI_L3_LDM");
351 if (xEventCode == 0x8000000E)
352 printf(
"SUCCESS: PAPI_event_name_to_code for PAPI_L3_LDM...\n");
354 printf(
"FAILURE: PAPI_event_name_to_code returned incorrect code, xEventCode=%d\n", xEventCode);
356 printf(
"FAILURE: PAPI_event_name_to_code failed, xRC=%d...\n", xRC);
358 strcpy(xName,
"PNE_BGP_PU1_IPIPE_INSTRUCTIONS");
361 if (xEventCode == 0x40000027)
362 printf(
"SUCCESS: PAPI_event_name_to_code for PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
364 printf(
"FAILURE: PAPI_event_name_to_code returned incorrect code, xEventCode=%8.8x\n", xEventCode);
366 printf(
"FAILURE: PAPI_event_name_to_code failed, xRC=%d...\n", xRC);
368 xEventCode = 0x80000000;
371 if (xEventCode == 0x80000001)
372 printf(
"SUCCESS: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL, returned 0x80000001...\n");
374 printf(
"FAILURE: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
376 printf(
"FAILURE: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
378 xEventCode = 0x80000002;
381 if (xEventCode == 0x80000003)
382 printf(
"SUCCESS: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL, returned 0x80000003...\n");
384 printf(
"FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
386 printf(
"FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
388 xEventCode = 0x80000067;
391 if (xEventCode == 0x80000068)
392 printf(
"SUCCESS: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL, returned 0x80000068...\n");
394 printf(
"FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
396 printf(
"FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
398 xEventCode = 0x80000068;
401 printf(
"SUCCESS: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_ALL, no next event...\n");
403 printf(
"FAILURE: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
405 xEventCode = 0x40000000;
408 if (xEventCode == 0x40000001)
409 printf(
"SUCCESS: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL, returned 0x40000001...\n");
411 printf(
"FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
413 printf(
"FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
415 xEventCode = 0x40000001;
418 if (xEventCode == 0x40000002)
419 printf(
"SUCCESS: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL, returned 0x40000002...\n");
421 printf(
"FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
423 printf(
"FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
425 xEventCode = 0x400000FC;
428 if (xEventCode == 0x400000FF)
429 printf(
"SUCCESS: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL, returned 0x400000FF...\n");
431 printf(
"FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
433 printf(
"FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
435 xEventCode = 0x400001FD;
438 if (xEventCode == 0x400001FF)
439 printf(
"SUCCESS: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL, returned 0x400001FF...\n");
441 printf(
"FAILURE: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
443 printf(
"FAILURE: PAPI_enum_event for 0x400001FD PAPI_ENUM_ALL failed, xRC=%d...\n", xRC);
445 xEventCode = 0x400001FF;
448 printf(
"SUCCESS: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_ALL, no next event...\n");
450 printf(
"FAILURE: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_ALL failed, xRC=%d...\n", xRC);
452 xEventCode = 0x80000000;
455 if (xEventCode == 0x80000001)
456 printf(
"SUCCESS: PAPI_enum_event for 0x80000000 PAPI_PRESET_ENUM_AVAIL, returned 0x80000001...\n");
458 printf(
"FAILURE: PAPI_enum_event for 0x80000000PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
460 printf(
"FAILURE: PAPI_enum_event for 0x80000000PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
462 xEventCode = 0x80000002;
465 if (xEventCode == 0x80000006)
466 printf(
"SUCCESS: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL, returned 0x80000006...\n");
468 printf(
"FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
470 printf(
"FAILURE: PAPI_enum_event for 0x80000002 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
472 xEventCode = 0x80000067;
475 if (xEventCode == 0x80000068)
476 printf(
"SUCCESS: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL, returned 0x80000068...\n");
478 printf(
"FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
480 printf(
"FAILURE: PAPI_enum_event for 0x80000067 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
482 xEventCode = 0x80000068;
485 printf(
"SUCCESS: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_AVAIL, no next event...\n");
487 printf(
"FAILURE: PAPI_enum_event for 0x80000068 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
489 xEventCode = 0x40000000;
492 if (xEventCode == 0x40000001)
493 printf(
"SUCCESS: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL, returned 0x40000001...\n");
495 printf(
"FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
497 printf(
"FAILURE: PAPI_enum_event for 0x40000000 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
499 xEventCode = 0x40000001;
502 if (xEventCode == 0x40000002)
503 printf(
"SUCCESS: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL, returned 0x40000002...\n");
505 printf(
"FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
507 printf(
"FAILURE: PAPI_enum_event for 0x40000001 PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
509 printf(
"NOTE: Might get two messages indicating invalid event id specified for 253 and 254. These are OK...\n");
510 xEventCode = 0x400000FC;
513 if (xEventCode == 0x400000FF)
514 printf(
"SUCCESS: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL, returned 0x400000FF...\n");
516 printf(
"FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
518 printf(
"FAILURE: PAPI_enum_event for 0x400000FC PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
520 printf(
"NOTE: Might get one message indicating invalid event id specified for 510. This is OK...\n");
521 xEventCode = 0x400001FD;
524 if (xEventCode == 0x400001FF)
525 printf(
"SUCCESS: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL, returned 0x400001FF...\n");
527 printf(
"FAILURE: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL returned incorrect code, xEventCode=%8.8x\n", xEventCode);
529 printf(
"FAILURE: PAPI_enum_event for 0x400001FD PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
531 xEventCode = 0x400001FF;
534 printf(
"SUCCESS: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_AVAIL, no next event...\n");
536 printf(
"FAILURE: PAPI_enum_event for 0x400001FF PAPI_PRESET_ENUM_AVAIL failed, xRC=%d...\n", xRC);
542 printf(
"SUCCESS: PAPI_get_dmem_info...\n");
545 printf(
"FAILURE: PAPI_get_dmem_info failed, xRC=%d...\n", xRC);
551 printf(
"SUCCESS: PAPI_get_event_info for PAPI_L3_LDM...\n");
554 printf(
"FAILURE: PAPI_get_event_info failed for PAPI_L3_LDM, xRC=%d...\n", xRC);
559 printf(
"SUCCESS: PAPI_get_executable_info...\n");
562 printf(
"FAILURE: PAPI_get_executable_info failed, returned null pointer...\n");
567 printf(
"SUCCESS: PAPI_get_hardware_info...\n");
570 printf(
"FAILURE: PAPI_get_hardware_info failed, returned null pointer...\n");
575 printf(
"SUCCESS: PAPI_get_shared_lib_info...\n");
578 printf(
"FAILURE: PAPI_get_shared_lib_info failed, returned null pointer...\n");
583 printf(
"SUCCESS: PAPI_create_eventset created...\n");
585 printf(
"FAILURE: PAPI_create_eventset failed, xRC=%d...\n", xRC);
589 printf(
"==> No events should be in the event set...\n");
594 printf(
"SUCCESS: PAPI_num_events returned 0...\n");
596 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
600 printf(
"SUCCESS: PAPI_add_event PAPI_L1_DCM...\n");
602 printf(
"FAILURE: PAPI_add_event PAPI_L1_DCM failed, xRC=%d...\n", xRC);
606 printf(
"SUCCESS: PAPI_num_events returned 1...\n");
608 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
612 printf(
"SUCCESS: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES...\n");
614 printf(
"FAILURE: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES failed, xRC=%d...\n", xRC);
618 printf(
"SUCCESS: PAPI_num_events returned 2...\n");
620 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
624 printf(
"SUCCESS: PAPI_add_event BGP_PU3_L2_MEMORY_WRITES not allowed...\n");
626 printf(
"FAILURE: PAPI_add_event BGP_PU3_L2_MEMORY_WRITES allowed, or failed incorrectly..., xRC=%d...\n", xRC);
630 printf(
"SUCCESS: PAPI_num_events returned 2...\n");
632 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
636 printf(
"SUCCESS: PAPI_add_event 0x40000208 not allowed...\n");
638 printf(
"FAILURE: PAPI_add_event 0x40000208 allowed, or failed incorrectly..., xRC=%d...\n", xRC);
642 printf(
"SUCCESS: PAPI_num_events returned 2...\n");
644 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
648 printf(
"SUCCESS: PAPI_add_event PAPI_L1_ICM...\n");
650 printf(
"FAILURE: PAPI_add_event PAPI_L1_ICM failed, xRC=%d...\n", xRC);
654 printf(
"SUCCESS: PAPI_num_events returned 3...\n");
656 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
660 printf(
"SUCCESS: PAPI_add_event PAPI_L1_TCM...\n");
662 printf(
"FAILURE: PAPI_add_event PAPI_L1_TCM failed, xRC=%d...\n", xRC);
666 printf(
"SUCCESS: PAPI_num_events returned 4...\n");
668 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
672 printf(
"SUCCESS: PAPI_add_event, redundantly adding PAPI_L1_DCM not allowed...\n");
674 printf(
"FAILURE: PAPI_add_event PAPI_L1_DCM failed incorrectly, xRC=%d...\n", xRC);
678 printf(
"SUCCESS: PAPI_add_event, redundantly adding PNE_BGP_PU3_L2_MEMORY_WRITES not allowed...\n");
680 printf(
"FAILURE: PAPI_add_event PNE_BGP_PU3_L2_MEMORY_WRITES failed incorectly, xRC=%d...\n", xRC);
682 printf(
"\n==> All events added... Perform a read now...\n");
685 printf(
"SUCCESS: PAPI_read...\n");
687 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
689 printf(
"\n==> Perform a reset now...\n");
692 printf(
"SUCCESS: PAPI_reset...\n");
694 printf(
"FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
696 printf(
"\n==> Perform another read now...\n");
699 printf(
"SUCCESS: PAPI_read...\n");
701 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
703 printf(
"\n==> Should be 4 counters below, preset, native, preset, and preset. All counter values should be zero.\n");
706 printf(
"\n==> Stop the UPC now...\n");
709 printf(
"SUCCESS: PAPI_stop, but not running...\n");
711 printf(
"FAILURE: PAPI_stop failed incorectly, xRC=%d...\n", xRC);
713 printf(
"\n==> Start the UPC now...\n");
716 printf(
"SUCCESS: PAPI_start...\n");
718 printf(
"FAILURE: PAPI_start failed, xRC=%d...\n", xRC);
722 printf(
"\n==> Try to start it again...\n");
725 printf(
"SUCCESS: PAPI_start, but already running...\n");
727 printf(
"FAILURE: PAPI_start failed incorectly, xRC=%d...\n", xRC);
731 printf(
"\n==> Stop the UPC after the arithmetic was performed... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the UPC(s) being stopped...\n");
734 printf(
"SUCCESS: PAPI_stop...\n");
736 printf(
"FAILURE: PAPI_stop failed, xRC=%d...\n", xRC);
741 printf(
"\n==> Perform a read of the counters after performing arithmetic, UPC is stopped... Values should be the same as right after the prior PAPI_Stop()...\n");
744 printf(
"SUCCESS: PAPI_read...\n");
746 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
749 printf(
"\n==> Zero local counters. Perform a PAPI_accum, UPC is stopped... Native values should be zero, and the local PAPI counters the same as the previous read...\n");
753 printf(
"SUCCESS: PAPI_accum...\n");
756 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
761 printf(
"\n==> Perform a PAPI_read, UPC is stopped... All values should be zero...\n");
764 printf(
"SUCCESS: PAPI_read...\n");
767 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
772 printf(
"\n==> Perform a reset after performing arithmetic, UPC is stopped... All values should be zero...\n");
775 printf(
"SUCCESS: PAPI_reset...\n");
778 printf(
"FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
783 printf(
"\n==> Perform another read of the counters after resetting the counters, UPC is stopped... All values should be zero...\n");
786 printf(
"SUCCESS: PAPI_read...\n");
788 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
791 printf(
"\n==> Perform another PAPI_accum after resetting the counters, UPC is stopped... All values should be zero...\n");
795 printf(
"SUCCESS: PAPI_accum...\n");
798 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
803 printf(
"\n==> Perform another PAPI_read after accumulating and resetting the UPC, UPC is stopped... All values should be zero...\n");
806 printf(
"SUCCESS: PAPI_read...\n");
809 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
814 printf(
"\n==> Start the UPC again...\n");
817 printf(
"SUCCESS: PAPI_start...\n");
819 printf(
"FAILURE: PAPI_start failed, xRC=%d...\n", xRC);
825 printf(
"\n==> Get the state of the event set...\n");
829 printf(
"SUCCESS: PAPI_state is RUNNING...\n");
832 printf(
"FAILURE: PAPI_state failed, incorrect state, xState=%d...\n", xState);
836 printf(
"FAILURE: PAPI_state failed, xRC=%d...\n", xRC);
840 printf(
"\n==> Perform a read of the counters, UPC is running... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the reads for the individual counter values...\n");
843 printf(
"SUCCESS: PAPI_read...\n");
845 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
850 printf(
"\n==> Perform another read of the counters, UPC is running... Values should be increasing...\n");
853 printf(
"SUCCESS: PAPI_read...\n");
855 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
860 printf(
"\n==> Perform another read of the counters, UPC is running... Values should continue increasing...\n");
863 printf(
"SUCCESS: PAPI_read...\n");
865 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
868 printf(
"\n==> Perform a reset after performing arithmetic, UPC is still running... Native counter values should be less than prior read, but PAPI counter values should be identical to the prior read (local buffer was not changed)...\n");
871 printf(
"SUCCESS: PAPI_reset...\n");
874 printf(
"FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
879 printf(
"\n==> Zero local counters. Perform a PAPI_accum, UPC is still running...\n");
883 printf(
"SUCCESS: PAPI_accum...\n");
886 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
893 printf(
"\n==> Accumulate local counters. Perform a PAPI_accum, UPC is still running... PAPI counters should show an increase from prior accumulate...\n");
896 printf(
"SUCCESS: PAPI_accum...\n");
899 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
906 printf(
"\n==> Accumulate local counters. Perform another PAPI_accum, UPC is still running... PAPI counters should show an increase from prior accumulate...\n");
909 printf(
"SUCCESS: PAPI_accum...\n");
912 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
917 printf(
"\n==> Zero local counters. Perform a PAPI_accum, UPC is still running... PAPI counters should be less than the prior accumulate...\n");
921 printf(
"SUCCESS: PAPI_accum...\n");
924 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
929 printf(
"\n==> Perform a PAPI_read, UPC is still running... Native counters and PAPI counters should have both increased from prior accumulate...\n");
932 printf(
"SUCCESS: PAPI_read...\n");
935 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
940 printf(
"\n==> Perform a PAPI_write (not supported when UPC is running)...\n");
943 printf(
"SUCCESS: PAPI_write, not allowed...\n");
946 printf(
"FAILURE: PAPI_write failed, xRC=%d...\n", xRC);
950 printf(
"\n==> Stop the UPC... The individual native counter values will be greater than the PAPI counters because the PAPI counters are read prior to the UPC(s) being stopped...\n");
953 printf(
"SUCCESS: PAPI_stop...\n");
955 printf(
"FAILURE: PAPI_stop failed, xRC=%d...\n", xRC);
960 printf(
"\n==> Perform a PAPI_read with the UPC stopped...\n");
963 printf(
"SUCCESS: PAPI_read...\n");
965 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
967 printf(
"\n==> Should be same 4 counters below, with the same native and PAPI counters as after the PAPI_stop...\n");
970 printf(
"\n==> Perform a PAPI_accum with the UPC stopped... Native counters sould be zeroed, with the PAPI counters unchanged from prior read (with the UPC already stopped, the accumulate does not add any counter values to the local buffer)...\n");
974 printf(
"SUCCESS: PAPI_accum...\n");
977 printf(
"FAILURE: PAPI_accum failed, xRC=%d...\n", xRC);
982 printf(
"\n==> Perform a PAPI_read with the UPC stopped... Native and PAPI counters are zero...\n");
985 printf(
"SUCCESS: PAPI_read...\n");
987 printf(
"FAILURE: PAPI_read failed, xRC=%d...\n", xRC);
990 printf(
"\n==> Perform a reset, UPC is stopped... Native and PAPI counters are zero...\n");
993 printf(
"SUCCESS: PAPI_reset...\n");
996 printf(
"FAILURE: PAPI_reset failed, xRC=%d...\n", xRC);
1001 printf(
"\n==> Perform a PAPI_write, but only to local memory...\n");
1004 printf(
"SUCCESS: PAPI_write, but only to local memory...\n");
1007 printf(
"FAILURE: PAPI_write failed, xRC=%d...\n", xRC);
1011 printf(
"\n==> Get the state of the event set...\n");
1015 printf(
"SUCCESS: PAPI_state is STOPPED...\n");
1018 printf(
"FAILURE: PAPI_state failed, incorrect state, xState=%d...\n", xState);
1022 printf(
"FAILURE: PAPI_state failed, xRC=%d...\n", xRC);
1026 printf(
"\n==> Get the multiplex status of the eventset...\n");
1029 printf(
"SUCCESS: PAPI_get_multiplex (NOTE: The rest of the multiplex path is untested)...\n");
1032 printf(
"FAILURE: PAPI_get_multiplex failed, xRC=%d...\n", xRC);
1036 printf(
"\n==> Remove the events, and clean up the event set...\n");
1039 printf(
"SUCCESS: PAPI_remove_event could not find PNE_BGP_PU1_IPIPE_INSTRUCTIONS...\n");
1041 printf(
"FAILURE: PAPI_remove_event PNE_BGP_PU1_IPIPE_INSTRUCTIONS failed, xRC=%d...\n", xRC);
1045 printf(
"SUCCESS: PAPI_remove_event could not find PAPI_L3_LDM...\n");
1047 printf(
"FAILURE: PAPI_remove_event PAPI_L3_LDM failed, xRC=%d...\n", xRC);
1051 printf(
"SUCCESS: PAPI_remove_event PAPI_L1_TCM...\n");
1053 printf(
"FAILURE: PAPI_remove_event PAPI_L1_TCM failed, xRC=%d...\n", xRC);
1057 printf(
"SUCCESS: PAPI_num_events returned 3...\n");
1059 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1063 printf(
"SUCCESS: PAPI_remove_event PAPI_L1_ICM...\n");
1065 printf(
"FAILURE: PAPI_remove_event PAPI_L1_ICM failed, xRC=%d...\n", xRC);
1069 printf(
"SUCCESS: PAPI_num_events returned 2...\n");
1071 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1075 printf(
"SUCCESS: PAPI_remove_event PNE_BGP_PU3_L2_MEMORY_WRITES...\n");
1077 printf(
"FAILURE: PAPI_remove_event PNE_BGP_PU3_L2_MEMORY_WRITES failed, xRC=%d...\n", xRC);
1081 printf(
"SUCCESS: PAPI_num_events returned 1...\n");
1083 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1087 printf(
"SUCCESS: PAPI_remove_event PAPI_L1_DCM...\n");
1089 printf(
"FAILURE: PAPI_remove_event PAPI_L1_DCM failed, xRC=%d...\n", xRC);
1093 printf(
"SUCCESS: PAPI_num_events returned 0...\n");
1095 printf(
"FAILURE: PAPI_num_events failed, returned xRC=%d...\n", xRC);
1099 printf(
"SUCCESS: PAPI_cleanup_eventset...\n");
1101 printf(
"FAILURE: PAPI_cleanup_eventset failed, xRC=%d...\n", xRC);
1105 printf(
"SUCCESS: PAPI_destroy_eventset...\n");
1107 printf(
"FAILURE: PAPI_destroy_eventset failed, xRC=%d...\n", xRC);
1109 printf(
"==> Do_Low_Level_Tests(): End of the main body...\n");
int PAPI_stop(int EventSet, long long *values)
int PAPI_is_initialized(void)
int PAPI_add_event(int EventSet, int EventCode)
long long PAPI_get_virt_usec(void)
int PAPI_reset(int EventSet)
const PAPI_shlib_info_t * PAPI_get_shared_lib_info(void)
int PAPI_write(int EventSet, long long *values)
int PAPI_remove_event(int EventSet, int EventCode)
long long PAPI_get_virt_cyc(void)
int PAPI_enum_event(int *EventCode, int modifier)
get the executable's info
char Native_Buffer[BGP_UPC_MAXIMUM_LENGTH_READ_COUNTERS_STRUCTURE]
int PAPI_event_name_to_code(const char *in, int *out)
int PAPI_get_event_info(int EventCode, PAPI_event_info_t *info)
int PAPI_accum(int EventSet, long long *values)
long long PAPI_Counters[MAX_COUNTERS]
int PAPI_num_hwctrs(void)
A pointer to the following is passed to PAPI_get_dmem_info()
const PAPI_exe_info_t * PAPI_get_executable_info(void)
int PAPI_num_events(int EventSet)
int PAPI_state(int EventSet, int *status)
int PAPI_cleanup_eventset(int EventSet)
void Print_Node_Info(void)
int PAPI_create_eventset(int *EventSet)
int PAPI_event_code_to_name(int EventCode, char *out)
void Print_Counters(const int pEventSet)
int PAPI_get_dmem_info(PAPI_dmem_info_t *dest)
void DumpInHex(const char *pBuffer, int pSize)
long long PAPI_get_real_usec(void)
int PAPI_destroy_eventset(int *EventSet)
long long PAPI_get_real_cyc(void)
int PAPI_read(int EventSet, long long *values)
int PAPI_start(int EventSet)
int PAPI_get_multiplex(int EventSet)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
void Zero_Local_Counters(long long *pCounters)