← Back to team overview

dolfin team mailing list archive

Re: jit signature

 

On Thu, May 26, 2011 at 04:20:20PM +0200, Martin Sandve Alnæs wrote:
> On 26 May 2011 15:40, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Thu, May 26, 2011 at 03:10:54PM +0200, Martin Sandve Alnæs wrote:
> >> On 26 May 2011 14:46, Anders Logg <logg@xxxxxxxxx> wrote:
> >> > On Thu, May 26, 2011 at 12:44:56PM +0200, Martin Sandve Alnæs wrote:
> >> >> On 26 May 2011 12:36, Anders Logg <logg@xxxxxxxxx> wrote:
> >> >> > On Thu, May 26, 2011 at 12:12:22PM +0200, Martin Sandve Alnæs wrote:
> >> >> >> What is the prefix in this line?
> >> >> >>
> >> >> >>             (self._compiled_form, module, self.form_data, prefix) = \
> >> >> >>                 jit(form,
> >> >> >>                     form_compiler_parameters,
> >> >> >>                     common_cell)
> >> >> >
> >> >> > It's the prefix used by the JIT compiler for the generated code files.
> >> >> > For FFC, it is set to
> >> >> >
> >> >> >  prefix = "ffc_form_" + jit_object.signature()
> >> >>
> >> >> Why is it returned from jit? What is it used for?
> >> >
> >> > It is used in the FFC JIT compiler for elements. This relies on
> >> > creating the simplest possible form and then extracting the element
> >> > from it. It wasn't needed before, but turned out to be very useful
> >> > (perhaps even necessary) during the recent redesign of the JIT
> >> > compiler we went through with the preprocess/caching issues.
> >>
> >> If it's only used internally in ffc, why is it part of the official
> >> jit interface?
> >
> > Just for convenience. Is it a problem to include it?
>
> Nah. It's just weird with random arguments that have no
> definition and no use. Now I just return an arbitrary string,
> but ffc could just have handled this internally instead of
> changing the interface:
>
> def myjit(...):
>     return a, b, c, d
>
> def jit(...):
>     a, b, c, d = myjit(...)
>     return a, b, c

I think you are right, I'll remove the prefix argument. And I also
need to remove it from the book where I added it yesterday...

--
Anders


References