-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
Update v6.0.0.1 #37
Update v6.0.0.1 #37
Conversation
SerodioJ
commented
Mar 6, 2023
- Updates lib to use PAPI v6.0.0.1
- Implements bindings for almost all low level APIs
- Adds functionalities to convert from C structs to Python objects
- Adds Dockerfile to build image
Hello, First, thank you for your work! I had a quick look of the PR, here are two things I noticed:
I will try to do a complete review by the end of the week. Once merged, I will add some lint checking and an automated build for sdist and wheel package with automatic publishing on PyPI :) |
Hi flozz, Thank you for your quick feedback. |
Hello, I reviewed the PR, I only have a remark and a question:
Apart from these two points, everything is looking good to me :) |
This looks very useful. Are there any plans to add this to master? |
It is not merged because the doc is not updated and does not match the new APIs. As soon as the doc is up to date with the code, it could be merged... (also I do not know if the numpy arrays are really useful here...) |
Hi, everyone. I had a kinda of chaotic semester, so I ended up forgetting about this PR. Regarding the usage of NumPy, I ended up using it to enforce C types on integer values as Python's int has variable size, so it could lead to some problems when converting data to/from PAPI. Sorry for the late reply. |
Maybe the ctypes module could help. But if you think NumPy is the best solution, it is ok for me (I just wanted to know why it was added :) )
Do not worry! We all have our own problems and priorities, so update the doc when you have time for it ;) |
pypapi/papi_high.py
Outdated
|
||
# Stop counters | ||
papi_high.stop_counters() # -> [] | ||
PAPI_hl_region_end("computation") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PAPI_hl_region_end("computation") | |
papi_high.hl_region_end("computation") |
I assume
pypapi/papi_high.py
Outdated
|
||
rcode = lib.PAPI_start_counters(events_, array_len) | ||
cregion = ffi.new("char[]", region.encode("ascii")) | ||
rcode = lib.PAPI_hl_region(cregion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting AttributeError: cffi library 'pypapi._papi' has no function, constant or global variable named 'PAPI_hl_region'. Did you mean: 'PAPI_hl_read'?
when trying to call this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@WaDelma thanks for pointing out these problems.
I fixed them on the commits below.
Could you test the lib?
I still have to validate if the changes from NumPy to CTypes that I made did not mess any masking operations.
Hi everyone. |
I am trying to do:
and while it doesn't error, it also doesn't seem to create any file anywhere. I found information that it should create folder I am quite new to PAPI, so might have just missed something. |
Could you check the available components of your PAPI installation?
Check if the perf_event component is active and has a set of available counters. If it shows something like this:
It's a problem with the version of libpfm4 ported with PAPI. |
@SerodioJ Is the PR ready for review? If yes, I will try to get it done by the end of the week :) |
@flozz It is ready. Thanks!! I will try to update the lib for the current version of PAPI in the near future. It seems that a few functionalities are not working well on newer processors with the version 6.0.0.1 but they work with 7.0.1. |
I got
and What I did notice that I actually have |
I reviewed the code and fixed some things. I made a PR on your repo: SerodioJ#1 once this PR merged, I will be able to merge this one and to release a new version :) |
V6.0.0.1 fixes
→ v6.0.0.1 finally released. wheels are being build and will be published on PyPI soon. Thank you for the PR! :) |