pybind11 JIT does not pass representation to FFC
This code unexpectedly passes
import dijitso
dijitso.set_log_level('debug')
from dolfin import *
parameters['form_compiler']['representation'] = 'FORTRAN66'
mesh = UnitSquareMesh(3, 3)
assemble(1*dx(mesh))
and investigation of the generated code shows that uflacs
has been used instead of FORTRAN66
.
This is a critical bug, because representation fixtures in unit tests do not work.
Comments (10)
-
-
reporter No. That's too early. This code fails with SWIG
from dolfin import * mesh = UnitSquareMesh(3, 3) A = 1*dx(mesh) parameters['form_compiler']['representation'] = 'FORTRAN66' assemble(A)
Please, let's try to avoid regressions from SWIG DOLFIN. This is important for user codes.
-
reporter I believe that global parameters are sent to FFC jit compiler in any case, without tampering the form. It's up to FFC to decide what to do with the UFL object (element or form) and (global) parameters.
-
reporter # Prepare form compiler parameters with overrides from dolfin and kwargs p = ffc_default_parameters() p.update(parameters["form_compiler"]) p.update(form_compiler_parameters or {}) # Execute! try: result = ffc.jit(ufl_object, parameters=p)
-
These lines (or similar) are needed before JIT. @garth-wells was working on the Parameter system - I am not sure it is quite working for this use case yet. @blechta - sure, let's iron out all regressions before 2018 release.
# Prepare form compiler parameters with overrides from dolfin and kwargs p = ffc_default_parameters() p.update(parameters["form_compiler"]) p.update(form_compiler_parameters or {})
-
snap
-
reporter -
assigned issue to
-
assigned issue to
-
I think this is now fixed in master. @blechta - can you verify?
-
reporter Yes, looks fixed. Thank you
-
reporter - changed status to resolved
- Log in to comment
I'm not sure where is the right place to inject the global parameters.
but that does what you want. Where should it be set? In
Form
, if it getsNone
asform_compiler_parameters
?