Skip to content

Commit fabd033

Browse files
committed
compiler: Make drop_reduction MPI pass bundles-aware
1 parent 367c982 commit fabd033

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

devito/passes/iet/mpi.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ def _drop_reduction_halospots(iet):
4141
# If all HaloSpot reads pertain to reductions, then the HaloSpot is useless
4242
for hs, expressions in MapNodes(HaloSpot, Expression).visit(iet).items():
4343
scope = Scope(i.expr for i in expressions)
44-
for f, v in scope.reads.items():
45-
if f in hs.fmapper and all(i.is_reduction for i in v):
46-
mapper[hs].add(f)
44+
for k, v in hs.fmapper.items():
45+
f = v.bundle or k
46+
if f not in scope.reads:
47+
continue
48+
v = scope.reads[f]
49+
if all(i.is_reduction for i in v):
50+
mapper[hs].add(k)
4751

4852
# Transform the IET introducing the "reduced" HaloSpots
4953
mapper = {hs: hs._rebuild(halo_scheme=hs.halo_scheme.drop(mapper[hs]))

0 commit comments

Comments
 (0)