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><div><br></div><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 class="h5">
<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"><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></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></div>