<div dir="ltr"><div><div><br>Dear Barry,<br>I am sorry I could not get you. I have also posted the entire error message so that you could get a deeper insight into it.<br><br><br>Many thanks.<br><br>----<br>John Albequerque.<br><b>========================================================================================<br>Argument out of range<br>[0]PETSC ERROR: nnz cannot be greater than row length: local row 0 value 1 rowlength 0<br>[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>[0]PETSC ERROR: Petsc Release Version 3.6.3, unknown <br>[0]PETSC ERROR: ./MatSparse on a linux-gnu-c-debug named John by johncfd Sat Feb 20 01:36:01 2016<br>[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++ --with-fc=gfortran --download-fblaslapack --download-mpich<br>[0]PETSC ERROR: #1 MatSeqAIJSetPreallocation_SeqAIJ() line 3567 in /home//MyStuff/ClonedRepos/petsc/src/mat/impls/aij/seq/aij.c<br>[0]PETSC ERROR: #2 MatSeqAIJSetPreallocation() line 3539 in /home/MyStuff/ClonedRepos/petsc/src/mat/impls/aij/seq/aij.c<br>[0]PETSC ERROR: #3 MatMPIAIJSetPreallocation_MPIAIJ() line 2835 in /home/MyStuff/ClonedRepos/petsc/src/mat/impls/aij/mpi/mpiaij.c<br>[0]PETSC ERROR: #4 MatMPIAIJSetPreallocation() line 3532 in /home/MyStuff/ClonedRepos/petsc/src/mat/impls/aij/mpi/mpiaij.c</b><br>=========================================================================================<br></div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 20, 2016 at 12:35 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Feb 19, 2016, at 12:54 PM, John Albequerque <<a href="mailto:johncfdcfd@gmail.com">johncfdcfd@gmail.com</a>> wrote:<br>
><br>
> Jed, one more<br>
><br>
> nnz cannot be greater than row length: local row 0 value 1 rowlength 0<br>
<br>
</span> Always send the entire error message, this provides the context to know what the hey is going on.<br>
<br>
It looks like you set a matrix block (if you are using an MPI matrix on one process this could the the "off-diagonal" block) which has no columns (hence row length is zero) but you claim you need to preallocate an entry (the 1).<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><span class="im HOEnZb"><br>
><br>
> How do I deal with this error?<br>
><br>
> Thanks.<br>
><br>
> ----<br>
> John Albequerque.<br>
><br>
><br>
><br>
</span><div class="HOEnZb"><div class="h5">> On Fri, Feb 19, 2016 at 8:17 PM, John Albequerque <<a href="mailto:johncfdcfd@gmail.com">johncfdcfd@gmail.com</a>> wrote:<br>
> Thank you very much, I will try it.<br>
><br>
><br>
> Thanks<br>
><br>
> ----<br>
> John Albequerque.<br>
><br>
><br>
><br>
> On Fri, Feb 19, 2016 at 8:16 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
> John Albequerque <<a href="mailto:johncfdcfd@gmail.com">johncfdcfd@gmail.com</a>> writes:<br>
><br>
> > So Jed, what you are suggesting is that I should set only the non-zero<br>
> > elements while using<br>
> > * MatSetValues(A,(high-low),**idxm,nc,idxn,values,INSERT_*<br>
> ><br>
> > *VALUES);*<br>
> > And not mention the zero elements and for that I should loop over all local<br>
> > rows and then set each of the value.<br>
><br>
> Yes. The whole point of a sparse matrix is to spend no time or storage<br>
> on 0.0 entries. If you allocate a dense matrix and store all the zeros,<br>
> you're just being inefficient relative to a dense format.<br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>