[petsc-dev] Suggestions for MatProductCreate()

hzhang at mcs.anl.gov hzhang at mcs.anl.gov
Mon Mar 23 09:57:31 CDT 2020


Lisandro:

> 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.
>

Not all product and matrix types enable algorithmic options. For those who
do have options,
MatProductSetFromOptions_mattype_producttype() enables it.
See MatProductSetFromOptions_MPIAIJ_AB().
Hong

>
> On Mon, 23 Mar 2020 at 01:48, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>
>> * 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.
>>
>> * 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.
>>
>> * 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.
>>
>> Regards,
>>
>> --
>> Lisandro Dalcin
>> ============
>> Research Scientist
>> Extreme Computing Research Center (ECRC)
>> King Abdullah University of Science and Technology (KAUST)
>> http://ecrc.kaust.edu.sa/
>>
>
>
> --
> Lisandro Dalcin
> ============
> Research Scientist
> Extreme Computing Research Center (ECRC)
> King Abdullah University of Science and Technology (KAUST)
> http://ecrc.kaust.edu.sa/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20200323/417a555f/attachment.html>


More information about the petsc-dev mailing list