← Back to team overview

dolfin team mailing list archive

Re: Dense matrices

 

On Thu, 2006-03-30 at 21:51 +0200, Garth N. Wells wrote:
> I've done some benchmarking for various ways to set the values by index
> and to retrieve them by index in a small matrices. With the way we
> currently use PETSc, it's about 500-600 times slower for insertion that
> any other technique (this is for dense PETSc matrices). This is due to
> the calls 
> 
>   MatAssemblyBegin(A, MAT_FINAL_ASSEMBLY);
>   MatAssemblyEnd(A, MAT_FINAL_ASSEMBLY); 
> 
> after inserting each value each value.
> 
> For a full 6x6 matrix which is assembled 1e7 times, the normalised
> timings were
> 
> PETSc*:                   25
> Boost multi_array class:  8
> Boost ublas::matrix:      1.7
> std::vector based matrix: 4.8
> standard array:           1
> 

Small correction:
Blitz++: 1.7
ublas:   1.95

ublas (http://www.boost.org/libs/numeric/ublas/doc/index.htm) looks
really nice and provides everything I would like to have for a dense
matrix. It's a template library, we don't have to worry about linking to
it. If we use it, we could avoid a dependency by including the header
files in DOLFIN somewhere, something like dolfin/contrib?

Garth


> *with MatAssemblyBegin(..) and MatAssemblyEnd(..) called only after the
> insertion of all 6x6 terms. 
> 
> The timings for retrieving values are similar. Based on this, I think a
> simplified version of the old DenseMatrix class would be best (at least
> for my applications). If we're willing to accept a boost dependency,
> uBlas is very nice.  
> 
> Garth
> 
> > /Anders
> > 
> > _______________________________________________
> > DOLFIN-dev mailing list
> > DOLFIN-dev@xxxxxxxxxx
> > http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
> 
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev
-- 
Dr. Garth N. Wells
Faculty of Civil Engineering and Geosciences
Delft University of Technology
Stevinweg 1
2628 CN Delft
The Netherlands

tel.     +31 15 278 7922
fax.     +31 15 278 6383
e-mail   g.n.wells@xxxxxxxxxx
url      http://www.mechanics.citg.tudelft.nl/~garth




Follow ups

References