[petsc-users] [dev at libelemental.org] Re: The product of two MPIDENSE matrices

Jack Poulson poulson at stanford.edu
Tue Oct 1 17:15:23 CDT 2013


On 10/01/2013 03:04 PM, S V N Vishwanathan wrote:
> Hi
> 
>>> I am wondering whether I can multiply MATELEMENTAL and MATAIJ
>>> matrices. If I cannot multiply those, could you build the
>>> multiplication?
>>
>> What are the dimensions of the matrices?
>>
>> Jack, does Clique support multiplication of sparse matrices with
>> [MC,MR] dense matrices?
> 
> The dense matrix is very flat and long (e.g. 10 x few 1000s) and the
> sparse matrix is also flat and very very long (e.g. few 1000s x few
> millions). I saw the code which is used to multiply a MPIAIJ matrix with
> a dense matrix. We need something very similar, but which uses elemental
> matrices. 
> 

I haven't yet dedicated much time to the sparse matrix-vector
multiplication (my focus has been on the sparse-direct factorizations
and triangular solves), but there *is* a routine for forming

  Y := alpha A X + Y,

where A is a distributed sparse matrix, and Y has each column
identically distributed over the entire team of processes. This is ideal
for when Y consists of a few hundred or less vectors.

You seem to be describing a multiplication of the form

D2 := D1 S,

where D1 and D2 are very short dense matrices, and S is sparse. If you
set A := S', X := D1', and D2 := Y', then your use case is appropriate
for the above scheme. The implementation (and prototype) is here:

https://github.com/poulson/Clique/blob/11cdd5cf95a572a5289375873cb2a20d2d141810/include/clique/numeric/multiply.hpp#L16

Jack


More information about the petsc-users mailing list