Thanks. Than Than Thanks.<br><br><div class="gmail_quote">On Sat, Jul 7, 2012 at 6:17 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sat, Jul 7, 2012 at 11:08 AM, Xin Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</a>></span> wrote:<br></div><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So if it is written as<div>if PETSc.COMM_WORLD.get_Rank() == 0:</div><div>L.setPreallocationNNZ((3,2))</div><div><br></div><div>will it achieve what I intend to do?</div></blockquote><div><br></div></div><div>No. No no no. You do not have to call setPreallocation(). That is why I said (twice) that</div>
<div>the matrix is already preallocated. If something is "already preallocated", it does not</div><div>have to be allocated again.</div><div><div class="h5"><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">
<div><br><br><div class="gmail_quote">
On Sat, Jul 7, 2012 at 6:04 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Sat, Jul 7, 2012 at 11:02 AM, Xin Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</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">
yeap...sorry...<div>L=DA.createMat()</div><div><br></div><div>then </div><div>L.setPreallocationNNZ((3,2))<br></div></blockquote><div><br></div><div>As I said, its already preallocated.</div><div><br></div><div> Matt</div>
<div><div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_quote">On Sat, Jul 7, 2012 at 6:01 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Sat, Jul 7, 2012 at 10:58 AM, Xin Zhao <span dir="ltr"><<a href="mailto:sean.null@gmail.com" target="_blank">sean.null@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<div><br><div>I generate a matrix L by<div>DA =PETSc.DA().create(...some...)<br><div>L = DA.create()</div></div></div></div></blockquote><div><br></div></div><div>Is this createMatrix()? The matrix returned from a DA is already preallocated.</div>
<div><br></div><div> Matt</div><div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div>Then I want to preallocate memory for L</div>
<div>L.setPreallocationNNZ((3,2))</div>
<div>This works when for mpiexec -np 1</div>
<div>but it gives the error message below when mpiexec -np 4</div><div><br></div><div>[3] MatAnyAIJSetPreallocation() line 311 in petsc4py-1.2/src/include/custom.h</div><div>[3] Operation done in wrong order</div><div>[3] matrix is already preallocated</div>
</div><div><br></div><div>How to solve this?</div></div></div><div><br></div><div>Thanks in advance.</div><div><br></div><div>Cheers,</div><div>Xin</div>
</blockquote></div></div><span><font color="#888888"><br><br clear="all"><span><font color="#888888"><span><font color="#888888"><div><br></div>-- <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>
</font></span></font></span></font></span></blockquote></div><span><font color="#888888"><br></font></span></div><span><font color="#888888">
</font></span></blockquote></div></div></div><span><font color="#888888"><div><div><br><br clear="all"><div><br></div>-- <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>
</div></div></font></span></blockquote></div><br></div>
</blockquote></div></div></div><div class="HOEnZb"><div class="h5"><br><br clear="all"><div><br></div>-- <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>
</div></div></blockquote></div><br>