Skip to content

Commit

Permalink
Round cpu cache bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Aug 13, 2021
1 parent d5b4bbc commit 5d5a0de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions conbench/machine_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ def _sysctl(stat):
"memory_bytes",
]

BYTES = [
"memory_bytes",
"cpu_l1d_cache_bytes",
"cpu_l1i_cache_bytes",
"cpu_l2_cache_bytes",
"cpu_l3_cache_bytes",
]

COMMANDS = {
"kernel_name": ["uname", "-r"],
Expand All @@ -32,7 +39,6 @@ def _sysctl(stat):
"memory_bytes": _sysctl("hw.memsize"),
}


LSCPU_MAPPING = {
"cpu_frequency_max_hz": "CPU max MHz",
"cpu_l1d_cache_bytes": "L1d cache",
Expand Down Expand Up @@ -115,7 +121,8 @@ def machine_info(host_name):
except ValueError:
info[key] = 0

info["memory_bytes"] = _round_memory(int(info["memory_bytes"]))
for key in BYTES:
info[key] = _round_memory(int(info[key]))

for key in info:
info[key] = str(info[key])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setuptools.setup(
name="conbench",
version="1.3.0",
version="1.4.0",
description="Continuous Benchmarking (CB) Framework",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 5d5a0de

Please sign in to comment.