FFC

Comment 3 for bug 1153508

Revision history for this message
Johan Hake (johan-hake) wrote : Re: [Bug 1153508] [NEW] Strange results in JIT compilation

Are you sure this is a bug?

In the first example the Expression is generated without setting the
degree. If this is auto chosen to 2 it should make perfectly sense they
give the same results. Change degree to something else and you will have
a different results.

Johan

On 03/11/2013 10:06 AM, Marie Rognes wrote:
> Public bug reported:
>
> There seems to be something seriously wrong with either DOLFIN-FFC jit
> compilation or caching or instant.
>
> To reproduce, for instance consider the following code snippet and do
> the following
>
> (1): Run instant-clean
>
> (2): Run script unmodified.
>
> Output is:
>
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Solving linear system of size 1089 x 1089 (PETSc Krylov solver).
> 40.4757877531
>
> (3) Uncomment commented lines and run.
>
> Output is:
>
> Solving linear system of size 1089 x 1089 (PETSc Krylov solver).
> 40.4757877531
> Solving linear system of size 1089 x 1089 (PETSc Krylov solver).
> 40.4757877531 (*)
>
> (4) Run instant-clean, comment out lines defining f, g, and 1st print.
> Run.
>
> Output is
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Calling DOLFIN just-in-time (JIT) compiler, this may take some time.
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Calling FFC just-in-time (JIT) compiler, this may take some time.
> Solving linear system of size 1089 x 1089 (PETSc Krylov solver).
> 40.490263582 (**)
>
> Problem: The last two floats, tagged by (*) and (**), should be the
> same: they are not.
>
> Code snippet:
>
> --
>
>
> from dolfin import *
> mesh = UnitSquareMesh(16,16)
> V = FunctionSpace(mesh, 'CG', 2)
>
> f = Expression("x[0]*x[0] + 2*x[1]*x[1]")
> g = project(f, V)
> print g.vector().norm("l2")
>
> #f2 = Expression("x[0]*x[0] + 2*x[1]*x[1]", degree=2)
> #g2 = project(f2, V)
> #print g2.vector().norm("l2")
>
>
> --
>
> ** Affects: dolfin
> Importance: Undecided
> Status: New
>