You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Depending on available events at a given machine, and which events are selected, using papi_high.hl_region_begin and papi_high.hl_region_end pair from #37 may throw the following exceptions:
This happens if the selected events are not available on the current machine, in my example I previously set the PAPI_EVENTS environment variable with export PAPI_EVENTS="PAPI_TOT_CYC", but this preset event was not available at my machine. So it is important to check the events available at the PAPI installation that has been used to configure PyPAPI.
This can be done by running the auxiliary scripts papi_components_avail, papi_avail or papi_native_availfrom the library USED with the Python Binding.
It is possible to use the Low Level API as well. However, it will list the preset events even though you might not have them available at your current machine.
frompypapiimportpapi_lowpapi_low.library_init() # It is necessary to init the library before running functions from the Low Level APIpapi_low.enum_cmp_event(0) # Component 0 is usually perf_event
Another important thing to point out is that some counters can't be read without superuser privileges, which may lead to incorrect event counts, which is the case for some energy counter used by the powercap component. To use them, it is possible to run the script as root or run it inside a Docker containers with the --privileged flag.
The text was updated successfully, but these errors were encountered:
Depending on available events at a given machine, and which events are selected, using
papi_high.hl_region_begin
andpapi_high.hl_region_end
pair from #37 may throw the following exceptions:This happens if the selected events are not available on the current machine, in my example I previously set the PAPI_EVENTS environment variable with
export PAPI_EVENTS="PAPI_TOT_CYC"
, but this preset event was not available at my machine. So it is important to check the events available at the PAPI installation that has been used to configure PyPAPI.This can be done by running the auxiliary scripts papi_components_avail, papi_avail or papi_native_avail from the library USED with the Python Binding.
It is possible to use the Low Level API as well. However, it will list the preset events even though you might not have them available at your current machine.
Another important thing to point out is that some counters can't be read without superuser privileges, which may lead to incorrect event counts, which is the case for some energy counter used by the
powercap
component. To use them, it is possible to run the script as root or run it inside a Docker containers with the--privileged
flag.The text was updated successfully, but these errors were encountered: