Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No counters available despite papi_avail showing them #45

Open
cristobal-ortega opened this issue Jan 23, 2024 · 1 comment
Open

No counters available despite papi_avail showing them #45

cristobal-ortega opened this issue Jan 23, 2024 · 1 comment

Comments

@cristobal-ortega
Copy link

papi_high.num_counters() reports 0 counters while papi_avail shows plenty of them:

$ papi_avail 
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.1.0.0
Operating system         : Linux 5.15.0-91-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz (165, 0xa5)
CPU revision             : 2.000000
CPUID                    : Family/Model/Stepping 6/165/2, 0x06/0xa5/0x02
CPU Max MHz              : 5000
CPU Min MHz              : 800
Total cores              : 12
SMT threads per core     : 2
Cores per socket         : 6
Sockets                  : 1
Cores per NUMA region    : 12
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 11
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Avail Deriv Description (Note)
PAPI_L1_DCM  0x80000000  Yes   No   Level 1 data cache misses
PAPI_L1_ICM  0x80000001  Yes   No   Level 1 instruction cache misses
...
PAPI_TOT_CYC 0x8000003b  Yes   No   Total cycles
...
Of 108 possible events, 59 are available, of which 18 are derived.

When trying to start a counter through the high level interface or add it through the low level interface I get the following error:

    papi_low.add_event(group1, PAPI_TOT_CYC)
NameError: name 'PAPI_TOT_CYC' is not defined

libpfm is here: /usr/lib/libpfm.so

Note that I installed PAPI through the source code and not from the repo.

Thanks.

@flozz
Copy link
Owner

flozz commented Jan 30, 2024

Hello,

The PAPI version used by your papi_avail command is the v7.1.x, this binding still use the v5.5.x... There is a PR for the v6.0.x but it is not merged yet if you want to try it.


For your error:

    papi_low.add_event(group1, PAPI_TOT_CYC)
NameError: name 'PAPI_TOT_CYC' is not defined

This seems to be a Python error. In the bindings, all events are defined in the events module; you must import it:

import pypapi.events
# ...
papi_low.add_event(group1, pypapi.events.PAPI_TOT_CYC)

or

from pypapi.events import PAPI_TOT_CYC
#...
papi_low.add_event(group1, PAPI_TOT_CYC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants