Skip to content

Commit

Permalink
fix: intel_rapl dram max value, wrong overwriting of hdf5 file
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanPedroGHM committed Aug 8, 2023
1 parent 8778d86 commit 8338be8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions perun/backend/intel_rapl.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ def func() -> np.number:

if devType != DeviceType.OTHER:
with open(child / "max_energy_range_uj", "r") as file:
max_energy = np.uint64(file.readline().strip())
line = file.readline().strip()
max_energy = np.uint64(line)
dataType = MetricMetaData(
Unit.JOULE,
Magnitude.MICRO,
Expand Down Expand Up @@ -127,9 +128,10 @@ def func() -> np.number:

if devType != DeviceType.OTHER:
with open(
child / "max_energy_range_uj", "r"
grandchild / "max_energy_range_uj", "r"
) as file:
max_energy = np.uint64(file.readline().strip())
line = file.readline().strip()
max_energy = np.uint64(line)

dataType = MetricMetaData(
Unit.JOULE,
Expand Down
2 changes: 1 addition & 1 deletion perun/io/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def exportHDF5(filePath: Path, dataNode: DataNode):
dataNode : DataNode
Root of data node tree.
"""
h5_file = h5py.File(filePath, "a")
h5_file = h5py.File(filePath, "w")
_addNode(h5_file, dataNode)
h5_file.close()

Expand Down

0 comments on commit 8338be8

Please sign in to comment.