Integrating the compiler algorithms from uflacs into ffc for fast compilation of complicated forms

Registered by Martin Sandve Alnæs on 2012-11-20

It's a bit difficult to come up with a detailed plan for this up front because I will have to refine the interface while we're implementing. Below follows some coarse steps to follow.

1) Implement this blueprint:
I expect this alone to have a measurable impact on compilation time and memory use for complicated forms, but I'm not sure how big it is on its own. Done when: the SpatialDerivative class can be removed completely from ufl and performance of code generated by ffc is unchanged.

2) Compute geometry quantities: uflacs needs ffc to generate snippets for geometry and quadrature rules. The interface for this interaction is immature and needs to be designed iteratively with the implementation. Can probably be based directly on the UFC geometry header that Anders is working on. Done when: uflacs unit tests can assert correctness of compiled code for all ufl geometry quantities.

3) Add a uflacs representation mode to ffc, to live side by side with current representations at least for a while. This mode can delegate to the quadrature representation for generation of form/finite_element/dof_map, but the tabulate_tensor generation will be delegated to uflacs (for the time being, we can easily move that into ffc later if we want to). Done when: we can call ffc with uflacs mode and output forms which are complete except for tabulate_tensor.

4) Compute basis functions and their derivatives: uflacs needs ffc to generate snippets for computation of these. The interface for this interaction is immature and needs to be designed iteratively with the implementation. Done when: ffc in uflacs mode can compile working linear and bilinear forms with derivatives.

5) When the basics are working and ffc-uflacs gives correct results for all tests and demos, I'll need to do some tweaks and optimizations in uflacs algorithms. As it is, it probably generates slower code than Kristians quadrature code for "normal-sized" forms, but in the long term I don't think we need to maintain both modes. That's hard to predict though. Done when: not sure, have to define goal when we get to this stage.

Blueprint information

Martin Sandve Alnæs
Martin Sandve Alnæs
Martin Sandve Alnæs
Series goal:
Good progress
Milestone target:
Started by
Martin Sandve Alnæs


Current status is that many regression tests in ffc passes, but some fail to generate, some fail to compile, some fail to run, some produce incorrect output, and several features are not covered by the ffc regression tests.

However, this blueprint is getting stale, so I'm creating a more fine masked plan on the uflacs blueprint pages here:


Work Items

This blueprint contains Public information 
Everyone can see this information.


No subscribers.