Subject: [FFC-dev] [HG FFC] Added option 'compiler' to FFC_OPTIONS, default is ffc. The JIT compiler uses this to determine if the standard FFC compiler or the UFL compiler should be used.

From: [email-masked] (FFC)
Date: Tue, 24 Feb 2009 15:33:36 +0100 (CET)

One or more new changesets pushed to the primary ffc repository.
A short summary of the last three changesets is included below.

changeset:   1328:83a16cff359ac9faf01d3af927e8d88a6005663e
tag:         tip
user:        "Kristian Oelgaard <[email-masked]>"
date:        Tue Feb 24 15:33:18 2009 +0100
files:       ffc/common/constants.py ffc/jit/jit.py ffc/jit/jitobject.py test/verify_tensors/test.py
description:
Added option 'compiler' to FFC_OPTIONS, default is ffc. The JIT compiler uses this to determine if the standard FFC compiler or the UFL compiler should be used.

changeset:   1327:4290605594500e5fbe61f7c57b0be4bf1c7f171b
user:        "Kristian Oelgaard <[email-masked]>"
date:        Tue Feb 24 11:30:14 2009 +0100
files:       ffc/compiler/codegeneration/quadrature/__init__.py ffc/compiler/codegeneration/quadrature/uflquadraturegenerator.py ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py ffc/compiler/representation/quadrature/uflquadraturerepresentation.py ffc/compiler/uflcompiler.py
description:
UFL quadrature representation seems to work for quite a few forms (cell integrals). Needs testing.

changeset:   1326:4929bd79f67f32b1b9abf9dbfd96c122d01d67f0
user:        Anders Logg <[email-masked]>
date:        Fri Feb 20 10:26:30 2009 +0100
files:       ffc/compiler/uflcompiler.py
description:
Testing monomial extraction in uflcompiler.py

----------------------------------------------------------------------
For more details, visit http://www.fenics.org/hg/ffc

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 24 Feb 2009 15:37:31 +0100

Quoting FFC <[email-masked]>:

> Added option 'compiler' to FFC_OPTIONS, default is ffc. The JIT compiler uses
> this to determine if the standard FFC compiler or the UFL compiler should be
> used.

I ran all tests in DOLFIN and nothing seems to be broken. I fixed this by
calling jit_object.signature() (to generate jit_object.form_data) BEFORE
checking cache. If this is somehow unsafe, we need to come up with a different
approach. I just think that it will introduce a small overhead?

Kristian

> files:       ffc/compiler/codegeneration/quadrature/__init__.py
> ffc/compiler/codegeneration/quadrature/uflquadraturegenerator.py
> ffc/compiler/codegeneration/quadrature/uflquadraturegenerator_utils.py
> ffc/compiler/representation/quadrature/uflquadraturerepresentation.py
> ffc/compiler/uflcompiler.py
> description:
> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev
>

---

From: Anders Logg <[email-masked]>
Date: Tue, 24 Feb 2009 17:04:50 +0100

> approach. I just think that it will introduce a small overhead?

This was the problem I ran into when trying to fix the bug in jit.py
before release. I couldn't figure out how to solve it without doing as
you say, namely to generate the signature before checking the cache.

But this should be avoided. Computing the signature may actually take
some time. There are two levels of cache (although I don't know the
details of this now that it has moved into Instant): one in-memory
cache and one disk cache. The in-memory cache does not require the
signature, it just looks at the id() of the form which is faster
than computing and comparing signatures.

Why is this change needed for compilation of UFL forms?

-- 
Anders

---

From: Anders Logg <[email-masked]>
Date: Tue, 24 Feb 2009 17:24:40 +0100

> Why is this change needed for compilation of UFL forms?

I've added a unit test for checking the speed of the JIT compiler and
it breaks now after the change to jit.py.

Before change:

  JIT in-memory cache: 0.000190019607544
  JIT disk cache:      0.028265953064

After change:

  JIT in-memory cache: 0.0181729793549
  JIT disk cache:      0.0284857749939

-- 
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Tue, 24 Feb 2009 17:28:07 +0100

> Why is this change needed for compilation of UFL forms?

I just need to tell JIT that it should use uflcompiler.py for *.ufl forms and
compiler.py for *.form forms.

a = dot(grad(V), grad(U))*dx
is a *.form form

a = inner(grad(V), grad(U))*dx
is a *.ufl form

otherwise JIT will just use compiler.py which cannot compile the second form.

Kristian

---

From: Anders Logg <[email-masked]>
Date: Tue, 24 Feb 2009 17:33:20 +0100

> otherwise JIT will just use compiler.py which cannot compile the second form.

I still don't see why the signature change is needed. Isn't a simple
if-case enough to choose between the two compilers?

-- 
Anders