diff --git a/devito/passes/clusters/implicit.py b/devito/passes/clusters/implicit.py index 6c1cab378a..100ba4842a 100644 --- a/devito/passes/clusters/implicit.py +++ b/devito/passes/clusters/implicit.py @@ -182,8 +182,9 @@ def callback(self, clusters, prefix): if dim not in edims or not edims.issubset(prefix.dimensions): continue - found[d.msd].clusters.append(c) - found[d.msd].mapper = reduce(found[d.msd].mapper, mapper, edims, prefix) + found[d.functions].clusters.append(c) + found[d.functions].mapper = reduce(found[d.functions].mapper, + mapper, edims, prefix) # Turn the reduced mapper into a list of equations mapper = {} diff --git a/devito/types/grid.py b/devito/types/grid.py index ab767932fd..d49cf95ad7 100644 --- a/devito/types/grid.py +++ b/devito/types/grid.py @@ -783,12 +783,7 @@ def __subdomain_finalize__(self, grid, counter=0, **kwargs): # Check if shorthand notation has been provided: for j in range(2): idx = 2*i + j - if isinstance(self._local_bounds[idx], int): - sd_func.data[:, idx] = np.full((self._n_domains,), - self._local_bounds[idx], - dtype=np.int32) - else: - sd_func.data[:, idx] = self._local_bounds[idx] + sd_func.data[:, idx] = self._local_bounds[idx] dname = '%si%d' % (d.name, counter) dimensions.append(MultiSubDimension(dname, d, diff --git a/tests/test_subdomains.py b/tests/test_subdomains.py index 432f13e230..5ee2076fd9 100644 --- a/tests/test_subdomains.py +++ b/tests/test_subdomains.py @@ -642,6 +642,15 @@ class Dummy(SubDomainSet): assert_structure(op, ['t,n0', 't,n0,xi20_blk0,yi20_blk0,x,y,z'], 't,n0,xi20_blk0,yi20_blk0,x,y,z') + xi, _, _ = dummy.dimensions + # Check that the correct number of thickness expressions are generated + sdsexprs = [i.expr for i in FindNodes(Expression).visit(op) + if i.expr.rhs.is_Indexed + and i.expr.rhs.function is xi.functions] + # The thickness expressions Eq(x_ltkn0, dummy[n0][0]), ... + # should be scheduled once per dimension + assert len(sdsexprs) == 6 + def test_sequential_implicit(self): """ Make sure the implicit dimensions of the MultiSubDomain define a sequential