Optimization work

64 views
Skip to first unread message

Juan Jose Garcia Ripoll

unread,
Dec 4, 2014, 11:29:03 AM12/4/14
to libt...@googlegroups.com
Hi,

I am working on the library, doing some optimizations. I summarize some of them:
  • Tensor::~Tensor(), operator+, operator-, and others are no longer automatically generated or extracted from templates. This means a single copy is created and this copy is called again and again. Not only does that save space, but things become faster.
  • RefPointer now specializes the case of a pointer to complex. The rationale is this one http://stackoverflow.com/questions/27290766/uninitialized-stdcomplex-constructor-when-using-new/27290879 and while it is a kludge, I found no better way without doing worse things (deriving our own complex type, etc).
  • operator+-*/ among tensor now only checks for matching total size, not matching dimensions. I have done this because this is a pattern that recurs quite often in our simulations, where we can save a few "reshape"s by using these arithmetic operators without reshaping tensors to match size.
  • There have been other bugs fixed thanks to Ulf.
I keep profiling the library with real-life code, to see what other places we can touch to get some performance improvements, but in one of the largest and most complex codes I have, I already reduced execution time by 50% and reach the limit of what the current library can do (most of the time is spent in MKL/BLAS/LAPACK anyway)

Juanjo

--
Instituto de Física Fundamental
Calle Serrano 113b, Madrid E-28006 Spain
http://quinfog.iff.csic.es
Reply all
Reply to author
Forward
0 new messages