[petsc-dev] MatISGetLocalMat: need to MatDestroy the returned local matrice ?

Barry Smith bsmith at mcs.anl.gov
Fri May 19 19:03:56 CDT 2017


> On May 19, 2017, at 6:58 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> Barry Smith <bsmith at mcs.anl.gov> writes:
> 
>>   Jed,
>> 
>>     Should this utilize the Get/Restore paradigm? 
>> 
>>     If not should the name be different to prevent confusion? Currently we have 
>> 
>>  XXXCreate -->  user needs to call a destroy
>> 
>>   XXXXGetYYY  --> user needs to call a restore (but not always?)
>> 
>>   Could we introduce say
>> 
>>    XXXAccessYYY   --> user does not call destroy or restore ?
> 
> Even VecGetArrayRead requires matching Restore.  Light access is less
> safe and gives the library less opportunity for strictness to catch
> bugs.

  Sure, I am not advocating not having restores but if we do have things without restores a different name makes it clearer that it is providing a different kind of access.






More information about the petsc-dev mailing list