_attach_integral_metadata modifies input form and changes jit signature of subsequent recompilation

Issue #76 resolved
Martin Sandve Alnæs created an issue

It should rather reconstruct the integrals with new metadata.

The resulting spurious jit compilation is annoying but not critical.

Reproducing script with diagnostics:

from dolfin import *

mesh = UnitSquareMesh(1, 1)
V = FunctionSpace(mesh, 'CG', 3)
f = Function(V)
M = f*dx(degree=1)

from ffc.jitcompiler import _check_parameters
from ffc.jitobject import JITObject

before = dict(M.integrals()[0].metadata())
assemble(M) # Bug: Modifies M as side effect
after = M.integrals()[0].metadata()

# Symptom:
print before
print after
print before is after
assert before == after # Fails, and this causes spurious jit recompilation

Comments (8)

  1. Martin Sandve Alnæs reporter

    I don't think I have time before 1.6, so considering this won't affect most users and does not change the computed result I'll post phone to 1.7.

  2. Log in to comment