Skip to content

Commit

Permalink
bench: Patch autotuner after ParallelIteration revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed May 2, 2023
1 parent 98fe7e5 commit 021e425
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion devito/core/autotuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ def finalize_time_bounds(stepper, at_args, args, mode):
def calculate_nblocks(tree, blockable):
block_indices = [n for n, i in enumerate(tree) if i.dim in blockable]
index = block_indices[0]
collapsed = tree[index:index + (tree[index].ncollapsed or index+1)]
try:
ncollapsed = tree[index].ncollapsed
except AttributeError:
# Not using OpenMP
ncollapsed = 0
collapsed = tree[index:index + (ncollapsed or index+1)]
blocked = [i.dim for i in collapsed if i.dim in blockable]
remainders = [(d.root.symbolic_max-d.root.symbolic_min+1) % d.step for d in blocked]
niters = [d.root.symbolic_max - i for d, i in zip(blocked, remainders)]
Expand Down

0 comments on commit 021e425

Please sign in to comment.