FFC

FFC returns ir, not oir, from _optimize_integral_ir

Bug #1121472 reported by Martin Sandve Alnæs
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
FFC
Fix Released
Low
Martin Sandve Alnæs

Bug Description

I'm looking at how to add a new representation, and this strikes me as a bug that should be resolved in one way or the other. Should oir = r.optimize_integral_ir(ir, ...) work in place on ir and return nothing, or should it return a new dict?

Revision history for this message
Martin Sandve Alnæs (martinal) wrote :

Ok, so both quadrature and tensor return the same dict they get in. I "fixed" the bug here by returning oir, but it is the same object as ir so there's no actual change.

And don't worry Anders, I'll wait for your final merge :)

Changed in ffc:
importance: Undecided → Low
status: New → Fix Committed
assignee: nobody → Martin Sandve Alnæs (martinal)
Revision history for this message
Anders Logg (logg) wrote : Re: [Bug 1121472] [NEW] FFC returns ir, not oir, from _optimize_integral_ir

On Sun, Feb 10, 2013 at 10:01:40PM -0000, Martin Sandve Alnæs wrote:
> Public bug reported:
> I'm looking at how to add a new representation, and this strikes me as a
> bug that should be resolved in one way or the other. Should oir =
> r.optimize_integral_ir(ir, ...) work in place on ir and return nothing,
> or should it return a new dict?
> ** Affects: ffc
> Importance: Undecided
> Status: New

The code generation stage should be able to work with either of the
two. If no optimization is used, then ir can be passed directly to the
code generation. In the case optimization is used, ir is replaced by
oir.

Note that both the representation and generation stages are specific
to the code generation strategy (also called "representation" just to
confuse things...). So the code generation for quadrature gets back
the ir (or oir) it has itself computed in an earlier stage.

ir (and oir) should contain all (meta)data that the code generation
will later use to generate C++ code.

So the ir dictionary can contain

  "value_rank": 3

which the code generation stage uses to generate

  "return 3;"

which then gets pasted into the UFC template.

--
Anders

Johannes Ring (johannr)
Changed in ffc:
milestone: none → 1.2.0
Johannes Ring (johannr)
Changed in ffc:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.