<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);">
Jose,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText">>> I also now just tested some previously PETSC_VERSION_LT(3,13,0) running code with C=A*B, Dense=Nest*Dense, all previously allocated prior to a call to MatMatMult and scall = MAT_REUSE_MATRIX.<br>
>> Sadly, it’s now broken. It is my fault for not having a test for this in <a href="https://gitlab.com/petsc/petsc/-/merge_requests/2069">
https://gitlab.com/petsc/petsc/-/merge_requests/2069</a>, sorry about that.<br>
>> [0]PETSC ERROR: Call MatProductSymbolic() first<br>
>> [0]PETSC ERROR: #1 MatProductNumeric() line 730 in /ccc/work/cont003/rndm/rndm/petsc/src/mat/interface/matproduct.c<br>
>> [0]PETSC ERROR: #2 MatMatMult() line 9335 in /ccc/work/cont003/rndm/rndm/petsc/src/mat/interface/matrix.c<br>
>> <br>
>> Here is a reproducer (that will work OK with 3.12.4).<br>
>> diff --git a/src/mat/tests/ex195.c b/src/mat/tests/ex195.c<br>
>> index c72662bc3c..811de669c5 100644<br>
>> --- a/src/mat/tests/ex195.c<br>
>> +++ b/src/mat/tests/ex195.c<br>
>> @@ -73,2 +73,3 @@ int main(int argc,char **args)<br>
>>    ierr = MatMatMult(nest,B,MAT_REUSE_MATRIX,PETSC_DEFAULT,&C);CHKERRQ(ierr);<br>
>> +  ierr = MatMatMult(nest,C,MAT_REUSE_MATRIX,PETSC_DEFAULT,&B);CHKERRQ(ierr);<br>
>>    ierr = MatMatMultEqual(nest,B,C,10,&equal);CHKERRQ(ierr);<br>
>> <br>
>> $ make -f gmakefile test searchin=mat_tests-ex195<br>
>> <br>
>> I believe this is very close to the topic at hand and issue #608, so maybe you could fix this as well in the same upcoming MR? Just let me know, I can have a crack it otherwise.</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">This is a bug. I fixed it in the branch hzhang/fix-matproduct-reuse/maint. Can you test it?</div>
<div class="PlainText">Hong</div>
<div class="PlainText"><br>
</div>
</span></font></div>
</body>
</html>