[petsc-dev] MatSetValues with v=0

Barry Smith bsmith at mcs.anl.gov
Sat Apr 12 17:10:36 CDT 2014


   Patrick,

     Currently it is supported for MatSetValues_SeqAIJ() and MatSetValues_MPIAIJ(). It is not handled for BAIJ and SBAIJ, the code while crash with segv in those cases (since we don’t check for a valid v pointer before use :-).   But support could easily be added for BAIJ and SBAIJ with just a few lines of code.

     MatSetValuesBlocked() does not have this kind of support and adding it would be cumbersome.

     So I guess the question is does this “feature” add useful functionality that makes the slightly more complex code worthwhile? Or is it an oddball thing that should be removed? As the cool kids would say “what is the use case for this feature?”. 

      I’m fine with adding support for BAIJ and SBAIJ and documenting it but then I am also fine with removing it though I suspect it is used somewhere in PETSc and thus that code would need to be located and changed if it is removed.

   Barry



On Apr 11, 2014, at 12:51 PM, Patrick Lacasse <patrick.m.lacasse at gmail.com> wrote:

> Hi,
> 
>    I see that implementation of MatSetValues handles a special case when one passes a null pointer v=0.
> In this case, it is considered that all values are 0.
> But the documentation doesn't seems to talk about it :
> http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatSetValues.html
> 
> Is it a feature that we can use?
> Should it be added to the doc?
> 
> Patrick Lacasse




More information about the petsc-dev mailing list