<div class="gmail_quote">On Wed, Aug 31, 2011 at 10:02, Likun Tan <span dir="ltr">&lt;<a href="mailto:likunt@andrew.cmu.edu">likunt@andrew.cmu.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":2f4">MatCreateSeqDense(PETSC_COMM_SELF, M, M, PESTC_NULL, &amp;A)<br></div></blockquote><div><br></div><div>yes</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":2f4">
MatCreateMPIDense(PETSC_COMM_WORLD, PETSC_DECIDE, PETSC_DECIDE, M, N,<br>
PETSC_NULL, &amp;B)<br></div></blockquote><div><br></div><div>No, use MatCreateSeqDense() here too. Do you also need the result array on every process?</div><div><br></div><div>PetscInt n = PETSC_DECIDE;</div><div>PetscSplitOwnership(PETSC_COMM_WORLD,&amp;n,&amp;N);</div>
<div>MatCreateSeqDense(PETSC_COMM_SELF,M,n,PETSC_NULL,&amp;B);</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":2f4">
MatSetValues() //Set values to A and B<br>
MatCholeskyFactor()// Factorization<br></div></blockquote><div><br></div><div>MatDuplicate(B,MAT_DO_NOT_COPY_VALUES,&amp;X);</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div id=":2f4">
MatMatSolve()</div></blockquote><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div id=":2f4">
The 3D array is generated before setting values to A and B. It comes from<br>
some known function evaluation, an i need the array in every process.</div></blockquote></div><br><div>Okay, just do the same thing on every process, but only set the values into B for the part that will be done locally.</div>