[Trilinos-Users] VbrMatrix RAM usage

Andrea Zonca zonca at deepspace.ucsb.edu
Tue Mar 15 15:37:54 MDT 2011


thanks Alan,
your help is much appreciated,
it would be useful to add this in the documentation, even just a
suggestion to use VBR matrix just if blocks are bigger than some
number of elements.
after your message I reimplemented the code storing the 3 doubles in 3
CrsMatrices built on the same prebuilt CrsGraph, it works great,
cheers,
andrea

On Wed, Mar 9, 2011 at 16:17, Williams, Alan B <william at sandia.gov> wrote:
> Andrea,
>
> Sorry for the delay in getting back to you about this.
>
> The VbrMatrix storage format definitely incurs some storage overhead, as compared to the simple number of double-precision values being stored.
>
> In your program, you are storing 5,000,000 X 1 X 3 == 15 million doubles. With 8 bytes per double, that is 120 million bytes.
>
> The matrix class Epetra_VbrMatrix (which is the base class for Epetra_FEVbrMatrix) internally stores a Epetra_CrsGraph object, which represents the sparsity structure. This requires a couple of integers per block-row, and 1 integer per block-nonzero. (Your case has 5 million block-rows with 1 block-nonzero per row, so at least 15 million integers in total.)
>
> Additionally, the Epetra_VbrMatrix class stores a Epetra_SerialDenseMatrix object for each block-nonzero. This adds a couple of integers, plus a bool and a pointer, for each block-nonzero. In your case, since your block-nonzeros are small (1x3 doubles), this is a substantial overhead. The VbrMatrix format has proportionally less overhead the bigger your block-nonzeros are. But in your case, with 1x3 blocks, the VbrMatrix is indeed occupying several times more memory than is required for the 15million doubles.
>
> One final note: the VbrMatrix class has a method called OptimizeStorage which condenses storage somewhat, but I just noticed that it has a bug which will seg-fault in certain cases. I will commit a fix for the bug right away, which will be in the next release. If you want that bug-fix, let me know and I can send you the code snippet.
>
> Alan




More information about the Trilinos-Users mailing list