[Trilinos-Users] 2x2 blocks: Epetra_CrsMatrix vs. Epetra_VbrMatrix vs. Epetra_*Matrix: fill time, scalability?

Nico Schlömer nico.schloemer at gmail.com
Thu Dec 8 11:31:35 MST 2011


Hi all,

I have this linear problem involving a 2x2-block matrix which I fill
and then solve. Luckily, I have a good preconditioner for the problem
which results in the matrix construction taking 50% of the runtime.
I'd like to improve this, tried this and that, but I'm running out of
ideas.

Basically, I loop over a set of FEM elements and insert for each edge
of the element a 4x4 submatrix, using

// fill v
TEUCHOS_ASSERT_EQUALITY( 0, myMatrix->SumIntoMyValues(
localRowIndices[0], 4, v, localColIndices ) );
// fill v
TEUCHOS_ASSERT_EQUALITY( 0, myMatrix->SumIntoMyValues(
localRowIndices[1], 4, v, localColIndices ) );
// fill v
TEUCHOS_ASSERT_EQUALITY( 0, myMatrix->SumIntoMyValues(
localRowIndices[2], 4, v, localColIndices ) );
// fill v
TEUCHOS_ASSERT_EQUALITY( 0, myMatrix->SumIntoMyValues(
localRowIndices[3], 4, v, localColIndices ) );

I've tried FECrsMatrix where those reduce to one single call, but I've
the four calls to be somewhat faster.

The matrix contains 2x2 blocks, so local{Row,Col}Indices always
contain subsequent indices (as in [24,25,56,57]). I thought about
using Epetra_VbrMatrix which would save me some tinkering with maps
and I imagine it would also help to reduce the load of the matrix
construction by filling in 2x2 blocks at once.
If I remember correctly, there could be performance (scalability?)
issues with Vbr_Matrices and small block sizes. Is that still true at
all?

Well, I'd be happy for any other suggestion.

Cheers,
Nico



More information about the Trilinos-Users mailing list