dealii/dealii — pull request #213 by kronbichler (2014-10-27 13:10:02+00:00)
Title: Combined add and inner product for vectors: add_and_dot

- As discussed on the developer's list, implemented a new method add_and_dot for all vector classes (deal.II's vectors,
block vectors, PETSc, Trilinos vectors)
- Specialized function for deal.II vector that does add_and_dot in one sweep over
the data by a new AddAndDot struct that is passed to the accumulate function. This
also extends the other structs for inner products and norms by one (unused) argument.
- New tests for this feature.
- Added new do_vectorized operation to all accumulation operations that uses the
operations of VectorizedArray for the sums. This helps to reduce the
operations and thus increase performance when memory transfer is not the limit.
This functionality is called in the regular part of the accumulate function which
now sits in its own method 'accumulate_regular' (length divisible by 32). This
functionality can unfortunately not be realized by the OPENMP_SIMD pragma recently
introduced because that leads to non-reproducible results when the vector memory
starts at different memory locations. VectorizedArray is only supported on some
platforms and thus this functionality may not be available everywhere. However, good
code will be generated unconditionally (except on old machines from around 2004-2008
where unaligned reads are slow, but those are not relevant any more).
- To implemented vectorized pow operations, I also added a std::pow function for
VectorizedArray.
- The memory for parallel::distributed::Vector is now allocated to 64 byte boundaries
just as is the memory of Vector.