From c989bc0dabe4ecc41899dc06351f60285a3d08ae Mon Sep 17 00:00:00 2001 From: Edward Caunt Date: Thu, 26 Sep 2024 10:32:03 +0100 Subject: [PATCH] misc: Respond to comments --- devito/ir/equations/algorithms.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/devito/ir/equations/algorithms.py b/devito/ir/equations/algorithms.py index a9d387608e..0ebcd43737 100644 --- a/devito/ir/equations/algorithms.py +++ b/devito/ir/equations/algorithms.py @@ -179,7 +179,7 @@ def concretize_subdims(exprs, **kwargs): dimensions = tuple(mapper.get(d, d) for d in f.dimensions) if dimensions != f.dimensions: # A dimension has been rebuilt, so build a mapper for Indexed - mapper[f.indexed] = f._rebuild(dimensions=dimensions, function=None).indexed + mapper[f.indexed] = f._rebuild(dimensions=dimensions).indexed processed = [uxreplace(e, mapper) for e in exprs] @@ -213,9 +213,8 @@ def _(d, mapper, rebuilt, sregistry): # Already have a substitution for this dimension return - tkns = [tkn._rebuild(name=sregistry.make_name(prefix=tkn.name)) - for tkn in d.tkns] - tkns_subs = {tkn0: tkn1 for tkn0, tkn1 in zip(d.tkns, tkns)} + tkns_subs = {tkn: tkn._rebuild(name=sregistry.make_name(prefix=tkn.name)) + for tkn in d.tkns} left, right = [mM.subs(tkns_subs) for mM in (d.symbolic_min, d.symbolic_max)] thickness = tuple((v, d._thickness_map[k]) for k, v in tkns_subs.items()) @@ -272,9 +271,7 @@ def _(d, mapper, rebuilt, sregistry): rebuilt[idim0] = idim1 = idim0._rebuild(name=iname) kwargs['implicit_dimension'] = idim1 - fkwargs.update({'dimensions': (idim1,) + d.functions.dimensions[1:], - 'halo': None, - 'padding': None}) + fkwargs['dimensions'] = (idim1,) + d.functions.dimensions[1:] if d.functions in rebuilt: functions = rebuilt[d.functions] @@ -284,10 +281,12 @@ def _(d, mapper, rebuilt, sregistry): # Warn the user if name has been changed, since this will affect overrides if fname != d.functions.name: fkwargs['name'] = fname - warning("%s <%s> renamed as '%s'" % - (str(d.functions), id(d.functions), fname)) + warning("%s <%s> renamed as '%s'. Consider assigning a unique name to %s." % + (str(d.functions), id(d.functions), fname, d.functions.name)) - fkwargs['function'] = None + fkwargs.update({'function': None, + 'halo': None, + 'padding': None}) # Data in MultiSubDimension function may not have been touched at this point, # in which case do not use an allocator, as there is nothing to allocate, and