Skip to content

Commit e535550

Browse files
committed
dsl: Filter out only the func which matches the target.function and has the same indices too
1 parent 24270be commit e535550

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

devito/petsc/solve.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ def linear_solve_args(self):
137137
exprs = exprs + (stagger_bc,)
138138

139139
funcs = get_funcs(exprs)
140-
funcs = tuple(f for f in funcs if f.function is not target.function)
140+
# TODO: Double check but this is for data dependencies otherwise the wrong halospots
141+
# are generated
142+
funcs = tuple(f for f in funcs if f != target)
141143
# from IPython import embed; embed()
142144
self.time_mapper = generate_time_mapper(exprs)
143145
arrays = self.generate_arrays(target)
@@ -212,7 +214,7 @@ def linear_solve_args(self):
212214

213215
funcs = get_funcs(exprs)
214216
target_set = set(self.target_exprs.keys())
215-
funcs = tuple(f for f in funcs if f.function not in target_set)
217+
funcs = tuple(f for f in funcs if f not in target_set)
216218
self.time_mapper = generate_time_mapper(exprs)
217219

218220
targets = list(self.target_exprs.keys())
@@ -271,6 +273,8 @@ def get_funcs(exprs):
271273
# f for e in exprs
272274
# for f in retrieve_functions(eval_time_derivatives(e.lhs - e.rhs))
273275
# ]
276+
# TODO: this is expensive, need to rethink, but otherside the initial compilation doesn't see
277+
# all "functions" e.g when derivatives are evaluated, so the halospots are not generated correctly.
274278
funcs = [
275279
f for e in exprs
276280
for f in retrieve_functions(e.evaluate)

0 commit comments

Comments
 (0)