diff --git a/devito/ir/equations/algorithms.py b/devito/ir/equations/algorithms.py index 818f307101..fa44b99696 100644 --- a/devito/ir/equations/algorithms.py +++ b/devito/ir/equations/algorithms.py @@ -279,11 +279,16 @@ def _(d, mapper, rebuilt, sregistry): functions = rebuilt[d.functions] except KeyError: fkwargs.update({'name': sregistry.make_name(prefix=d.functions.name), - 'function': None, - 'allocator': DataReference(d.functions._data)}) + 'function': 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 + # doing so will petrify the `_data` attribute as None. + if d.functions._data is not None: + fkwargs.update({'allocator': DataReference(d.functions._data)}) rebuilt[d.functions] = functions = d.functions._rebuild(**fkwargs) kwargs['functions'] = functions - mapper[d] = d._rebuild(**kwargs) + mapper[d] = d._rebuild(**kwargs) \ No newline at end of file