Some updates

This commit is contained in:
cephi_sui 2024-12-11 14:43:23 -05:00
parent 4ead55026d
commit 119bc9d8f9
5 changed files with 14 additions and 8 deletions

View File

@ -3,7 +3,7 @@ import re
from enum import Enum
class Stat(Enum):
CPU = 'cpu'
PLATFORM = 'platform'
THREADS = 'threads'
ITERATIONS = 'iterations'
@ -21,9 +21,13 @@ class Stat(Enum):
POWER_BEFORE = 'power before'
POWER = 'power'
POWER_AFTER = 'power after'
TIME_S_OVERALL = 'time (sec) overall'
TIME_S = 'time (sec)'
DELTA_WATT = 'Δ watt'
JOULES_OVERALL = 'joules overall'
JOULES = 'joules'
WATTS_OVERALL = 'wattage overall'
WATTS = 'wattage'
DELTA_WATT = 'Δ watt'
TASK_CLK = 'task clock (msec)'
PAGE_FAULTS = 'page faults'

View File

@ -178,6 +178,7 @@ def main():
for filename in glob.glob(f'{args.input_dir.rstrip("/")}/*.json'):
with open(filename, 'r') as file:
print(filename)
data_list.append(json.load(file))
print(filename + " loaded.")

View File

@ -1,2 +1 @@
{"CPU": "ALTRA", "ITERATIONS": 100000, "MATRIX_FILE": "soc-sign-Slashdot090221", "MATRIX_SHAPE": [82144, 82144], "MATRIX_SIZE": 6747636736, "MATRIX_NNZ": 549202, "MATRIX_DENSITY": 8.13917555860553e-05, "TIME_S": 9.906620264053345, "BASELINE_TIME_S": 10, "BASELINE_DELAY_S": 10, "POWER_BEFORE": [21.48, 21.28, 21.6, 21.6, 21.88, 21.96, 21.96, 21.84, 21.4, 21.44], "POWER": [102.12, 100.8, 88.12, 72.96, 55.76, 56.68, 60.92, 60.92, 77.88, 98.52, 109.4, 109.76, 111.0, 109.04, 106.48, 104.8, 105.32, 102.52], "JOULES": 1025.1467094707486, "POWER_AFTER": [21.88, 21.84, 21.76, 21.24, 21.36, 21.4, 21.32, 21.48, 21.6, 21.48]}
48, 21.4, 21.12, 20.92, 20.6]}

View File

@ -65,6 +65,8 @@ program_result = run_program(program[args.cpu])
result |= program_result[0]
print(program_result[1], file=sys.stderr)
result[Stat.TIME_S.name] = result[Stat.TIME_S_OVERALL.name] / result[Stat.ITERATIONS.name]
if args.power:
result[Stat.BASELINE_TIME_S.name] = args.baseline_time_s
result[Stat.BASELINE_DELAY_S.name] = args.baseline_delay_s
@ -91,15 +93,15 @@ if args.power:
# Riemann Sum across the last (s) power recordings.
from math import ceil
result[Stat.JOULES.name] = (
sum(result[Stat.POWER.name][-ceil(result[Stat.TIME_S.name]):-1])
+ (result[Stat.POWER.name][-1] * (result[Stat.TIME_S.name] % 1)))
sum(result[Stat.POWER.name][-ceil(result[Stat.TIME_S_OVERALL.name]):-1])
+ (result[Stat.POWER.name][-1] * (result[Stat.TIME_S_OVERALL.name] % 1)))
elif args.cpu == Cpu.EPYC_7313P:
power_process = subprocess.Popen(
[python[args.cpu], 'power.py'] + program[args.cpu],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
result[Stat.POWER.name] = [float(x) for x in power_process.communicate()[0].strip().split('\n')]
result[Stat.JOULES.name] = result[Stat.POWER.name][0] * result[Stat.TIME_S.name]
result[Stat.JOULES.name] = result[Stat.POWER.name][0] * result[Stat.TIME_S_OVERALL.name]
if args.debug:
print(result)

View File

@ -50,7 +50,7 @@ print(f"NNZ: {result[Stat.MATRIX_NNZ.name]}", file=sys.stderr)
result[Stat.MATRIX_DENSITY.name] = matrix.values().shape[0] / (matrix.shape[0] * matrix.shape[1])
print(f"Density: {result[Stat.MATRIX_DENSITY.name]}", file=sys.stderr)
result[Stat.TIME_S.name] = end - start
print(f"Time: {result[Stat.TIME_S.name]} seconds", file=sys.stderr)
result[Stat.TIME_S_OVERALL.name] = end - start
print(f"Time: {result[Stat.TIME_S_OVERALL.name]} seconds", file=sys.stderr)
print(json.dumps(result))