<div dir="ltr">MatProductSetFromOptions() is not really setting any options. It looks like the correct name for this API is MatProductSetUp(). In any case, it looks like both SetFromOptions() and SetUp() should be provided.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 23 Mar 2020 at 01:48, Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>* Please consider fixing MatProductCreate(A,B,C,&D) to take ownership (that is, increase reference count) of the A,B, and the (optional) C matrices provided as arguments. Otherwise it is way easy to get into the dangling pointer trap.<br></div><div><br></div><div>* A thing also missing in the new API is a way to "cleanup" the A,B,C references, something MatProductReset(D) to get rid of (deallocates)  the internal "product" context, thus removing  from D the references to A,B,C. This would be useful if you just want to compute JUST the symbolic product, I'm using that in some code to compute the nonzero pattern of A^2. <br></div><div><br></div><div>* It should be also considered to provide backward compatibility PETSC_DEPRECATED calls to the previous MatMatMultSymbolic() and MatMatMultNumeric(). It looks like it would be trivial to do, though I may be getting it wrong because I have not looked at all the details.</div><div><br></div><div>Regards,</div><div><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Lisandro Dalcin<br>============<br>Research Scientist<br>Extreme Computing Research Center (ECRC)<br>King Abdullah University of Science and Technology (KAUST)<br><a href="http://ecrc.kaust.edu.sa/" target="_blank">http://ecrc.kaust.edu.sa/</a><br></div></div></div>