<div dir="ltr"><div dir="ltr">On Mon, Mar 23, 2020 at 5:12 PM Lisandro Dalcin <<a href="mailto:dalcinl@gmail.com">dalcinl@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><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 dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 23 Mar 2020 at 17:57, <a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a> <<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</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 dir="ltr">Lisandro:<br></div><div class="gmail_quote"><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">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></blockquote><div> </div><div>Not all product and matrix types enable algorithmic options. For those who do have options, </div><div>MatProductSetFromOptions_mattype_producttype() enables it. See MatProductSetFromOptions_MPIAIJ_AB().<br></div></div></div></blockquote><div><br></div><div>I have to insist, you should separate SetFromOptions() from SetUp(). For many types, SetFromOptions may be empty (you can even use a NULL pointer to handle these cases), but the rest of the code that does setup stuff (that is, preparing the data structures) should go SetUp() routines.</div><div>This design pattern is used everywhere in PETSc. That's the proper way to do it, IMHO. This way is the one that gives maximum flexibility to power users/developers, because some times developers may want to configure objects with some parameters, and do a SetUp() without calling SetFromOptions() to prevent users to mess up with the parameters the developer carefully chose.</div></div></div></blockquote><div><br></div><div>I agree here. We should not be using options in SetUp or setting up in SetFromOptions() since it might not be called. I am tying to fix all this in DM.</div><div><br></div><div> Matt</div><div> </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">-- <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>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="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>