Boost logo

Ublas :

From: James Sutherland (James.Sutherland_at_[hidden])
Date: 2008-01-22 16:58:47


I have run this using compressed_matrix and find that the application is
still 5x slower than my current implementation, which is not hand-tuned.

I am using the following flags with g++ 3.4.6
 -04 -fexpensive-optimizations -funroll-loops -DNDEBUG

Running gprof shows that
 ublas::vector_assign
consumes 40% of the execution time, while
 ublas::compressed_matrix::find2
consumes 35% of the total time.

My application performs many matvec operations, which is presumably
reflected in the vector_assign timing. Even at that, it is more than 3x
slower than the matvec kernel of the current sparse matrix package I am
using...

Is there any suggestion for performance increases? A factor of 5x slower is
not an option for my application, although I quite like the ublas package
otherwise...

James

On 1/19/08 1:48 AM, "Karl Meerbergen" <karl.meerbergen_at_[hidden]>
wrote:

> This is a known problem. Use compressed_matrix instead.
>
> Karl
>
>
> James Sutherland wrote:
>> All,
>>
>> I compiled an application using ublas with mapped_matrix<double>. I am
>> running an optimized build (with ­DNDEBUG), and I am finding very poor
>> performance on mapped_matrix.
>>
>> Running gprof shows that more than 50% of the execution time is spent in
>> std::_Rb_tree<unsigned long, std::pair<unsigned long const, double>,
>> std::_Select1st<std::pair<unsigned long const, double> >,
>> std::less<unsigned long>, std::allocator<std::pair<unsigned long
>> const, double> > >::lower_bound(unsigned long const&) const
>>
>> More than 30% of the execution time is spent in:
>> boost::numeric::ublas::mapped_matrix::find1
>>
>> And 6% of the execution time is spent in mapped_matrix::find2
>>
>> This application runs a lot of matvec operations, so that should be
>> the bottleneck. I have just migrated from another linear algebra
>> package that runs the same problem orders of magnitude faster.
>>
>> I suppose that the obvious question is if there is a more efficient
>> way to do sparse matrix operations?
>>
>> Thanks for any advice,
>>
>> James
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> ublas mailing list
>> ublas_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/ublas
>>
>
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas

-- 
James C. Sutherland, Asst. Professor, Dept. of Chemical Engineering
The University of Utah
50 S. Central Campus Dr, 3290 MEB
Salt Lake City, UT 84112-9203
Tel: (801) 585-1246
http://www.che.utah.edu/~sutherland