From 98fb7943e22d1cc519655a0e38320b6f59ccfb30 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Fri, 22 Nov 2024 18:30:19 +0100 Subject: [PATCH 1/2] Clarification on Turbo Boost and when it is off --- lib/hardware_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/hardware_info.py b/lib/hardware_info.py index b46548de0..8df9ec9f6 100755 --- a/lib/hardware_info.py +++ b/lib/hardware_info.py @@ -55,7 +55,7 @@ # If another scaling driver is used the info will be in /sys/devices/system/cpu/cpufreq/boost # See https://wiki.archlinux.org/title/CPU_frequency_scaling # See further: https://www.kernel.org/doc/html/v5.17/admin-guide/pm/intel_pstate.html#user-space-interface-in-sysfs - [rfwr, 'Turbo Boost', '/sys/devices/system/cpu/intel_pstate/no_turbo', r'(?P.*)'], + [rfwr, 'Turbo Boost (1=off)', '/sys/devices/system/cpu/intel_pstate/no_turbo', r'(?P.*)'], [rfwr, 'Turbo Boost (Legacy non intel_pstate)', '/sys/devices/system/cpu/cpufreq/boost', r'(?P.*)'], [rfwr, 'Virtualization', '/proc/cpuinfo', r'(?Phypervisor)'], [rpwrs, 'SGX', f"{os.path.join(CURRENT_PATH, '../tools/sgx_enable')} -s", r'(?P.*)', re.IGNORECASE | re.DOTALL], From 16c1f99601da6708def32748e65dd53eb33821c2 Mon Sep 17 00:00:00 2001 From: Arne Tarara Date: Fri, 22 Nov 2024 18:49:20 +0100 Subject: [PATCH 2/2] Container energy and power incl. idle added [skip ci] --- frontend/js/helpers/config.js.example | 12 ++++++++++++ lib/phase_stats.py | 4 +++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/frontend/js/helpers/config.js.example b/frontend/js/helpers/config.js.example index 7b61d6bc2..f6eb2f8c6 100644 --- a/frontend/js/helpers/config.js.example +++ b/frontend/js/helpers/config.js.example @@ -34,12 +34,24 @@ METRIC_MAPPINGS = { 'explanation': 'Container energy estimated via CPU-% share', }, + 'psu_energy_cgroup_slice': { + 'clean_name': 'Container Energy (+Idle)', + 'source': 'estimation', + 'explanation': 'Container energy estimated via CPU-% share (incl. idle)', + }, + 'psu_power_cgroup_container': { 'clean_name': 'Container Power', 'source': 'estimation', 'explanation': 'Container power estimated via CPU-% share', }, + 'psu_power_cgroup_slice': { + 'clean_name': 'Container Power (+Idle)', + 'source': 'estimation', + 'explanation': 'Container power estimated via CPU-% share incl. Idle', + }, + 'psu_carbon_dc_rapl_msr_machine': { 'clean_name': 'Machine CO₂', 'source': 'RAPL', diff --git a/lib/phase_stats.py b/lib/phase_stats.py index 44ea39699..7ac57870a 100644 --- a/lib/phase_stats.py +++ b/lib/phase_stats.py @@ -182,15 +182,17 @@ def build_and_store_phase_stats(run_id, sci=None): if machine_power_idle and cpu_utilization_machine and cpu_utilization_containers: surplus_power_runtime = machine_power_runtime - machine_power_idle surplus_energy_runtime = machine_energy_runtime - (machine_power_idle * decimal.Decimal(duration / 10**6)) + total_container_utilization = sum(cpu_utilization_containers.values()) if int(total_container_utilization) == 0: continue for detail_name, container_utilization in cpu_utilization_containers.items(): + csv_buffer.write(generate_csv_line(run_id, 'psu_energy_cgroup_slice', detail_name, f"{idx:03}_{phase['name']}", machine_energy_runtime * (container_utilization / total_container_utilization), 'TOTAL', None, None, 'mJ')) + csv_buffer.write(generate_csv_line(run_id, 'psu_power_cgroup_slice', detail_name, f"{idx:03}_{phase['name']}", machine_power_runtime * (container_utilization / total_container_utilization), 'TOTAL', None, None, 'mW')) csv_buffer.write(generate_csv_line(run_id, 'psu_energy_cgroup_container', detail_name, f"{idx:03}_{phase['name']}", surplus_energy_runtime * (container_utilization / total_container_utilization), 'TOTAL', None, None, 'mJ')) csv_buffer.write(generate_csv_line(run_id, 'psu_power_cgroup_container', detail_name, f"{idx:03}_{phase['name']}", surplus_power_runtime * (container_utilization / total_container_utilization), 'TOTAL', None, None, 'mW')) - csv_buffer.seek(0) # Reset buffer position to the beginning DB().copy_from( csv_buffer,