[Trilinos-Users] Tpetra_CrsMatrix, {replace, insert}LocalValues slow/overkill?

Nico Schlömer nico.schloemer at ua.ac.be
Thu May 20 06:45:33 MDT 2010

Hi all,

I have this nonlinear problem here for which I need to compute the
complex<double>-valued Jacobian in each Newton step. To store the data
of a Jacobian I use a Tpetra_CrsMatrix<complex<double> >, but to
actually make use of it, I have to transform the whole thing to an
Epetra system: Some packages I use just don't support Tpetra as well
yet. For transformation I use my own Komplex class which essentially
does the same as Trilinos::Komplex except that it digests

Anyway, I just profiled my code and I noticed that the bare filling
process of the Tpetra_CrsMatrix, i.e., all the

  if ( A_->isFillComplete() ) 
     A_->replaceLocalValues( localRow, columnIndices, values );
     A_->insertLocalValues( localRow, columnIndices, values );

calls take about 20% of the total calculation time which I find way too
much for the mere bookkeeping it's used for. I now wonder if there's any
smarter way to handle the situation.
Of course I could just abandon the whole Tpetra_CrsMatrix idea as a
whole, just store all (localRow, columnIndices, values) triples raw, and
feed those into the my Komplex constructor, but that feels somewhat



More information about the Trilinos-Users mailing list