Skip to content

Commit

Permalink
Merge 05060d5 into 47a9885
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas authored Jan 5, 2021
2 parents 47a9885 + 05060d5 commit c9a714c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions devito/operator/operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,10 @@ def _emit_apply_profiling(self, args):
v = summary.globals.get('fdlike')
if v is not None:
if v.gflopss is not None:
perf("%s* Achieved %.2f GFlops/s, %.2f FD-GPts/s" %
perf("%s* Achieved %.2f GFlops/s, %.2f GPts/s" %
(indent, v.gflopss, v.gpointss))
else:
perf("%s* Achieved %.2f FD-GPts/s" %
perf("%s* Achieved %.2f GPts/s" %
(indent, v.gpointss))
perf("Local performance indicators")
else:
Expand Down
22 changes: 17 additions & 5 deletions devito/operator/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,27 @@ def analyze(self, iet):
# Each ExpressionBundle lives in its own iteration space
itermaps = [i.ispace.dimension_map for i in bundles]

# Track how many grid points are written within `s`
# Track how many FD points are written within `s`
points = []
total_writes = 0
for i in bundles:
writes = {e.write for e in i.exprs
if e.is_tensor and e.write.is_TimeFunction}
points.append(i.size*len(writes))
points = sum(points)
total_writes += len(writes)
# If we have writes only consider one iteration space size
# per bundle otherwise append 0
if len(writes):
points.append(i.size)
else:
points.append(i.size*len(writes))

self._sections[s.name] = SectionData(ops, sops, points, traffic, itermaps)
# list(set()) will return a list with unique elements
# discarding duplicate grid sizes
points = list(set(points))

fdpoints = sum(points)

self._sections[s.name] = SectionData(ops, sops, fdpoints, traffic, itermaps)

def instrument(self, iet, timer):
"""
Expand Down Expand Up @@ -185,7 +197,7 @@ def summary(self, args, dtype, reduce_over=None):
# Number of FLOPs performed
ops = int(subs_op_args(data.ops, args))

# Number of grid points computed
# Number of FD points computed
points = int(subs_op_args(data.points, args))

# Compulsory traffic
Expand Down

0 comments on commit c9a714c

Please sign in to comment.