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

update observer to latest python bindings #279

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions kernel_tuner/observers/powersensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
class PowerSensorObserver(BenchmarkObserver):
"""Observer that an external PowerSensor2 device to accurately measure power

Requires PowerSensor2 hardware and powersensor Python bindings.
Requires PowerSensor3 hardware and powersensor Python bindings.

:param observables: A list of string, containing any of "ps_energy" or "ps_power".
To measure energy in Joules or power consumption in Watt.
Expand Down Expand Up @@ -51,9 +51,8 @@ def after_finish(self):
) # Joules
self.results["ps_energy"].append(ps_measured_e)
if "ps_power" in self.observables:
ps_measured_t = (
end_state.time_at_read - self.begin_state.time_at_read
) # seconds
ps_measured_t = ((end_state.time_at_read - self.begin_state.time_at_read).microseconds / 1e6) # Seconds

self.results["ps_power"].append(ps_measured_e / ps_measured_t) # Watt

def get_results(self):
Expand Down