Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Container energy idle #992

Merged
merged 2 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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