[petsc-users] Compute C*Ct using MatCreateTranspose for Ct

Zhang, Hong hzhang at mcs.anl.gov
Sun Sep 27 20:16:09 CDT 2020



________________________________
From: Olivier Jamond <olivier.jamond at cea.fr>
Sent: Friday, September 25, 2020 2:31 AM
To: Zhang, Hong <hzhang at mcs.anl.gov>; Matthew Knepley <knepley at gmail.com>; Mark Adams <mfadams at lbl.gov>
Cc: PETSc <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct


@Mark: Sorry, I totally misunderstood your answer, so my answer to your answer about petsc versions is non-sense...


@Hong: MatTransposeMatMult gives (Ct*C), no? And I feel that MatCreateTranspose actually works for mpiaij.


Yes,  MatTransposeMatMult gives (Ct*C).

MatCreateTranspose(C,&N) creates a new matrix N which shares the data structure of C. When user calls y = N*x, PETSc actually does MatMultTranspose with C. I do not think you can uses N to do N*C, which is not supported.

-- Hong


On 24/09/2020 16:16, Zhang, Hong via petsc-users wrote:
Olivier and Matt,

MatPtAP with A=I gives Pt*P, not P*Pt. We have sequential MatRARt and MatMatTransposeMult(), but no support for mpiaij matrices. The problem is that we do not have a way to implement C*Ct without explicitly transpose C in parallel.


We support MatTransposeMatMult (A*Bt) for mpiaij. Can you use this instead?


Hong

________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov><mailto:petsc-users-bounces at mcs.anl.gov> on behalf of Zhang, Hong via petsc-users <petsc-users at mcs.anl.gov><mailto:petsc-users at mcs.anl.gov>
Sent: Thursday, September 24, 2020 8:56 AM
To: Matthew Knepley <knepley at gmail.com><mailto:knepley at gmail.com>; Mark Adams <mfadams at lbl.gov><mailto:mfadams at lbl.gov>
Cc: PETSc <petsc-users at mcs.anl.gov><mailto:petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct

Indeed, we do not have MatCreateTranspose for mpaij matrix.
I can adding such support. How soon do you need it?
Hong

________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov><mailto:petsc-users-bounces at mcs.anl.gov> on behalf of Matthew Knepley <knepley at gmail.com><mailto:knepley at gmail.com>
Sent: Thursday, September 24, 2020 6:12 AM
To: Mark Adams <mfadams at lbl.gov><mailto:mfadams at lbl.gov>
Cc: PETSc <petsc-users at mcs.anl.gov><mailto:petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct

On Thu, Sep 24, 2020 at 6:48 AM Mark Adams <mfadams at lbl.gov<mailto:mfadams at lbl.gov>> wrote:

Is there a way to avoid the explicit transposition of the matrix?

It does not look like we have A*B^T for mpiaij as the error message says. I am not finding it in the code.

Note, MatMatMult with a transpose shell matrix, I suspect that it does an explicit transpose internally, or it could notice that you have C^T*C and we might have that implemented in-place (I doubt it, but it would be legal and fine to do).

We definitely have

  https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPtAP.html

For now, you can put the identity in for A. It would be nice it we assumed that when A = NULL.

Patrick, the implementation strategy is broken for the MatProduct mechanism that was just introduced, so
we cannot see which things are implemented in the documentation. How would I go about fixing it?

  Thanks,

     Matt


Many thanks,
Olivier Jamond



--
What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener

https://www.cse.buffalo.edu/~knepley/<http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20200928/a7342de9/attachment.html>


More information about the petsc-users mailing list