From ab76aa73f2a200c017357f0e833be1ce38f1c58a Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Fri, 12 Jun 2015 13:02:05 +0100 Subject: [PATCH] cpustate: fixing division by zero total running time (in parallel stats) is zero when all cores on a cluster are hotplugged. this caused a division by zero when calculating percentage. --- wlauto/utils/power.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wlauto/utils/power.py b/wlauto/utils/power.py index cfee9617..a022d1fe 100644 --- a/wlauto/utils/power.py +++ b/wlauto/utils/power.py @@ -330,7 +330,10 @@ class ParallelStats(object): if not self.use_ratios: time_pc *= 100 if n: - running_time_pc = time / running_time + if running_time: + running_time_pc = time / running_time + else: + running_time_pc = 0 if not self.use_ratios: running_time_pc *= 100 else: