<div class="gmail_quote">On Sat, Jan 21, 2012 at 11:50, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">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">
<br>
  Jed,<br>
<br>
     It appears you changed all the MatXXXSetPreallocation() routines to set call  ierr = MatSetOption(B,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);CHKERRQ(ierr); thus generating an error if preallocation is wrong.<br>
<br>
     The problem is that MatXXXSetPreallocation() is ALWAYS called (with default values if the user did not call it explicitly) by MatPreallocated() which calls MatPreallocationSetUp(). Hence you are ALWAYS setting error on new allocation.<br>

<br>
     My intention was that an error would only be generated if the user explicitly called MatXXXSetPreallocation() so<br>
<br>
   1) Was my intention wrong and should we always default to erroring on wrong preallocation even if the user did not preallocate or   (if so we need lots of fixes because much code is broken in nightly tests)<br></blockquote>
<div><br></div><div>No, I think your idea was correct.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
   2) is there anyway to change it so it only errors out when the user did explicitly preallocate?<br></blockquote><div><br></div><div>This patch is not pretty, but it seems to do the job.</div><div><br></div><div><a href="http://petsc.cs.iit.edu/petsc/petsc-dev/rev/e675ef955f92">http://petsc.cs.iit.edu/petsc/petsc-dev/rev/e675ef955f92</a></div>
</div>