Re: OON: C := A*B, where A and B are sparse and memory-distributed ?

From: Matthias Troyer (troyer@itp.phys.ethz.ch)
Date: Thu Feb 01 2001 - 06:29:25 EST


Pierre Saramito wrote:
>
> Dear Colleagues,
>
> I am looking for a library, if exists, or, at least an
> algorithm, that performs :
>
> C := A*B
>
> where A and B are sparse, memory-distributed (e.g. MPI, as
> in PETSc).
>
> When A and B are obtained from the discretization
> of Partial Differential Equations, these matrices are very sparses
> and the A*B CPU-cost is linear with the matrix sizes for an
> efficient implementation (see e.g. sparskit).
>
> I am looking for such an efficient implementation/algorithm
> in the memory-distributed case. Any suggestion is wellcome.

If A and B are sparse it will usually happen that A*B is much less
sparse than either A or B. In our problems in quantum mechanics
we often encounter cases where a product of a number of
matrices is actually dense, while the individual matrices are very
sparse.

Thus my question: is it really necessary to store the product
C, or can't you just use A*(B*v) whenever you want to multiply
the matrix C with a vector v? A simple estimate shows why this
might be preferable: if each row of the NxN matrizes A and B contains
n nonzero elements, the product A*B will in general contain n*n
nonzero elements per row. Thus the effort of multiplying
C*v will be about N*n^2, while the effort of first calculating the
product w=B*v and then A*w will be less, nameley 2*N*n .

Matthias Troyer

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:14 EST