Skip to content

Commit

Permalink
compiler: Tweak lowering of HaloTouch
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioLuporini committed May 26, 2023
1 parent df820d6 commit db68f89
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions devito/ir/stree/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def stree_build(clusters, profiler=None, **kwargs):
"""
Create a ScheduleTree from a ClusterGroup.
"""
clusters = preprocess(clusters)
clusters = preprocess(clusters, **kwargs)

stree = ScheduleTree()
section = None
Expand Down Expand Up @@ -130,7 +130,7 @@ def stree_build(clusters, profiler=None, **kwargs):
base = IterationInterval(Interval(None), [], Any)


def preprocess(clusters):
def preprocess(clusters, options=None, **kwargs):
"""
Remove the HaloTouch's from `clusters` and create a mapping associating
each removed HaloTouch to the first Cluster necessitating it.
Expand All @@ -146,7 +146,8 @@ def preprocess(clusters):

found = []
for c1 in list(queue):
if c1.halo_scheme.distributed_aindices & dims:
if c1.guards == c.guards and \
c1.halo_scheme.distributed_aindices & dims:
found.append(c1)
queue.remove(c1)

Expand All @@ -155,6 +156,13 @@ def preprocess(clusters):

processed.append(c.rebuild(syncs=syncs, halo_scheme=halo_scheme))

# Sanity check!
try:
assert not queue
except AssertionError:
if options['mpi']:
raise RuntimeError("Unsupported MPI for the given equations")

return processed


Expand Down

0 comments on commit db68f89

Please sign in to comment.