Skip to content

Commit

Permalink
Container energy idle (#992)
Browse files Browse the repository at this point in the history
* Clarification on Turbo Boost and when it is off

* Container energy and power incl. idle added [skip ci]
  • Loading branch information
ArneTR authored Nov 22, 2024
1 parent f9df24f commit a9e4ebb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions frontend/js/helpers/config.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion lib/hardware_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<o>.*)'],
[rfwr, 'Turbo Boost (1=off)', '/sys/devices/system/cpu/intel_pstate/no_turbo', r'(?P<o>.*)'],
[rfwr, 'Turbo Boost (Legacy non intel_pstate)', '/sys/devices/system/cpu/cpufreq/boost', r'(?P<o>.*)'],
[rfwr, 'Virtualization', '/proc/cpuinfo', r'(?P<o>hypervisor)'],
[rpwrs, 'SGX', f"{os.path.join(CURRENT_PATH, '../tools/sgx_enable')} -s", r'(?P<o>.*)', re.IGNORECASE | re.DOTALL],
Expand Down
4 changes: 3 additions & 1 deletion lib/phase_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a9e4ebb

Please sign in to comment.