From 9ca46c5bf9a8bf7072760241571c748763a3232c Mon Sep 17 00:00:00 2001 From: ewoud ketele Date: Mon, 13 Nov 2023 17:08:20 +0100 Subject: [PATCH 1/3] add correction factor for python 3.11 --- src/db12/factors.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db12/factors.json b/src/db12/factors.json index c06fe57..2f922d1 100644 --- a/src/db12/factors.json +++ b/src/db12/factors.json @@ -5,6 +5,7 @@ "Intel": 0.86, "AMD": 0.71 } - } + }, + "3.11": 0.912400392678881 } } From be4efef797bf6e136a06fd3c2eda368f277df921 Mon Sep 17 00:00:00 2001 From: ewoud ketele Date: Wed, 15 Nov 2023 14:57:32 +0100 Subject: [PATCH 2/3] add same factor for AMD and Intel cpus --- src/db12/factors.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/db12/factors.json b/src/db12/factors.json index 2f922d1..e6c1a7b 100644 --- a/src/db12/factors.json +++ b/src/db12/factors.json @@ -6,6 +6,11 @@ "AMD": 0.71 } }, - "3.11": 0.912400392678881 + "3.11": { + "cpu_brand": { + "Intel": 0.912400392678881, + "AMD": 0.912400392678881 + } + } } } From e7c20b24e3e33ff067ba3e80406c0033f5750dce Mon Sep 17 00:00:00 2001 From: ewoud ketele Date: Mon, 20 Nov 2023 16:08:42 +0100 Subject: [PATCH 3/3] retrieve cpu brand via /proc/cpuinfo/vendor_id instead of /proc/cpuinfo/model name --- src/db12/benchmark.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/db12/benchmark.py b/src/db12/benchmark.py index 30d44d5..2d2d29b 100644 --- a/src/db12/benchmark.py +++ b/src/db12/benchmark.py @@ -228,7 +228,11 @@ def get_norm_correction(norm_computed): try: with open("/proc/cpuinfo", "r") as file_object: content = file_object.read() - cpu_brand_name = re.findall("model name\t: ([a-zA-Z]*)", content)[0] + cpu_brand_name = re.findall("vendor_id\t: ([a-zA-Z]*)", content)[0] + if cpu_brand_name == "GenuineIntel": + cpu_brand_name = "Intel" + elif cpu_brand_name == "AuthenticAMD": + cpu_brand_name = "AMD" except (IOError, IndexError): logging.warning( "Cannot correct the score, return the raw norm: cannot access CPU information"