Dear Kev,
To give an additional perspective on this topic: The assembly functions of deal.II (when using FEValues and the approach shown in step-1 to step-30 at least) are not optimized for performance also when compiled in release mode, but rather for readability. On an average case with linear or quadratic polynomials, I would expect a factor of 10 in performance gain by using one of the following approaches:
- You could express the three nested loop of a typical matrix
assembly routine as a dense matrix-matrix multiplication. This
requires you to rearrange some computations, especially when you
work with systems of equations, but the gain comes from the fact
that matrix-matrix multiplication is typically mapped to BLAS
functions, which are one of the most optimized algorithms in the
world (as LINPACK uses it as the dominating algorithm). The
step-65 tutorial program explains this for a symmetric problem,
but it is not hard to do for non-symmetric problems.
- You could express the code that computes the local matrix such
that FEEvaluation (from the matrix-free framework) can compute the
system matrix by applying the local operator to all unit vectors.
You could also go completely matrix-free in the sense of not
computing a matrix at all, but using more optimized strategies to
compute the local matrices and residuals could be a middle ground
when you don't want to fiddle with iterative solvers beyond
PETSc's (great) default choices. The matrix-free framework uses
computer hardware slightly less efficiently than BLAS-3, but it
can leverage the structure in shape functions and hence lower
complexity, often quite significantly.
Obviously, both the above options require some work, and lead to not-so-nice code. It depends on your use case if that is worth it. Of course, all the other suggestions, like not assembling the matrix in every step (possibly via SUNDIALS) or gathering precise timings to take the right action, should also be in your list of considerations.
Best,
Martin
--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
---
You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/5bb618cf-52ce-4871-944b-aeb56d1b4c50n%40googlegroups.com.