ffc team mailing list archive
-
ffc team
-
Mailing list archive
-
Message #01778
Re: [HG FFC] Added code to output number of operations needed to compute the element tensor (for quadrature representation).
Quoting Anders Logg <logg@xxxxxxxxx>:
> On Sat, Sep 06, 2008 at 11:12:17PM +0200, Kristian Oelgaard wrote:
> > Quoting Anders Logg <logg@xxxxxxxxx>:
> >
> > > On Sat, Sep 06, 2008 at 09:23:39PM +0100, Garth N. Wells wrote:
> > > > FFC wrote:
> > > > > One or more new changesets pushed to the primary ffc repository.
> > > > > A short summary of the last three changesets is included below.
> > > > >
> > > > > changeset: 1191:4129f43a04429e70de6383212ace548ca0fb7872
> > > > > tag: tip
> > > > > user: "Kristian Oelgaard <k.b.oelgaard@xxxxxxxxxx>"
> > > > > date: Sat Sep 06 21:31:23 2008 +0200
> > > > > files:
> > > src/ffc/compiler/codegeneration/quadrature/quadraturegenerator.py
> > > > > description:
> > > > > Added code to output number of operations needed to compute the
> element
> > > tensor (for quadrature representation).
> > > > >
> > > >
> > > > Is this the number of flops inside the tabulate_tensor function, or is
>
> > > > it related to FFC operations?
> >
> > It is a count of all '*' and '+' operations on the RHS of all terms inside
> the
> > IP loop. So it's an approximation of the number of flops needed to tabulate
> the
> > element tensor. Anything that goes on before this loop is not taken into
> > account, but for complex forms this is insignificant anyway.
> >
> > > > Garth
> > >
> > > This should be fairly easy to add for the tensor representation as
> > > well, at least the number of flops to do the tensor contraction, so
> > > we can use this to decide which representation to use.
> >
> > But you want to decide this before generating the code? Or do you suggest
> > compiling the code with both strategies and see which one produces the
> 'optimal'
> > code?
> >
> > > We may then set the default representation to "auto" which chooses
> > > the correct strategy.
> >
> > For this you definitely want some a priori estimation of the operation
> count.
>
> Yes, I mean before the code is generated. Is that possible to get?
Now, I just count the number of operators in every RHS expression before adding
the block of code, so it's fairly accurate. This happens while generating the
code i.e. after computing the representation which is different (and can be
quite time consuming) for quadrature and tensor representation. If we want to do
this we should do it right after simplifying the form, and it could only be a
guess that would depend on index ranges, number of non-zeros in basisfunctions etc.
Kristian
> --
> Anders
>
References