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

COFFEE does not sum factorise #101

Closed
miklos1 opened this issue Oct 25, 2016 · 1 comment · Fixed by #104
Closed

COFFEE does not sum factorise #101

miklos1 opened this issue Oct 25, 2016 · 1 comment · Fixed by #104
Assignees
Labels

Comments

@miklos1
Copy link
Contributor

miklos1 commented Oct 25, 2016

FInAT master, firedrakeproject/tsfc@2fac97b (finat-coffee-patch branch), running this snippet:

from ufl import *
from tsfc import compile_form

cell = TensorProductCell(interval, interval)
mesh = Mesh(VectorElement('Q', cell, 1))

f = Coefficient(FunctionSpace(mesh, FiniteElement('Q', cell, 7)))
v = TestFunction(FunctionSpace(mesh, FiniteElement('Q', cell, 7)))

kernel, = compile_form(f*v*dx)

from coffee import O2
from coffee.plan import ASTKernel

knl = ASTKernel(kernel.ast)
knl.plan_cpu(O2)
print knl.gencode()

Standard error:

Multiple free indices in FlexiblyIndexed: might break COFFEE.
COFFEE finished in 0.0205209 seconds (flops: 19104 -> 19104)

Standard output.

The multiple free indices complaint is for the coefficient evaluation which is prefactorised by TSFC. For the argument, I reverted the kernel interface on this branch, and fixed the attachment of linear loops pragmas. Yet COFFEE does nothing.

@FabioLuporini: can you have a look at this example, and tell whether:

  1. there is a problem with the generated AST and something needs to be generated differently; or
  2. COFFEE needs some minor fix in analysis etc. to recognise this; or
  3. Luporini et al. (2016) does not cover the sum factorisation problem?

Just in case it is unclear, here's what the sum factorised version is supposed to look like. If the answer happens to be 3, don't bother wasting too much doing sum factorisation in COFFEE, there is a fairly easy way to do it in TSFC, although that requires argument factorisation. (Fortunately, unlike UFLACS, we will be able to turn that off at least. But it would be nice to have an automatic/optimal logic that gives the best combination of sum factorisation and COFFEE.)

@FabioLuporini
Copy link
Contributor

No, this should just work. I will take a look shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants