Skip to content

Commit

Permalink
fix: rapl value
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed-Chakib Belgaid committed Sep 25, 2019
1 parent 24d3222 commit 58c4b40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyRAPL/pyRAPL.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import logging
import time
import functools
from math import ldexp

from enum import Enum

Expand Down Expand Up @@ -205,7 +204,7 @@ def energy(self, device):

api_file = self._sys_api[device]
api_file.seek(0, 0)
return ldexp(int(api_file.readline()), -32)
return int(api_file.readline())

def _begin_record(self, device):
energy = self.energy(device)
Expand Down Expand Up @@ -245,7 +244,8 @@ def stop(self):

def _compute_recorded_energy(self, device):

recorded_energy = self._measure[device][1] - self._measure[device][0]
recorded_energy = (self._measure[device][1] - self._measure[device][0])/1000000
# print("yolo")
self._measure[device][0] = None
self._measure[device][1] = None
return recorded_energy
Expand Down

0 comments on commit 58c4b40

Please sign in to comment.