FAQPAPICounters

From Tau Wiki
Jump to: navigation, search

Question

How do I find out which PAPI counters my system's CPU supports?

Answer

A set of PAPI events counters may not be compatible with your system's hardware or they may not compatible with each other and the system will not allow them to be counted together. In papi's share/papi/utils directory you will find papi_event_chooser utility, this utility will help you find compatible PAPI events. For example, On the IA64 Itanium2 CPUs I can count these events together:

% papi/utils> papi_event_chooser PAPI_LD_INS PAPI_SR_INS
Test case eventChooser: Available events which can be added with given
events.
-------------------------------------------
Vendor string and code   : GenuineIntel (1)
Model string and code    : Itanium 2 (2)
CPU Revision             : 1.000000
CPU Megahertz            : 1500.000000
CPU's in this Node       : 16
Nodes in this System     : 1
Total CPU's              : 16
Number Hardware Counters : 4
Max Multiplex Counters   : 32
-------------------------------------------
Usage: eventChooser NATIVE|PRESET evt1 evet2 ...

But, if I add PAPI_L1_DCM to this mix, it refuses to count them:

papi/utils> papi_event_chooser PAPI_LD_INS PAPI_SR_INS PAPI_L1_DCM
Test case eventChooser: Available events which can be added with given
events.
-------------------------------------------
Vendor string and code   : GenuineIntel (1)
Model string and code    : Itanium 2 (2)
CPU Revision             : 1.000000
CPU Megahertz            : 1500.000000
CPU's in this Node       : 16
Nodes in this System     : 1
Total CPU's              : 16
Number Hardware Counters : 4
Max Multiplex Counters   : 32
-------------------------------------------
Event PAPI_L1_DCM can't be counted with others

Try this utility to select the events and then add them to environment variables. See Setting Hardware Counters for information on how to instrument code with hardware counters.