← Back to team overview

ufl team mailing list archive

JIT compilation

 

The FFC JIT compiler (and any other JIT compiler that DOLFIN uses)
must be able to return FormData as well as the compiled form. DOLFIN
uses this to extract coefficients and elements.

Without caching, the JIT compiler gets the form, generates form data,
generates the C++ code which is sent to Instant. Instant then returns
the compiled form and the JIT compiler returns the form + form data to
DOLFIN.

With caching, the JIT compiler gets the form, sends it to Instant (or
rather a wrapper that returns an appropriate hash and signature). Then
Instant returns the compiled form. This means that the form data is
missing.

FFC solves this by attaching the form data to the form:

  form.form_data = form_data

This way, the form data is available both when the in-memory cache is
used and when the disk cache is used. In the first case, the form has
been JIT compiled before so the object has form_data attached to
it. In the second case, the signature needs to be computed which means
that also the form data will be computed.

Would it be possible/desirable to attach form data to a UFL form? Or
will it be necessary to keep a separate form data cache in the JIT
compiler. It sort of makes the in-memory cache of Instant pointless
(for form compilation) since the JIT compiler might then as well cache
the compiled form (as it did before this was added to Instant).

-- 
Anders

Attachment: signature.asc
Description: Digital signature


Follow ups