Subject: Re: [ublas] profiling shows most time is consumed by indexing_matrix_assign
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2010-04-11 16:06:39
Am Friday 09 April 2010 schrieb Heiko Schroeder:
> The program, especially the evaluation of the rhs function, seems to
> be running fairly slow and profiling with gprof shows that the rhs
> evaluation takes 95%
> of the computation time. Deeper inspection shows that two
> versions of indexing_matrix_assign() account for almost all
> of the time needed. Now comes my question: Is this the expected
> behaviour for the described situation?
the prod() function is not always the best choice if you need best
possible performance. The function prod() is mostly for convenience.
There is a ongoing improvement, see
Alternatively you can try to use axpy_prod, block_prod or opb_prod in
order to have better results.
As David already explained: Most computations done by uBLAS are deferred
until the result is assigned to some target. Thus the various assign
method will always account for biggest part of CPU time. If you post
the corresponding lines of you gprof output (especially the children of
indexing_matrix_assign) then I can help to explain the results.
BTW: If you notice a considerable amount of time in find1(), find2() or
some operator(i,j) then we have to investigate the problem further.