Boost logo

Ublas :

Subject: Re: [ublas] Performance woes affecting ublas
From: Karl Rupp (rupp_at_[hidden])
Date: 2010-05-19 05:04:58


Hi Rui,

I'm currently working on an OpenCL based C++ library for linear algebra
on GPUs, which is widely interface-compatible to ublas (more on this in
a couple of days in a separate thread). While all the vector and
dense-matrix benchmarks went fine, I discovered that sparse
matrix-vector products performed VERY badly (about a factor of 20
compared to plain C) in ublas.

However, I found the reason after some search on port 80: You have to
disable all debugging information by the preprocessor macro
#define NDEBUG
definded before any ublas-stuff is included. A quick 'grep NDEBUG *' in
your source directories did not give any results, therefore I suppose
that NDEBUG is not defined in your project.

I tried to compile your code to give you the numbers, but unfortunately
some upper/lowercase clashes in the Eigen/eigen folder prevented me from
doing so. However, I'm pretty sure you can handle this for yourself :-)

Best regards,
Karli

Rui Maciel wrote:
> (...)
> <run with solver>
> rui_at_kubuntu:benchmark$ make test
> ./test.sh
> Testing eigen...
> Building the FEM equation
> Solving the FEM equation
> Done.
>
> real 0m5.254s
> user 0m5.170s
> sys 0m0.060s
> Testing ublas...
> Building the FEM equation
> Solving the FEM equation
> Done.
>
> real 1m0.298s
> user 1m0.150s
> sys 0m0.140s
> </run>
>
> <run without solver>
> rui_at_kubuntu:benchmark$ make test
> ./test.sh
> Testing eigen...
> Building the FEM equation
> Solving the FEM equation
> Done.
>
> real 0m3.489s
> user 0m3.490s
> sys 0m0.000s
> Testing ublas...
> Building the FEM equation
> Solving the FEM equation
> Done.
>
> real 0m11.006s
> user 0m10.950s
> sys 0m0.030s
> </run>
>
> (...)
> So feel free to show how it is done and please do try to improve on the
> results, not through insults and absurd accusations.
>
>
> Rui Maciel
>
> [1]
> http://www.google.pt/search?q=site%3Ahttp%3A%2F%2Fwww.boost.org%2Fdoc%2Flibs%2F1_41_0%2Flibs%2Fnumeric%2Fublas%2Fdoc%2F+umfpack
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: rupp_at_[hidden]