Skip to content

Commit

Permalink
compiler: prioritize smaller perfect loop over atomics
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Oct 10, 2023
1 parent 1b6cd88 commit daf671c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion devito/passes/iet/parpragma.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,10 +289,10 @@ def _score_candidate(self, n0, root, collapsable=()):
return (
int(n_fp_iters == n), # Fully-parallel nest
n_fp_iters_large,
n_fp_iters,
n_pia_iters_large,
n_pia_iters,
-(n0 + 1), # The outer, the better
n_fp_iters,
n,
)

Expand Down
3 changes: 2 additions & 1 deletion tests/test_dle.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,8 @@ def test_incr_perfect_sparse_outer(self):

eqns = s.inject(u, expr=s)

op = Operator(eqns, opt=('advanced', {'par-collapse-ncores': 0}))
op = Operator(eqns, opt=('advanced', {'par-collapse-ncores': 0,
'openmp': True}))

iters = FindNodes(Iteration).visit(op)
assert len(iters) == 5
Expand Down

0 comments on commit daf671c

Please sign in to comment.