pyRAPL icon indicating copy to clipboard operation
pyRAPL copied to clipboard

Measurements error

Open manceaur opened this issue 1 year ago • 3 comments

I tried to run a simple following example with pyRAPL but something went wrong when measurement ends :

I'm using Fedora 35, python 3.9.12

Here the code :

import pyRAPL

pyRAPL.setup()

csv_output = pyRAPL.outputs.CSVOutput('results.csv')

@pyRAPL.measureit(output=csv_output)
def test(N):
    a = 0
    for i in range(N):
        a += 1
    return a

test(1000)

csv_output.save()


TypeError                                 Traceback (most recent call last)
~/test_measurement.ipynb Cellule 6 in <cell line: 14>()
     [11]        a += 1
     [12]    return a
---> [14] test(1000)
     [17] csv_output.save()

File ~/.conda/envs/exp_env/lib/python3.9/site-packages/pyRAPL/measurement.py:123, in measureit.<locals>.decorator_measure_energy.<locals>.wrapper_measure(*args, **kwargs)
    121     val = func(*args, **kwargs)
    122 sensor.end()
--> 123 sensor._results = sensor._results / number
    124 sensor.export()
    125 return val

File ~/.conda/envs/exp_env/lib/python3.9/site-packages/pyRAPL/result.py:53, in Result.__truediv__(self, number)
     51 _duration = self.duration / number
     52 _pkg = [j / number for j in self.pkg]
---> 53 _dram = [j / number for j in self.dram]
     54 return Result(self.label, self.timestamp, _duration, _pkg, _dram)

TypeError: 'NoneType' object is not iterable

manceaur avatar Nov 25 '22 13:11 manceaur