libMesh/libmesh — pull request #198 by friedmud (2014-02-05 23:41:17+00:00)
Title: Assembly Optimizations

I've started taking a look at assembly optimization... and these are the first two changes I've implemented in order to speed things up. I have been specifically looking at using BLAS-like things to compute variable values/gradients/etc.

The first change is just to cache some data we get back from PETSc to speed things up.

The second one splits DofMap::dof_indices() into two functions... one for the case where you want all of the dof_indices and one for the case that you only want them for one variable.

I have an assembly benchmarking script here: https://gist.github.com/friedmud/8835594

And you can see the results of that script as I have been modifying the code here: https://docs.google.com/spreadsheet/ccc?key=0AlYTFvojHetudFVYTU9zN3N6RTFNajZvaXdlSmx0TUE&usp=sharing

In that spreadsheet the "libMesh way" is the way it is in the examples (where you get the variable's dof value using solution(dof_indices[l]) over and over.

"get dof values once" refers to getting the value outside of the loop and then using it a bunch (this is what we currently do in MOOSE).

"split dof indices" is referring to the second patch in this pull request.

"var_of_same_type" is referring to an experiment patch I've created here: e1b09f62fc That patch allows you to get the dof_indices for multiple variables that are all of the same type at the same time.... saving a significant amount of overhead when you have lots of variables. I'm not ready to put that into libMesh yet, but you can see what I've done there

"Eigen" refers to using matrix*matrix multiplication to compute all of the variable values and gradients at the same time in one call (see the assembly_bench.C code for more info)