gmarkall/manycore_form_compiler — pull request #64 by gmarkall (2012-04-01 15:06:28+00:00)
Title: Generate kernels that conform to the OP2 iteration space specification

Summary of the changes:

* OP2 Matrix assembly kernels don't contain loops over the basis functions anymore - instead, the basis f
unction indices are passed as parameters after all the other parameters.
* OP2 Matrix assembly kernels don't contain statements to zero the local tensor.
* The loops over basis functions in the quadrature loop have been renamed. Instead of calling these indic
es i_r_*, they are now called q_r_* - this is because the scope of the basis function indices in the OP2
matrix assembly kernels is now the entire kernel, rather than being constrained to loops inside the kerne
l. Although the scoping rules would always have allowed the correct index value to be used, it seemed con
fusing to have the same index name in two scopes that were nested. The quadrature loop basis indices are
represented by the QuadratureBasisIndex class.
* Expected outputs updated to match the new code generation.
* Minor changes in the code generation backend to save generating expressions like `;` when NullExpressio
ns are part of the AST, a bugfix when unparsing pointers to arrays, and better feedback in the (now unused) `getScopeFromNest()` function. Note that NullExpressions aren't actually inserted into the AST in this
merge, although this was true at one point in some of the earlier commits to this branch.

These tests have passed on the devtests-grm08 queues on the buildbot. Additionally, I tried substituting
the mass kernel generated by MCFC into the mass2d example from Lawrence's OP2-Common repository. When com
piled against the sequential library, and executed with `$ ./mass2d_seq -mat_view`, the matrix produced i
s plausibly similar to the one produced by the original mass2d example, although there seems to be a diff
erence in the numbering of DOFs between Fluidity and the mass2d example. See:

https://github.com/gmarkall/OP2-Common/blob/f6422a0ff6953f4d4f7a570b245270122f59d975/apps/c/mass2d/mass.h

for the example that I tested with.