On Mon, Jan 4, 2016 at 8:58 PM, Tim Adowski <trado...@buffalo.edu> wrote:

> Hello libMesh-devel:
>
> Using the START_LOG/STOP_LOG macros to time the QP loop, I got the
> following results for the 1D shape function implementation:
> Original: 1028ms (average)
> Modified with Fe loop vectorized: 920ms (average)
> Difference: ~10%
> So there is a significant speedup to be gained by switching up the shape
> function implementation, even with only one of the loops vectorized.
>

Do you still see a 10% speedup in the Fe loop with a much larger (say
1000x) problem?  I'm not sure if I put much stock in a 10% speedup over a
total time of 1 second... and since this number is being quoted throughout
the rest of the thread, I'd like to know if it's actually statistically
significant.




> Moving forward, it would seem that refactoring the shape function
> implementation would yield cleaner code.
> For example, fe_base calls vector.resize() many times in order to fully
> initialize the 2D vector. However, with the new class, these calls are
> unnecessary since for the 1D vector, vector.resize() only needs to be
> called once from within the class.
> A cleaner and more meaningful interface would be to have a constructor
> that takes the initial row and column sizes as arguments and handles all
> the allocation within the class itself. The class.resize() function could
> then be used only when the shape function vector changes size, making it
> more semantically meaningful.
> The [][] operator could also be replaced with parentheses (i,j) or a
> get_val(i,j) function, since the code to implement the double brackets adds
> quite a bit of complexity to the class.
>

I wonder if you would have more luck doing your vectorization within
FEMSystem rather than on "old style" codes like ex3?  In FEMSystem, the
framework has more control over the loops, iteration counters, and variable
storage, so it might be easier for end-user code to take advantage of these
optimizations.

-- 
John
------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to