[Trilinos-Users] Concerning Matrix-Matrix product

Riccardo Rossi rrossi at cimne.upc.edu
Wed Jun 2 12:26:46 MDT 2010


Hi all,

concerning the thread on Mat-Mat products, i also use

D * Minv * G

where Minv is diag and D has the "structure" of the transpose of G but
is not necessarily its transpose...

if in making the optimized product you may it sufficiently flexible to
take in account this case i would be very grateful

thank you
Riccardo
-  
________________________________________________________________
Riccardo Rossi, Ph.D, Civil Engineer
member of the Kratos Group: kratos.cimne.upc.es
Centro Internacional de Métodos Numéricos en Ingeniería (CIMNE)
Universidad Politécnica de Cataluña (UPC)
Edificio C-1, campus Norte UPC
Gran Capitan, s/n
08034 Barcelona, España
Tel. (+34) 93 401 5696
________________________________________________________________

AVISO IMPORTANTE

Los datos de carácter personal contenidos en el mensaje, se registrarán
en un fichero para facilitar la gestión de las comunicaciones de CIMNE.
Se pueden ejercitar los derechos de acceso, rectificación, cancelación y
oposición por escrito, dirigiéndose a nuestras oficinas de CIMNE, Gran
Capitán s/n,  Edificio C1 - Campus Norte UPC, 08034 Barcelona, España.

AVÍS IMPORTANT

Les dades de caràcter personal contingudes en aquest missatge es
registraran en un fitxer per facilitar la gestió de les comunicacions
del CIMNE. Es poden exercir els drets d'accés, rectificació,
cancel·lació i oposició, per escrit a les nostres oficines del CIMNE,
Gran Capità s/n, Edifici C1, Campus Nord UPC, 08034 Barcelona, Espanya.

IMPORTANT NOTICE

All personal data contained in this mail will be processed
confidentially and stored in a file property of CIMNE in order to manage
corporate communications. You may exercise the right of access,
rectification, deletion and objection by letter sent to CIMNE, Gran
Capitán, Edificio C1 - Campus Norte UPC, 08034 Barcelona, Spain.


On Wed, 2010-06-02 at 12:00 -0600,
trilinos-users-request at software.sandia.gov wrote:
> Send Trilinos-Users mailing list submissions to
> 	trilinos-users at software.sandia.gov
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://software.sandia.gov/mailman/listinfo/trilinos-users
> or, via email, send a message with subject or body 'help' to
> 	trilinos-users-request at software.sandia.gov
> 
> You can reach the person managing the list at
> 	trilinos-users-owner at software.sandia.gov
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Trilinos-Users digest..."
> 
> 
> Today's Topics:
> 
>    1. EpetraExt MatrixMatrix (Kevin Long)
>    2. Re: EpetraExt MatrixMatrix (Heroux, Michael A)
>    3. Re: EpetraExt MatrixMatrix (Erik Boman)
>    4. Re: EpetraExt MatrixMatrix (Kurtis Nusbaum)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Tue, 1 Jun 2010 18:23:29 -0500
> From: "Kevin Long" <kevin.long at ttu.edu>
> Subject: [Trilinos-Users] EpetraExt MatrixMatrix
> To: "trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>,	"Victoria Howle"
> 	<victoria.howle at ttu.edu>
> Message-ID: <201006011823.29336.kevin.long at ttu.edu>
> Content-Type: text/plain; charset=utf-8
> 
> 
> Hi,
> 
> Vicki Howle and I have encountered a problem for which we want to compute 
> explicitly (as an Epetra_CrsMatrix) the product B^T D B, where D is a 
> diagonal matrix. We have B as an Epetra_CrsMatrix and diag(D) as an 
> Epetra_Vector. 
> 
> We can do this easily enough by making an Epetra_CrsMatrix representation of 
> D, then calling EpetraExt::MatrixMatrix::Multiply() twice, first to form 
> C1=D*B, then again to form C= B^T C1.  The second call can use 
> transposeA=true so we don't need to form B^T. 
> 
> Alternatively, I could form C1=sqrt(D) B, then do C1^T C1. Again, not hard to 
> write. 
> 
> However, neither approach takes advantage of the fact that D is diagonal, 
> which means (a) I need to construct a whole Epetra_CrsMatrix for something 
> that can really just be stored as a vector, and (b) inside 
> MatrixMatrix::Multiply(), I'm doing needless work to find the graph of the 
> product D B when I already know that D B and B will have the same graph. 
> 
> The operation B^T D B is a fairly common; any chance that someone will extend 
> MatrixMatrix to provide an optimized multiply for that case? Or better yet, 
> has anyone already written such code?  
> 
> Thanks,
> 
> Kevin
> 
> 
> 
> 
> 
> -- 
> ------------------------------------------------------
> Kevin Long
> Associate Professor
> Department of Mathematics and Statistics
> Texas Tech University
> Lubbock, TX 
> 
> "The end of fear is the beginning of wisdom" 
>     -- Bertrand Russell
> ------------------------------------------------------
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Wed, 2 Jun 2010 09:29:13 -0600
> From: "Heroux, Michael A" <maherou at sandia.gov>
> Subject: Re: [Trilinos-Users] EpetraExt MatrixMatrix
> To: Kevin Long <kevin.long at ttu.edu>,
> 	"trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>, Vicki Howle
> 	<victoria.howle at ttu.edu>
> Message-ID: <C82BE2F9.25C00%maherou at sandia.gov>
> Content-Type: text/plain; charset="us-ascii"
> 
> Kevin,
> 
> We (read summer intern) are developing a new Matrix-Matrix capability using
> templates for support of Tpetra.  I will mention this Kurtis Nusbaum (the
> intern).  There are no plans, AFAIK, to modify the existing Epetra versions.
> 
> I think the best we can do at this point is to form D1 = sqrt(D) (O(n) cost)
> as you suggest, then explicitly scale B using the LeftScale() method (O(nz)
> cost), the use the existing Matrix-Matrix multiply kernel.
> 
> Kurtis is on this list, so he is now aware.
> 
> Mike
> 
> 
> On 6/1/10 6:23 PM, "Kevin Long" <kevin.long at ttu.edu> wrote:
> 
> > 
> > Hi,
> > 
> > Vicki Howle and I have encountered a problem for which we want to compute
> > explicitly (as an Epetra_CrsMatrix) the product B^T D B, where D is a
> > diagonal matrix. We have B as an Epetra_CrsMatrix and diag(D) as an
> > Epetra_Vector. 
> > 
> > We can do this easily enough by making an Epetra_CrsMatrix representation of
> > D, then calling EpetraExt::MatrixMatrix::Multiply() twice, first to form
> > C1=D*B, then again to form C= B^T C1.  The second call can use
> > transposeA=true so we don't need to form B^T.
> > 
> > Alternatively, I could form C1=sqrt(D) B, then do C1^T C1. Again, not hard to
> > write. 
> > 
> > However, neither approach takes advantage of the fact that D is diagonal,
> > which means (a) I need to construct a whole Epetra_CrsMatrix for something
> > that can really just be stored as a vector, and (b) inside
> > MatrixMatrix::Multiply(), I'm doing needless work to find the graph of the
> > product D B when I already know that D B and B will have the same graph.
> > 
> > The operation B^T D B is a fairly common; any chance that someone will extend
> > MatrixMatrix to provide an optimized multiply for that case? Or better yet,
> > has anyone already written such code?
> > 
> > Thanks,
> > 
> > Kevin
> > 
> > 
> > 
> > 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Wed, 02 Jun 2010 09:35:48 -0600
> From: Erik Boman <egboman at sandia.gov>
> Subject: Re: [Trilinos-Users] EpetraExt MatrixMatrix
> To: Kevin Long <kevin.long at ttu.edu>
> Cc: Victoria Howle <victoria.howle at ttu.edu>,
> 	"trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>
> Message-ID: <1275492948.15283.124.camel at octopi.sandia.gov>
> Content-Type: text/plain
> 
> Kevin and Vicki,
> 
> I've done this before to form a Schur complement explicitly.
> I used the LeftScale method in Epetra to form C1=D*B. This helps, but is
> not a great solution since I then needed to store the scaled copy of B.
> I don't know if anybody has implemented a more efficient solution.
> 
> Erik
> 
> 
> On Tue, 2010-06-01 at 17:23 -0600, Kevin Long wrote:
> > Hi,
> > 
> > Vicki Howle and I have encountered a problem for which we want to compute 
> > explicitly (as an Epetra_CrsMatrix) the product B^T D B, where D is a 
> > diagonal matrix. We have B as an Epetra_CrsMatrix and diag(D) as an 
> > Epetra_Vector. 
> > 
> > We can do this easily enough by making an Epetra_CrsMatrix representation of 
> > D, then calling EpetraExt::MatrixMatrix::Multiply() twice, first to form 
> > C1=D*B, then again to form C= B^T C1.  The second call can use 
> > transposeA=true so we don't need to form B^T. 
> > 
> > Alternatively, I could form C1=sqrt(D) B, then do C1^T C1. Again, not hard to 
> > write. 
> > 
> > However, neither approach takes advantage of the fact that D is diagonal, 
> > which means (a) I need to construct a whole Epetra_CrsMatrix for something 
> > that can really just be stored as a vector, and (b) inside 
> > MatrixMatrix::Multiply(), I'm doing needless work to find the graph of the 
> > product D B when I already know that D B and B will have the same graph. 
> > 
> > The operation B^T D B is a fairly common; any chance that someone will extend 
> > MatrixMatrix to provide an optimized multiply for that case? Or better yet, 
> > has anyone already written such code?  
> > 
> > Thanks,
> > 
> > Kevin
> > 
> > 
> > 
> > 
> > 
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Wed, 2 Jun 2010 10:34:41 -0600
> From: "Kurtis Nusbaum" <klnusbaum at gmail.com>
> Subject: Re: [Trilinos-Users] EpetraExt MatrixMatrix
> To: "Heroux, Michael A" <maherou at sandia.gov>
> Cc: Kevin Long <kevin.long at ttu.edu>, Vicki Howle
> 	<victoria.howle at ttu.edu>,	"trilinos-users at software.sandia.gov"
> 	<trilinos-users at software.sandia.gov>
> Message-ID:
> 	<AANLkTin4VCdQkAp1TBf7Hh9BhbPGU74FKkwxL6aYtzj1 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> Kevin,
> I'm currently in the preliminary stages of implementing the Mat-Mat multiply
> kernel in Tpetra. Right now I'm just trying to a get a basic, general
> Mat-Mat kernel working. Once I've got that working, I plan on starting to
> implement optimizations for specific cases. I've added this to my list of
> specific cases that I'm going to take a look at. I'll make it the first
> optimization I look at since it's the only one that's been explicitly
> requested thus far. I'll also try to keep you updated.
> 
> -Kurtis
> 
> On Wed, Jun 2, 2010 at 9:29 AM, Heroux, Michael A <maherou at sandia.gov>wrote:
> 
> > Kevin,
> >
> > We (read summer intern) are developing a new Matrix-Matrix capability using
> > templates for support of Tpetra.  I will mention this Kurtis Nusbaum (the
> > intern).  There are no plans, AFAIK, to modify the existing Epetra
> > versions.
> >
> > I think the best we can do at this point is to form D1 = sqrt(D) (O(n)
> > cost)
> > as you suggest, then explicitly scale B using the LeftScale() method (O(nz)
> > cost), the use the existing Matrix-Matrix multiply kernel.
> >
> > Kurtis is on this list, so he is now aware.
> >
> > Mike
> >
> >
> > On 6/1/10 6:23 PM, "Kevin Long" <kevin.long at ttu.edu> wrote:
> >
> > >
> > > Hi,
> > >
> > > Vicki Howle and I have encountered a problem for which we want to compute
> > > explicitly (as an Epetra_CrsMatrix) the product B^T D B, where D is a
> > > diagonal matrix. We have B as an Epetra_CrsMatrix and diag(D) as an
> > > Epetra_Vector.
> > >
> > > We can do this easily enough by making an Epetra_CrsMatrix representation
> > of
> > > D, then calling EpetraExt::MatrixMatrix::Multiply() twice, first to form
> > > C1=D*B, then again to form C= B^T C1.  The second call can use
> > > transposeA=true so we don't need to form B^T.
> > >
> > > Alternatively, I could form C1=sqrt(D) B, then do C1^T C1. Again, not
> > hard to
> > > write.
> > >
> > > However, neither approach takes advantage of the fact that D is diagonal,
> > > which means (a) I need to construct a whole Epetra_CrsMatrix for
> > something
> > > that can really just be stored as a vector, and (b) inside
> > > MatrixMatrix::Multiply(), I'm doing needless work to find the graph of
> > the
> > > product D B when I already know that D B and B will have the same graph.
> > >
> > > The operation B^T D B is a fairly common; any chance that someone will
> > extend
> > > MatrixMatrix to provide an optimized multiply for that case? Or better
> > yet,
> > > has anyone already written such code?
> > >
> > > Thanks,
> > >
> > > Kevin
> > >
> > >
> > >
> > >
> >
> >
> > _______________________________________________
> > Trilinos-Users mailing list
> > Trilinos-Users at software.sandia.gov
> > http://software.sandia.gov/mailman/listinfo/trilinos-users
> >
> >
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20100602/7449c36c/attachment-0001.html 
> 
> ------------------------------
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users
> 
> 
> End of Trilinos-Users Digest, Vol 58, Issue 2
> *********************************************
> 





More information about the Trilinos-Users mailing list