Skip to content

Commit

Permalink
fix: fixing the fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanPedroGHM committed Sep 21, 2023
1 parent ad469ec commit 0dfcc6f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion perun/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"benchmarking": {
"rounds": 1,
"warmup_rounds": 0,
"units": {"JOULE": "k", "SECOND": "", "PERCENT": "", "POWER": ""},
},
"benchmarking.units": {"joule": "k", "second": "", "percent": "", "power": ""},
"debug": {"log_lvl": "WARNING"},
# "horeka": {"enabled": False, "url": "", "token": "", "org": ""},
}
Expand Down
8 changes: 4 additions & 4 deletions perun/io/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def exportBench(dataNode: DataNode, mr_id: str) -> str:
mrNode = dataNode.nodes[mr_id]

bench_units: Dict[str, Magnitude] = {
"JOULE": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.JOULE"]),
"SECOND": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.SECOND"]),
"WATT": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.WATT"]),
"PERCENT": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.PERCENT"]),
"JOULE": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.joule"]),
"SECOND": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.second"]),
"WATT": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.power"]),
"PERCENT": Magnitude.fromSymbol(mrNode.metadata["benchmarking.units.percent"]),
}

for metricType, metric in mrNode.metrics.items():
Expand Down
18 changes: 9 additions & 9 deletions perun/perun.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,21 +90,21 @@ def backends(self) -> Dict[str, Backend]:
"""
if not self._backends:
self._backends = {}
classList: List[Type[Backend]] = [
IntelRAPLBackend,
NVMLBackend,
PSUTILBackend,
]
for backend in classList:
classList: Dict[str, Type[Backend]] = {
"IntelRAPL": IntelRAPLBackend,
"NVML": NVMLBackend,
"PSUTIL": PSUTILBackend,
}
for name, backend in classList.items():
try:
backend_instance = backend()
self._backends[backend_instance.id] = backend_instance
except ImportError as ie:
log.info(f"Missing dependencies for backend {backend.name}")
log.info(f"Missing dependencies for backend {name}")
log.info(ie)
except Exception as e:
log.warning(f"Unknown error loading dependecy {backend.name}")
log.warning(e)
log.info(f"Unknown error loading dependecy {name}")
log.info(e)

return self._backends

Expand Down

0 comments on commit 0dfcc6f

Please sign in to comment.