summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-03-19 11:18:11 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-03-19 11:18:11 +0100
commit6f8e47259c2cfa3a20a883f0f26ffe393a31a179 (patch)
tree69a1e945381afcbd88bd06c1f5c441a63cb1b050
parent0c70d3bc62a3cb58c4e411f1d64ff08691ccb1f4 (diff)
data_parameters: catch TypeError (sometimes ubjson stores numbers as Decimal)
-rw-r--r--lib/data_parameters.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/data_parameters.py b/lib/data_parameters.py
index 406d0a5..6e64011 100644
--- a/lib/data_parameters.py
+++ b/lib/data_parameters.py
@@ -85,10 +85,10 @@ class Protolog:
['bss_nop', 'bss_size_nop', idem],
['bss_ser', 'bss_size_ser', idem],
['bss_serdes', 'bss_size_serdes', idem],
- ['cycles_ser', 'cycles', lambda x: int(np.mean(x['ser']) - np.mean(x['nop']))],
- ['cycles_des', 'cycles', lambda x: int(np.mean(x['des']) - np.mean(x['nop']))],
- ['cycles_enc', 'cycles', lambda x: int(np.mean(x['enc']) - np.mean(x['nop']))],
- ['cycles_dec', 'cycles', lambda x: int(np.mean(x['dec']) - np.mean(x['nop']))],
+ ['cycles_ser', 'cycles', lambda x: max(0, int(np.mean(x['ser']) - np.mean(x['nop'])))],
+ ['cycles_des', 'cycles', lambda x: max(0, int(np.mean(x['des']) - np.mean(x['nop'])))],
+ ['cycles_enc', 'cycles', lambda x: max(0, int(np.mean(x['enc']) - np.mean(x['nop'])))],
+ ['cycles_dec', 'cycles', lambda x: max(0, int(np.mean(x['dec']) - np.mean(x['nop'])))],
['cycles_encser', 'cycles', lambda x:
int(np.mean(x['ser']) + np.mean(x['enc']) - 2 * np.mean(x['nop']))
],
@@ -132,6 +132,11 @@ class Protolog:
self.add_datapoint(arch, library, (benchmark, benchmark_item), subv, aggregate_label, data_label, getter)
except KeyError:
pass
+ except TypeError as e:
+ print('TypeError in {} {} {} {}: {}'.format(
+ arch_lib, benchmark, benchmark_item, aggregate_label,
+ str(e)))
+ pass
for key in self.aggregate.keys():
for arch in self.aggregate[key].keys():