On Mon, Oct 22, 2012 at 6:18 PM, Andrew Spott <span dir="ltr"><<a href="mailto:andrew.spott@gmail.com" target="_blank">andrew.spott@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">
I want to preallocate a MPIAIJ matrix correctly, using<br>
<br>
MatMPIAIJSetPreallocation(A, PETSC_NULL, dnnz, PETSC_NULL, onnz);<br>
<br>
The problem is that I don't know how many local rows, or where the local columns are until I run said function, but I need to know the number of local rows and local columns so I can determine the correct preallocation.<br>
<br>
So how am I supposed to do a proper preallocation? Is there something I'm missing, or do I just guess and correct? If I know that my matrix is evenly sparse, should I just assume that it is evenly split up among processors, and go from there? Or should I "MatSetUp", determine the correct preallocation and then do a MatMPIAIJSetPreallocation?</blockquote>
<div><br></div><div>I think you are looking for</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscSplitOwnership.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Sys/PetscSplitOwnership.html</a></div>
<div><br></div><div>If you do not specify the layout, this function is called to partition your matrix.</div><div><br></div><div> Thanks,</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">
<span class="HOEnZb"><font color="#888888">
-Andrew</font></span></blockquote></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>