From 5933c8055579b7d50a0aa8b5acaf146765d7bdc6 Mon Sep 17 00:00:00 2001 From: Fabio Luporini Date: Wed, 4 Dec 2024 09:05:43 +0000 Subject: [PATCH] misc: Fixup Profiler.add_global_vanilla --- devito/operator/profiling.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/devito/operator/profiling.py b/devito/operator/profiling.py index b7fc3329c2..32742489cd 100644 --- a/devito/operator/profiling.py +++ b/devito/operator/profiling.py @@ -454,12 +454,13 @@ def add_glb_vanilla(self, key, time): ops = sum(v.ops for v in self.input.values()) traffic = sum(v.traffic for v in self.input.values()) - if np.isnan(traffic) or traffic == 0: - return - gflops = float(ops)/10**9 gflopss = gflops/time - oi = float(ops/traffic) + + if np.isnan(traffic) or traffic == 0: + oi = None + else: + oi = float(ops/traffic) self.globals[key] = PerfEntry(time, gflopss, None, oi, None, None)