From ff9b7a8721c7e4378181dc52c9223a633c00008d Mon Sep 17 00:00:00 2001 From: Edward Caunt Date: Fri, 13 Sep 2024 14:51:45 +0100 Subject: [PATCH] compiler: Fix issue where untouched data would be petrified upon rebuilding --- devito/ir/equations/algorithms.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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