[petsc-users] DMDASetBlockFillsSparse format

Smith, Barry F. bsmith at mcs.anl.gov
Mon Apr 22 00:33:39 CDT 2019

  I looked at the code and in the end the values get propagated into calls to MatSetValuesLocal() which does not require sorted values. 
  Thus my conclusion is that you do not have to sorted column indices in these calls


   Yes we do a nonexistent job of indicating when indices need to be sorted. Most places: creation of IS, MatSetValuesXXX, VecSetValuesXXX do not need to be sorted. We should mark explicitly any locations where int array values should be sorted in the API, if it is not marked you should assume they do not need to be sorted.

> On Apr 21, 2019, at 5:42 PM, Jed Brown via petsc-users <petsc-users at mcs.anl.gov> wrote:
> I'm pretty confident all the tests are sorted.  It wouldn't be any great
> hardship for us to allow unsorted input.  If you submit an unsorted
> test, we can make sure it works (it might already, but we should
> probably add a call to in-place sort).
> Oleksandr Koshkarov via petsc-users <petsc-users at mcs.anl.gov> writes:
>> Dear All,
>> Does anyone know if the format of sparse matrices
>> in DMDASetBlockFillsSparse require column indicies for chosen row to be in
>> increasing order?
>> Thank you,
>> Oleksandr.

More information about the petsc-users mailing list