JIT compilation fails and succeeds erratically
JIT compilation of the attached script fails on the first run (after instant-clean), but seems to succeed and produce the correct result on the second run. It should succeed on the first run and it seems bizarre that it succeeds on the second run.
Reproduce with:
instant-clean python measures.py python measures.py
Note that if a and b are compiled (and A and B are computed) separately, all seems well.
This might be an instant (or UFL or FFC) issue rather than a DOLFIN issue.
Comments (5)
-
-
By creating a new constant for the second form, it works in the first run.
-
By changing the second form to I**2 instead of I, it works on the first run.
By next changing the first form to I**2 instead of I, it fails again on the first run.
By skipping the first form it succeeds.
Is something being cached in ffc or fiat?
-
Here's the culprit in ffc/tensor/monomialextraction.py:
# Check cache if integrand in _cache: debug("Reusing monomial integrand from cache") return _cache[integrand]
I'll disable this cache to fix this issue, but also to fix a memory leak: This cache will keep references to all functions throughout the entire lifetime of the process. The functions reference function spaces including dof maps and meshes.
-
- changed status to resolved
Fixed.
- Log in to comment
I get this error in FIAT in the first run, and the second run succeeds: