<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Olivier Jamond <olivier.jamond@cea.fr><br>
<b>Sent:</b> Friday, September 25, 2020 2:31 AM<br>
<b>To:</b> Zhang, Hong <hzhang@mcs.anl.gov>; Matthew Knepley <knepley@gmail.com>; Mark Adams <mfadams@lbl.gov><br>
<b>Cc:</b> PETSc <petsc-users@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct</font>
<div> </div>
</div>
<div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
@Mark: Sorry, I totally misunderstood your answer, so my answer to your answer about petsc versions is non-sense...</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
@Hong: <font face="monospace">MatTransposeMatMult gives (Ct*C), no? And I feel that MatCreateTranspose actually works for mpiaij.<br>
</font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace"><br>
</font></p>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
Yes,  <span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 14px; background-color: rgb(255, 255, 255); display: inline !important">
MatTransposeMatMult gives (Ct*C).</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<span style="color: rgb(0, 0, 0); font-family: monospace; font-size: 14px; background-color: rgb(255, 255, 255); display: inline !important"><span style="background-color: rgb(255, 255, 255); display: inline !important">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.</span><br>
</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
-- Hong</p>
</blockquote>
<div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<br>
</p>
<div class="x_moz-cite-prefix">On 24/09/2020 16:16, Zhang, Hong via petsc-users wrote:<br>
</div>
<blockquote type="cite">
<div style=""><span style="">Olivier and Matt,</span><font face="monospace" color="#201f1e"><span style="font-size:15px"><br>
</span></font>
<div style="margin:0px">
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace">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.</font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace"><br>
</font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace">We support MatTransposeMatMult (A*Bt) for mpiaij. Can you use this instead? </font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace"><br>
</font></p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<font face="monospace">Hong</font></p>
</div>
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> petsc-users
<a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users-bounces@mcs.anl.gov">
<petsc-users-bounces@mcs.anl.gov></a> on behalf of Zhang, Hong via petsc-users <a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov">
<petsc-users@mcs.anl.gov></a><br>
<b>Sent:</b> Thursday, September 24, 2020 8:56 AM<br>
<b>To:</b> Matthew Knepley <a class="x_moz-txt-link-rfc2396E" href="mailto:knepley@gmail.com">
<knepley@gmail.com></a>; Mark Adams <a class="x_moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov">
<mfadams@lbl.gov></a><br>
<b>Cc:</b> PETSc <a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov">
<petsc-users@mcs.anl.gov></a><br>
<b>Subject:</b> Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Indeed, we do not have <span style="color:rgb(50,49,48); font-size:17px; font-weight:600; background-color:rgb(250,249,248); display:inline!important">MatCreateTranspose for mpaij matrix. </span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="color:rgb(50,49,48); font-size:17px; font-weight:600; background-color:rgb(250,249,248); display:inline!important">I can adding such support. How soon do you need it?</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span style="color:rgb(50,49,48); font-size:17px; font-weight:600; background-color:rgb(250,249,248); display:inline!important">Hong</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> petsc-users
<a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users-bounces@mcs.anl.gov">
<petsc-users-bounces@mcs.anl.gov></a> on behalf of Matthew Knepley <a class="x_moz-txt-link-rfc2396E" href="mailto:knepley@gmail.com">
<knepley@gmail.com></a><br>
<b>Sent:</b> Thursday, September 24, 2020 6:12 AM<br>
<b>To:</b> Mark Adams <a class="x_moz-txt-link-rfc2396E" href="mailto:mfadams@lbl.gov">
<mfadams@lbl.gov></a><br>
<b>Cc:</b> PETSc <a class="x_moz-txt-link-rfc2396E" href="mailto:petsc-users@mcs.anl.gov">
<petsc-users@mcs.anl.gov></a><br>
<b>Subject:</b> Re: [petsc-users] Compute C*Ct using MatCreateTranspose for Ct</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">On Thu, Sep 24, 2020 at 6:48 AM Mark Adams <<a href="mailto:mfadams@lbl.gov">mfadams@lbl.gov</a>> wrote:<br>
</div>
<div class="x_x_x_gmail_quote">
<blockquote class="x_x_x_gmail_quote" style="margin:0px 0px
                0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div class="x_x_x_gmail_quote">
<blockquote class="x_x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px
                      solid rgb(204,204,204); padding-left:1ex">
<div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<tt><br>
Is there a way to avoid the explicit transposition of the matrix?</tt></p>
</div>
</blockquote>
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Note, <span style="font-family:monospace">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).</span></div>
</div>
</div>
</blockquote>
<div><br>
</div>
<div>We definitely have</div>
<div><br>
</div>
<div>  <a href="https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPtAP.html">https://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatPtAP.html</a></div>
<div><br>
</div>
<div>For now, you can put the identity in for A. It would be nice it we assumed that when A = NULL.</div>
<div><br>
</div>
<div>Patrick, the implementation strategy is broken for the MatProduct mechanism that was just introduced, so</div>
<div>we cannot see which things are implemented in the documentation. How would I go about fixing it?</div>
<div><br>
</div>
<div>  Thanks,</div>
<div><br>
</div>
<div>     Matt</div>
<div> </div>
<blockquote class="x_x_x_gmail_quote" style="margin:0px 0px
                0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div dir="ltr">
<div class="x_x_x_gmail_quote">
<blockquote class="x_x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px
                      solid rgb(204,204,204); padding-left:1ex">
<div>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<tt>Many thanks,</tt><tt><br>
</tt><tt>Olivier Jamond</tt><br>
</p>
<p style="margin-top: 0px; margin-bottom: 0px;margin-top:0px; margin-bottom:0px; margin-top:0px; margin-bottom:0px">
<br>
</p>
</div>
</blockquote>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="x_x_x_gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener</div>
<div><br>
</div>
<div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</body>
</html>