<div dir="ltr"><div dir="ltr">On Mon, Mar 11, 2019 at 6:59 PM Jed Brown via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov">petsc-dev@mcs.anl.gov</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">One could imagine PETSc written so that all Mat operations like<br>
transpose and products return lazy representations, with a method that<br>
makes it explicit.  Would eliminate all the Transpose variants in the<br>
matrix products, for example, and enable an implementation to choose<br>
order of operations for chained products.<br></blockquote><div><br></div><div>Didn't Liz Jessup (and others) do a BLAS subset this way in order to fuse operations? Did these</div><div>not catch on because it is a maintenance burden, or just that you don't get a big win?</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">
"Smith, Barry F. via petsc-dev" <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> writes:<br>
<br>
>> On Mar 11, 2019, at 1:28 PM, Isaac, Tobin G <<a href="mailto:tisaac@cc.gatech.edu" target="_blank">tisaac@cc.gatech.edu</a>> wrote:<br>
>> <br>
>> <br>
>> Okay, but do you have an opinion on the original issue: should we<br>
>> always return a matrix from various matrix-matrix routines, even if it<br>
>> has limited functionality?<br>
><br>
>    I'm fine with it always returning the composite matrix unless you have a specific use case that would require MAT_INITIAL_MATRIX_GET_VALUES<br>
><br>
>    Barry<br>
><br>
>> <br>
>> On Mon, Mar 11, 2019 at 06:09:55PM +0000, Smith, Barry F. wrote:<br>
>>> <br>
>>>   Sounds like overkill on the complexity meter.<br>
>>> <br>
>>>   Barry<br>
>>> <br>
>>> <br>
>>>> On Mar 11, 2019, at 6:15 AM, Isaac, Tobin G via petsc-dev <<a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
>>>> <br>
>>>> One thought: we could extend MatReuse with MAT_INITIAL_MATRIX_GET_VALUES to indicate that a matrix that implements MatGetValues() is desired, to allow some user intent.<br>
>>>> <br>
>>>> <br>
>>>> On March 9, 2019 7:44:06 PM EST, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
>>>>> On Sat, Mar 9, 2019 at 4:42 PM Isaac, Tobin G via petsc-dev <<br>
>>>>> <a href="mailto:petsc-dev@mcs.anl.gov" target="_blank">petsc-dev@mcs.anl.gov</a>> wrote:<br>
>>>>> <br>
>>>>>> <br>
>>>>>> Let's say I want to do Newton-Krylov on some DAG of computations.<br>
>>>>>> Building the Jacobian is programmatic from the chain rule, requiring<br>
>>>>>> just a lot of matrix-matrix multiplications in the correct sequence.<br>
>>>>>> <br>
>>>>>> If it really is more efficient for two Jacobians to be contracted<br>
>>>>> into<br>
>>>>>> a matrix with random access, that's great, but if it's not, or if<br>
>>>>>> the appropriate implementation of MatMatMult_X_Y does not exist,<br>
>>>>>> having a MATCOMPOSITE is better than nothing.<br>
>>>>>> <br>
>>>>>> So why not make MATCOMPOSITE something that our matrix-matrix<br>
>>>>>> multiplication routines return when a specialization isn't found?<br>
>>>>>> It moves the "Not Implemented" warning from MatMatMult() to<br>
>>>>>> whenever I try to do something other than multiply with the output,<br>
>>>>>> but in some situations that's desirable.<br>
>>>>>> <br>
>>>>>> I'd be interested to hear what people think.<br>
>>>>>> <br>
>>>>> <br>
>>>>> I think this is a good idea. The most important thing is to maintain<br>
>>>>> transparency, so that the output<br>
>>>>> makes this clear in -ksp_view and we are easily able to see what<br>
>>>>> someone<br>
>>>>> has produced.<br>
>>>>> <br>
>>>>> Matt<br>
>>>>> <br>
>>>>> <br>
>>>>>> Thanks,<br>
>>>>>> Toby<br>
>>>>>> <br>
>>>>>> <br>
>>>>>> <br>
>>> <br>
</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>