Hey, On 12:34 Sun 16 Oct , Oswin Krause wrote:
I gave a real use-case in a slightly more complicated setting. We had to face the problem of "how can we align data in a way that we can unify a set of slow matrix-vector multiplications into one fast matrix-matrix multiplication". We usually have to traverse the same dataset several 100-1000 times in order to do our computations, so some overhead in the data setup phase (e.g. cost of insertion) is okay and we would sacrifice even more performance in that phase if we got in return more performance in the following three days of computations. Having said that, I agree that just reordering does not give much in many cases. But the real gain is given when data can be aligned better or used more independently. e.g. if the struct contains a std::vector or std::string we can gain a lot by using a data structure which stores the contents of the vectors consecutively, thus removing one level of indirection.
Note that this pattern is also common in game industry, where objects are made up of data structures which are used in (nearly) independent parts of the game and where data has to be copied to and from the gpu.
Could you give a pseudo code description of what typical operations you're running? In your fist mail you mentioned that you also have some sparse matrices. I find this interesting because we've implemented some improved containers for sparse matrices and SpMVM (sparse matrix vector multiplication). Those are written for our simulation codes and now I'm curious if they could be reused in other settings. Cheers -Andreas -- ========================================================== Andreas Schäfer HPC and Supercomputing Institute for Multiscale Simulation Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany +49 9131 85-20866 PGP/GPG key via keyserver http://www.libgeodecomp.org ========================================================== (\___/) (+'.'+) (")_(") This is Bunny. Copy and paste Bunny into your signature to help him gain world domination!