<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<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);">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important">Pierre,</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, sans-serif; font-size: 14.6667px; background-color: rgb(255, 255, 255); display: inline !important">The old API, MatMatMult(), MatPtAP() ... are still available as wrappers to the new API:</span></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<blockquote type="cite" style="color: rgb(50, 49, 48); font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, system-ui, Roboto, "Helvetica Neue", sans-serif; background-color: rgb(255, 255, 255)">
<div style="margin: 0px">
<div style="margin: 0px; font-weight: normal; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif">
<span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important">MatProductCreate()</span></div>
<div style="margin: 0px; font-weight: normal; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif">
<span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important">MatProductSetType(,MATPRODUCT_AB/PtAP)</span><br>
</span></div>
<div style="margin: 0px; font-weight: normal; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif">
<span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important">MatProductSetFromOptions()</span><br>
</span></span></div>
<div style="margin: 0px; font-weight: normal; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif">
<span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important">MatProductSymbolic()</span><br>
</span></span></span></div>
<div style="margin: 0px; font-weight: normal; font-size: 12pt; font-family: Calibri, Arial, Helvetica, sans-serif">
<span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important"><span style="margin: 0px; background-color: rgb(255, 255, 255); display: inline !important">MatProductNumeric()</span></span></span></span></span></div>
</div>
</blockquote>
You do not need to change your code. When you call MatMatMult() with seqsbaij and dense matrices, a detailed error message will be out from MatProductSetFromOptions() (or MatMatMult() if you use the wrapper).</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I'll discuss Jose's usage in next email.</div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hong</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>
<span style="font-family: Calibri, sans-serif; background-color: rgb(255, 255, 255); display: inline !important">
Pierre</span> Jolivet <pierre.jolivet@enseeiht.fr><br>
<b>Sent:</b> Tuesday, April 21, 2020 10:53 AM<br>
<b>To:</b> Zhang, Hong <hzhang@mcs.anl.gov><br>
<b>Cc:</b> petsc-dev <petsc-dev@mcs.anl.gov><br>
<b>Subject:</b> Re: [petsc-dev] MATOP_MAT_MULT</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space"><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 21 Apr 2020, at 5:22 PM, Zhang, Hong <<a href="mailto:hzhang@mcs.anl.gov" class="">hzhang@mcs.anl.gov</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">Pierre,</span><br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">MatMatMult_xxx() is removed from MatOps table.
</span></div>
</div>
</blockquote>
<div><br class="">
</div>
<div>Shouldn’t there be a deprecation notice somewhere?</div>
<div>There is nothing about MATOP_MAT_MULT in the 3.13 changelog <a href="https://www.mcs.anl.gov/petsc/documentation/changes/313.html" class="">https://www.mcs.anl.gov/petsc/documentation/changes/313.html</a></div>
<div>For example, I see that in SLEPc, José is currently making these checks, which are in practice useless as they always return PETSC_FALSE? <a href="https://gitlab.com/slepc/slepc/-/blob/master/src/sys/classes/bv/impls/contiguous/contig.c#L191" class="">https://gitlab.com/slepc/slepc/-/blob/master/src/sys/classes/bv/impls/contiguous/contig.c#L191</a></div>
<div>(Maybe José is aware of this and this is just for testing)</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">MatMatMult() is replaced by</span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">MatProductCreate()</span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important">MatProductSetType(,MATPRODUCT_AB)</span><br class="">
</span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important">MatProductSetFromOptions()</span><br class="">
</span></span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important">MatProductSymbolic()</span><br class="">
</span></span></span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important"><span class="" style="background-color:rgb(255,255,255); display:inline!important">MatProductNumeric()</span><br class="">
</span></span></span></span></div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">Where/when do you need query a single matrix for its product operation?</span></div>
</div>
</blockquote>
<div><br class="">
</div>
<div>I didn’t want to bother at first with the new API, because I’m only interested in C = A*B with C and B being dense.</div>
<div>Of course, I can update my code, but if I understand Stefano’s issue correctly, and let’s say my A is of type SBAIJ, for which there is no MatMatMult, the code will now error out in the MatProduct?</div>
<div>There is no fallback mechanism? Meaning I could in fact _not_ use the new API and will just have to loop on all columns of B, even for AIJ matrices.</div>
<div><br class="">
</div>
<div>Thanks,</div>
<div>Pierre</div>
<br class="">
<blockquote type="cite" class="">
<div class="">
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span class="" style="color:rgb(50,49,48); background-color:rgb(255,255,255); display:inline!important">Hong</span></div>
<div id="x_appendonsend" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
</div>
<div class="" style="font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<hr tabindex="-1" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; display:inline-block; width:599.75px">
<span class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; float:none; display:inline!important"></span>
<div id="x_divRplyFwdMsg" dir="ltr" class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none">
<font face="Calibri, sans-serif" class="" style="font-size:11pt"><b class="">From:</b><span class="x_Apple-converted-space"> </span>petsc-dev <<a href="mailto:petsc-dev-bounces@mcs.anl.gov" class="">petsc-dev-bounces@mcs.anl.gov</a>> on behalf of Pierre Jolivet
 <<a href="mailto:pierre.jolivet@enseeiht.fr" class="">pierre.jolivet@enseeiht.fr</a>><br class="">
<b class="">Sent:</b><span class="x_Apple-converted-space"> </span>Tuesday, April 21, 2020 7:50 AM<br class="">
<b class="">To:</b><span class="x_Apple-converted-space"> </span>petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" class="">petsc-dev@mcs.anl.gov</a>><br class="">
<b class="">Subject:</b><span class="x_Apple-converted-space"> </span>[petsc-dev] MATOP_MAT_MULT</font>
<div class=""> </div>
</div>
<div class="" style="font-family:Helvetica; font-size:12px; font-style:normal; font-variant-caps:normal; font-weight:normal; letter-spacing:normal; text-align:start; text-indent:0px; text-transform:none; white-space:normal; word-spacing:0px; text-decoration:none; word-wrap:break-word; line-break:after-white-space">
Hello,
<div class="">Am I seeing this correctly?</div>
<div class="">
<div class="">#include <petsc.h></div>
<div class=""><br class="">
</div>
<div class="">int main(int argc,char **args)</div>
<div class="">{</div>
<div class="">  Mat               A;</div>
<div class="">  PetscBool         hasMatMult;</div>
<div class="">  PetscErrorCode    ierr;</div>
<div class=""><br class="">
</div>
<div class="">  ierr = PetscInitialize(&argc,&args,NULL,NULL);if (ierr) return ierr;</div>
<div class="">  ierr = MatCreate(PETSC_COMM_WORLD,&A);CHKERRQ(ierr);</div>
<div class="">  ierr = MatSetType(A,MATMPIAIJ);CHKERRQ(ierr);</div>
<div class="">  ierr = MatHasOperation(A,MATOP_MAT_MULT,&hasMatMult);CHKERRQ(ierr);</div>
<div class="">  printf("%s\n", PetscBools[hasMatMult]);</div>
<div class="">  ierr = PetscFinalize();</div>
<div class="">  return ierr;</div>
<div class="">}</div>
</div>
<div class=""><br class="">
</div>
<div class="">=> FALSE</div>
<div class=""><br class="">
</div>
<div class="">I believe this is a regression (or at least an undocumented change) introduced here: <a href="https://gitlab.com/petsc/petsc/-/merge_requests/2524/" class="">https://gitlab.com/petsc/petsc/-/merge_requests/2524/</a></div>
<div class="">I also believe Stefano raised a similar point there: <a href="https://gitlab.com/petsc/petsc/-/issues/608" class="">https://gitlab.com/petsc/petsc/-/issues/608</a></div>
<div class="">This is a performance killer in my case because I was previously using this check to know whether I could use MatMatMult or had to loop on all columns and call MatMult on all of them.</div>
<div class="">There is also a bunch of (previously functioning but now) broken code, e.g., <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/transpose/transm.c.html#line105" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/transpose/transm.c.html#line105</a> or <a href="https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#line2105" class="">https://www.mcs.anl.gov/petsc/petsc-current/src/mat/impls/nest/matnest.c.html#line2105</a></div>
<div class="">Is this being addressed/documented?</div>
<div class=""><br class="">
</div>
<div class="">Thanks,</div>
<div class="">Pierre</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>