Subject: [FFC-dev] [HG FFC] Added code to output number of operations needed to compute the element tensor (for quadrature representation).

From: [email-masked] (FFC)
Date: Sat, 6 Sep 2008 21:31:55 +0200 (CEST)

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 <[email-masked]>"
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).

changeset:   1190:92c2bd57a74ad1b9b37c94adcd48a0383ab92cfa
user:        "Kristian Oelgaard <[email-masked]>"
date:        Sat Sep 06 20:58:36 2008 +0200
files:       AUTHORS ChangeLog README TODO
description:
Added UFC as dependency in README. Update ChangeLog and TODO (arguments language and representation added to options dictionary).

changeset:   1189:5fb1e4531ebbd0a7a9b49163ef85c07a69f3f045
user:        "Garth N. Wells <[email-masked]>"
date:        Sat Sep 06 17:59:30 2008 +0100
files:       TODO
description:
Update TODO list.

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

---

From: "Garth N. Wells" <[email-masked]>
Date: Sat, 06 Sep 2008 21:23:39 +0100

> 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?

Garth

> _______________________________________________
> FFC-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/ffc-dev

---

From: Anders Logg <[email-masked]>
Date: Sat, 6 Sep 2008 22:46:15 +0200

> it related to FFC operations?

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.

We may then set the default representation to "auto" which chooses
the correct strategy.

-- 
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Sat, 06 Sep 2008 23:12:17 +0200

Quoting Anders Logg <[email-masked]>:

> > > files:      
> src/ffc/compiler/codegeneration/quadrature/quadraturegenerator.py
> > > description:

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.
 
> 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

For this you definitely want some a priori estimation of the operation count.

Kristian

> > > Added UFC as dependency in README. Update ChangeLog and TODO (arguments
> language and representation added to options dictionary).
> > > 
> > >

---

From: Anders Logg <[email-masked]>
Date: Sat, 6 Sep 2008 23:20:13 +0200

> 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?

-- 
Anders

---

From: Kristian Oelgaard <[email-masked]>
Date: Sat, 06 Sep 2008 23:48:04 +0200

Quoting Anders Logg <[email-masked]>:

> > > > > Added code to output number of operations needed to compute the
> element
> > > tensor (for quadrature representation).
> > > > >
> > > > 

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