You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function that appears in a ConditionalDimension, but not in the Operator input is not always beeing added to the parameters of the Operator. May need to run a few times to reproduce.
MFE:
import numpy as np
from devito import ConditionalDimension, Function, Eq, Operator, Dimension
from devito.types import Lt
shape = (8, 8)
x = Dimension(name='x')
y = Dimension(name='y')
g = Function(name='g', shape=shape, dimensions=(x, y), dtype=np.float32)
cond = Lt(g, 2)
ci = ConditionalDimension(name='ci', parent=y, condition=cond)
f = Function(name='f', shape=shape, dimensions=(x, ci))
eq1 = Eq(f, 5)
op = Operator([eq1])
print(op.ccode)
import pdb; pdb.set_trace()
op.apply()
Error log:
Traceback (most recent call last):
File "tests/mfe_args.py", line 23, in <module>
op.apply()
File "/home/gbisbas/workspace/devito/devito/operator/operator.py", line 655, in apply
args = self.arguments(**kwargs)
File "/home/gbisbas/workspace/devito/devito/operator/operator.py", line 537, in arguments
args = self._prepare_arguments(**kwargs)
File "/home/gbisbas/workspace/devito/devito/operator/operator.py", line 482, in _prepare_arguments
p._arg_check(args, self._dspace[p])
AttributeError: 'Symbol' object has no attribute '_arg_check'
try that, in a separate, self-contained PR, which includes patch + MFE. Thanks!
The text was updated successfully, but these errors were encountered:
georgebisbas
changed the title
A function that appears in a ConditionalDimension, but not in the Operator input is not always beeing added to the parameters of the Operator.
A function that appears in a ConditionalDimension, but not in the Operator input is not always being added to the parameters of the Operator.
May 19, 2020
A function that appears in a ConditionalDimension, but not in the Operator input is not always beeing added to the parameters of the Operator. May need to run a few times to reproduce.
MFE:
Error log:
Hook from @FabioLuporini :
I think I understand the issue above
we’re lacking a small piece of code that searches cd.condition
https://github.com/devitocodes/devito/blob/master/devito/ir/support/utils.py#L144
among candidates there could a ConditionalDimension. That must be searched inside its condition
actually we can make it even simpler a (lowered) expression knows its conditionals: https://github.com/devitocodes/devito/blob/master/devito/ir/equations/equation.py#L159
so I think we just need to extend the roots here https://github.com/devitocodes/devito/blob/master/devito/ir/support/utils.py#L131 with the conditionals (if any, clearly; as you know, very often there are none)
try that, in a separate, self-contained PR, which includes patch + MFE. Thanks!
The text was updated successfully, but these errors were encountered: