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

Nico Schlömer nico.schloemer at ua.ac.be
Thu May 20 12:03:15 MDT 2010


Alright, so it turns out this is really a compiler optimization problem.
Leaving the Trilinos installation itself untouched, I compiled my own
code with "-O1 -pg" instead of just "-pg" for profiling, at which point
GCC chooses "-O0" by default I think. Basically, this solves the
problem: The lion share of the computation time is then taken by dgemv_
and friends, and building the Jacobians takes about 1%; this is
perfectly acceptable.

Btw, "-O2 -pg" improves the runtime only very little, and "-O3 -pg"
results in (slightly) slower code.

Anyway, thanks for the hint, Mike!

Cheers,
Nico



On 05/20/2010 06:20 PM, Heroux, Michael A wrote:
> Nico,
>
> This is too much time in the fill.  What compiler and level of
> compiler optimization are you using?  Sometimes template expressions
> are not optimized fully, leading to these kinds of hotspots.
>
> Mike
>
>
> On 5/20/10 7:45 AM, "Nico Schlömer" <nico.schloemer at ua.ac.be> wrote:
>
>     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
>     Tpetra_CrsMatrices.
>
>     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 );
>       else
>          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
>     un-Trilinos-ish.
>
>     Comments?
>
>     Cheers,
>     Nico
>
>     _______________________________________________
>     Trilinos-Users mailing list
>     Trilinos-Users at software.sandia.gov
>     http://software.sandia.gov/mailman/listinfo/trilinos-users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20100520/682f4687/attachment.html 


More information about the Trilinos-Users mailing list