Boost logo

Ublas :

Subject: Re: [ublas] profiling shows most time is consumed by indexing_matrix_assign
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2010-04-11 11:47:40

Also consider that you may need to define NDEBUG in your compilation options (i.e. -DNDEBUG), rather than defining it in your code, as if some ublas headers precedes it, it will have no effect (unless of course you make sure that it is indeed defined before any ublas header is included).


From: nasos_i_at_[hidden]
To: ublas_at_[hidden]
Date: Sat, 10 Apr 2010 20:31:49 -0400
Subject: Re: [ublas] profiling shows most time is consumed by indexing_matrix_assign

Hi Heikko,
did you check if you have nested products? (those may be hidden sometimes if you pass expressions around) Take a look at the very last item in

The indexing_matrix_assign is the main function that is called when you assign an expression to a matrix in ublas, so everything passes through that. And remember in ublas A+B (with A and B matrices) is an expression in ublas, not a matrix, it becomes a matrix when you assign it to something.

Also try to play with -DBOOST_UBLAS_MOVE_SEMANTICS ( and noalias() ( , to see if those help.

Best regards

> From: heiko_at_[hidden]
> To: ublas_at_[hidden]
> Date: Fri, 9 Apr 2010 18:20:41 +0200
> Subject: [ublas] profiling shows most time is consumed by indexing_matrix_assign
> Dear all,
> I have just recently begun to use uBLAS to do some numerics, solving a
> system of ordinary linear differential equations. The ODE solver
> repeatedly invokes a function that computes the right hand side of the
> ODE, and that contains almost the whole computational effort. In this
> function, I have about 8 matrix-matrix multiplications (with prod()) and
> about the same number of additions/subtractions of matrices or
> multiplications with a scalar. The involved matrices are dense with
> std::complex<double> entries and are of dimension 800x800.
> 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?
> Some additional information: I am using uBLAS 1.41.0 with NDEBUG set to
> 1.
> Any help is appreciated.
> Best regards,
> Heiko Schröder
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> Sent to: nasos_i_at_[hidden]
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail. Get busy.
The New Busy is not the old busy. Search, chat and e-mail from your inbox.