From b3a9c59fb4add0606ae3b61c17d3fe07abc51250 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 16 Jul 2019 08:25:14 +0200 Subject: Protolog: Handle NaN in cycles_enc --- lib/data_parameters.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/data_parameters.py b/lib/data_parameters.py index bbfb404..7cb875d 100644 --- a/lib/data_parameters.py +++ b/lib/data_parameters.py @@ -315,26 +315,38 @@ class Protolog: val['energy_enc'] = int(val['cycles_enc'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_enc is NaN for {} -> {} -> {}'.format(arch, lib, key)) try: val['energy_ser'] = int(val['cycles_ser'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_ser is NaN for {} -> {} -> {}'.format(arch, lib, key)) try: val['energy_encser'] = int(val['cycles_encser'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_encser is NaN for {} -> {} -> {}'.format(arch, lib, key)) try: val['energy_des'] = int(val['cycles_des'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_des is NaN for {} -> {} -> {}'.format(arch, lib, key)) try: val['energy_dec'] = int(val['cycles_dec'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_dec is NaN for {} -> {} -> {}'.format(arch, lib, key)) try: val['energy_desdec'] = int(val['cycles_desdec'] * cpu.get_power(cpu_conf) / cpu_conf['cpu_freq'] * 1e9) except KeyError: pass + except ValueError: + print('cycles_desdec is NaN for {} -> {} -> {}'.format(arch, lib, key)) if radio_conf_str: radio_conf = utils.parse_conf_str(radio_conf_str) -- cgit v1.2.3