[Trilinos-Users] [EXTERNAL] Tpetra::CrsMatrix caching related to C= A^T B and D = A*C

Denis Davydov davydden at gmail.com
Mon Sep 10 11:06:30 EDT 2018


Thanks for the prompt reply, I will give it a try.

Denis.

> On 10 Sep 2018, at 16:59, Siefert, Christopher <csiefer at sandia.gov> wrote:
> 
> Denis,
> 
> Tpetra caches nothing w.r.t. matrix-matrix multiplication:.  You do that yourself (but that is actually pretty simple)
> 
> Imagine you do this at timestep 0:
> 
> C = Teuchos::rcp(new Tpetra::CrsMatrix(blah));
> Tpetra::MatrixMatrix::Multiply(A,B,C)
> 
> This forms your very first C matrix.  Now rather than delete it, you keep it.  Then at timestep 1, you do:
> 
> C->putScalar(0)
> Tpetra::MatrixMatrix::Multiply(A,B,C)
> 
> 
> Since C already has the right sparsity & communication patterns, the multiply will re-use that.  Tpetra tests in the MatrixMatrix directory test this "reuse" case.
> 
> -Chris
> 
> From: Denis Davydov <davydden at gmail.com>
> Sent: Monday, September 10, 2018 8:50 AM
> To: Siefert, Christopher
> Cc: trilinos-users
> Subject: Re: [EXTERNAL] [Trilinos-Users] Tpetra::CrsMatrix caching related to C= A^T B and D = A*C
>  
> Dear Chris,
> 
>> On 10 Sep 2018, at 16:36, Siefert, Christopher <csiefer at sandia.gov <mailto:csiefer at sandia.gov>> wrote:
>> 
>> Denis,
>> 
>> If you pass in a matrix with the correct structure, for "C" it will keep the communication and sparsity patterns (and be a lot
> 
> By “correct structure” you mean sparsity pattern, right? Because the way this matrix is distributed in MPI row-wise has some degree of freedom.
> So the communication pattern, essentially, depends on MPI distribution of C, in addition to sparsities and distribution of A and B. 
> If I understand you correctly, this will still be cached.
> 
> Are there any examples / tutorials / unit-tests in TPetra where I can check how to get the sparsity of C needed for the product without actually calling Tpetra::MatrixMatrix::Multiply()?
> 
> Regards,
> Denis.
> 
>> faster).
>> 
>> -Chris
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20180910/e54ce0b5/attachment.html>


More information about the Trilinos-Users mailing list