On Thu, Apr 22, 2010 at 9:22 AM, Jed Brown <span dir="ltr"><<a href="mailto:jed@59a2.org">jed@59a2.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
On Thu, 22 Apr 2010 15:15:12 +0100, "Parker, Andrew (UK Filton)" <<a href="mailto:Andrew.Parker2@baesystems.com">Andrew.Parker2@baesystems.com</a>> wrote:<br>
> Well that's a worry, no error from:<br>
> MatSetOption(_storage,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);<br>
><br>
> Still slow as hell, same behaviour as before. I'm now using:<br>
><br>
> MatCreate(PETSC_COMM_SELF,&_storage);<br>
> MatSetType(_storage, MATSEQBAIJ);<br>
> MatSetOption(_storage,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);<br>
><br>
> MatSetSizes(_storage,PETSC_DECIDE,PETSC_DECIDE,numVars*numLocs,numVars*n<br>
> umLocs);<br>
> MatSetFromOptions(_storage);<br>
> MatSeqBAIJSetPreallocation(_storage,numVars,PETSC_NULL,sparsityStart);<br></blockquote><div><br></div><div>Then there is something wrong in your code at large that we cannot</div><div>see from this small snippet. Can you change a PETSc example into</div>
<div>something that exhibits this behavior, like KSP ex2?</div><div><br></div><div>Also, you can go in with the debugger and see what is happening. I am guessing</div><div>you switch the matrix you are using (so options do not take effect), or recreate</div>
<div>it, etc.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
This should work if you call both MatSetSizes and MatSetType before<br>
MatSetOption. There are technical reasons for this, mostly that it's<br>
difficult to cache all the options and get them handled in a consistent<br>
and debuggable manner once the implementation is chosen.<br>
<br>
Unless someone disagrees, I'll make it an error to call MatSetOptions()<br>
before the implementation is available (so you would get a useful error<br>
with the usage above, instead of the option just being ignored).<br>
<font color="#888888"><br>
Jed<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>