<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Sep 15, 2016 at 4:23 AM, Ji Zhang <span dir="ltr"><<a href="mailto:gotofd@gmail.com" target="_blank">gotofd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Thanks Matt. It works well for signal core. But is there any solution if I need a MPI program?<br></div></div></blockquote><div><br></div><div>It unclear what the stuff below would mean in parallel.</div><div><br></div><div>If you want to assemble several blocks of a parallel matrix that looks like serial matrices, then use</div><div><br></div><div> <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatGetLocalSubMatrix.html</a></div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div>Thanks. <br></div><div class="gmail_extra"><br clear="all"><div><div>Wayne</div></div>
<br><div class="gmail_quote">On Tue, Sep 13, 2016 at 9:30 AM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Mon, Sep 12, 2016 at 8:24 PM, Ji Zhang <span dir="ltr"><<a href="mailto:gotofd@gmail.com" target="_blank">gotofd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>Dear all, <br><br>I'm using petsc4py and now face some problems.<br>I have a number of small petsc dense matrices mij, and I want to construct them to a big matrix M like this:<br><br> [ m11 m12 m13 ]<br> M = | m21 m22 m23 | ,<br> [ m31 m32 m33 ]<br>How could I do it effectively?<br><br>Now I'm using the code below:<br><br> # get indexes of matrix mij<br> index1_begin, index1_end = getindex_i( )<br> index2_begin, index2_end = getindex_j( )<br> M[index1_begin:index1_end, index2_begin:index2_end] = mij[:, :]<br>which report such error messages:<br><br> petsc4py.PETSc.Error: error code 56<br> [0] MatGetValues() line 1818 in /home/zhangji/PycharmProjects/<wbr>petsc-petsc-31a1859eaff6/src/m<wbr>at/interface/matrix.c<br> [0] MatGetValues_MPIDense() line 154 in /home/zhangji/PycharmProjects/<wbr>petsc-petsc-31a1859eaff6/src/m<wbr>at/impls/dense/mpi/mpidense.c<br></div></div></div></blockquote><div><br></div></span><div>Make M a sequential dense matrix.</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div> [0] No support for this operation for this object type<br> [0] Only local values currently supported<br><br></div>Thanks. <br><br></div><br><div>2016-09-13</div><span><span><span><div>Best, </div><div>Regards,</div><div>Zhang Ji </div><div>Beijing Computational Science Research Center </div><div>E-mail: <a href="mailto:gotofd@gmail.com" target="_blank">gotofd@gmail.com</a><br><br><br></div></span></span></span></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div>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</div>
</font></span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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</div>
</div></div>