dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #02303
Re: Dense matrices
On Fri, Mar 31, 2006 at 06:16:51PM +0200, Garth N. Wells wrote:
> On Fri, 2006-03-31 at 10:10 -0600, Robert C.Kirby wrote:
> > >
> > > The more I look at it, the more I like it.
> > >
> > > For the benchmarks I made, there was no optimisation (it was
> > > missing from dolfin-config --cflags). When using optimisation,
> > > uBlas outperforms the simple functions I wrote for inserting and
> > > retrieving values from an array. It also provides a LU solver
> > > (which I need to compute inverses of small matrices).
> > >
> > > It compiled fine with the Intel Linux compiler, and I'm testing it
> > > now under Cygwin.
> > >
> >
> > Can you install just ublas (without the boost build system), or do
> > you have to go through the whole boost build process?
> >
>
> There is no need build boost when using ublas.
>
> If you want to build uBlas, it does have it's own build system but there
> is also a configure script so you can do the usual ./configure, make
> install.
>
> Garth
It seems obvious we need something other than PETSc for dense linear
algebra and ublas seems to be a good option.
How do we make it fit into DOLFIN? There are some different options:
1. Wrap it as we do with most other stuff, so we would create
something like a class DenseMatrix that wraps a ublas dense matrix.
Then the question is how DenseMatrix interacts with the class Vector
which is a PETSc vector. Do we also need a DenseVector?
Should the assembly routines be able to accept a DenseMatrix etc?
2. Use a common interface for all linear algebra: Matrix and Vector
which can be PETSc or ublas or ... This is similar to what we had
before with our own implementations in SparseMatrix and DenseMatrix,
only now we would wrap PETSc and ublas instead. This might impose a
slight overhead in addressing entries.
We might remove the overhead with a template solution rather than the
class hierarchy (envelope-letter) we used before.
This way, we would also need to design a common interface for both
dense and sparse matrices. We could do this, but it would require some
thought to get it right. (Or we just go ahead and implement it and to
get something that works...)
There is a fairly new project called GLAS for Generic Linear Algebra
Software that aims at creating a C++ template library for linear
algebra with multiple backends. I don't think they have anything
useful yet but they seem to have a plan for handling multiple backends
while providing a common interface.
3. Just use ublas from within DOLFIN the way we use STL in some
places.
I'm very keen on keeping a simple user interface so in my ideal world
there is just one class Matrix and one class Vector (perhaps with
multiple backends).
/Anders
Follow ups
References
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-29
-
Re: Dense matrices
From: Anders Logg, 2006-03-29
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-29
-
Re: Dense matrices
From: Anders Logg, 2006-03-29
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-30
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31
-
Re: Dense matrices
From: Johan Jansson, 2006-03-31
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31
-
Re: Dense matrices
From: Robert C . Kirby, 2006-03-31
-
Re: Dense matrices
From: Garth N. Wells, 2006-03-31