Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in expression factorization #110

Closed
wence- opened this issue Dec 6, 2016 · 3 comments
Closed

Failure in expression factorization #110

wence- opened this issue Dec 6, 2016 · 3 comments
Labels

Comments

@wence-
Copy link
Contributor

wence- commented Dec 6, 2016

This is boiled down from a problem in thetis_adjoint.

from coffee.factorizer import Factorizer

from coffee import base as ast

n1 = ast.Symbol("n1")
n2 = ast.Symbol("n2")
n3 = ast.Symbol("n3")
n4 = ast.Symbol("n4")
lvalue = ast.Div(ast.Sum(ast.Sum(n1, n1),
                         ast.Sum(n2, n2)),
                 n3)

stmt = ast.Incr(n4, lvalue)
fact = Factorizer(stmt)

fact.factorize(lambda x: False)
=>
Traceback (most recent call last):
  File "foo.py", line 16, in <module>
    fact.factorize(lambda x: False)
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/factorizer.py", line 237, in factorize
    self._factorize(node, parent)
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/factorizer.py", line 180, in _factorize
    self._factorize(n, node)
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/factorizer.py", line 211, in _factorize
    factor = [t.factors_ast] if t.factors else [Symbol(1.0)]
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/factorizer.py", line 60, in factors_ast
    return ast_make_expr(self.op, self.factors)
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/utils.py", line 185, in ast_make_expr
    return _ast_make_bal_expr(nodes)
  File "/data/lmitche1/src/firedrake/src/COFFEE/coffee/utils.py", line 180, in _ast_make_bal_expr
    _ast_make_bal_expr(nodes[half:]))
TypeError: 'NoneType' object is not callable
@wence-
Copy link
Contributor Author

wence- commented Dec 6, 2016

Bisect blames: 5fcd942

@wence-
Copy link
Contributor Author

wence- commented Dec 6, 2016

Even simpler:

from coffee.factorizer import Factorizer
from coffee import base as ast

n1 = ast.Symbol("n1")
n2 = ast.Symbol("n2")
lvalue = ast.Sum(n1, n1)

stmt = ast.Incr(n2, lvalue)
fact = Factorizer(stmt)

fact.factorize(lambda x: False)

@miklos1 miklos1 added the bug label Dec 8, 2016
tkarna added a commit to thetisproject/thetis that referenced this issue Dec 8, 2016
tkarna added a commit to thetisproject/thetis that referenced this issue Dec 8, 2016
tkarna added a commit to thetisproject/thetis that referenced this issue Dec 8, 2016
tkarna added a commit to thetisproject/thetis that referenced this issue Dec 9, 2016
@wence-
Copy link
Contributor Author

wence- commented Aug 3, 2017

Closing, since this part of the technology has moved to tsfc.

@wence- wence- closed this as completed Aug 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants