[petsc-users] Doubt in MPIPreallocation

John Albequerque johncfdcfd at gmail.com
Fri Feb 19 12:54:21 CST 2016


Jed, one more

*nnz cannot be greater than row length: local row 0 value 1 rowlength 0 *

How do I deal with this error?

Thanks.

----
John Albequerque.


On Fri, Feb 19, 2016 at 8:17 PM, John Albequerque <johncfdcfd at gmail.com>
wrote:

> Thank you very much, I will try it.
>
>
> Thanks
>
> ----
> John Albequerque.
>
>
>
> On Fri, Feb 19, 2016 at 8:16 PM, Jed Brown <jed at jedbrown.org> wrote:
>
>> John Albequerque <johncfdcfd at gmail.com> writes:
>>
>> > So Jed, what you are suggesting is that I should set only the non-zero
>> > elements while using
>> > *  MatSetValues(A,(high-low),**idxm,nc,idxn,values,INSERT_*
>> >
>> > *VALUES);*
>> > And not mention the zero elements and for that I should loop over all
>> local
>> > rows and then set each of the value.
>>
>> Yes.  The whole point of a sparse matrix is to spend no time or storage
>> on 0.0 entries.  If you allocate a dense matrix and store all the zeros,
>> you're just being inefficient relative to a dense format.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160220/4fe5dee0/attachment.html>


More information about the petsc-users mailing list