<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Apr 13, 2018 at 5:45 AM, 我 <span dir="ltr"><<a href="mailto:dayedut123@163.com" target="_blank">dayedut123@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><br>Thanks for your reply! And sorry for my late answer. I want to parallel a particle-method code and solve Ax=b in each timestep. In this code, each partition forms a CSR matrix and assembles the final coefficient matrix by MatCreateMPIAIJWithArrays. But, the domain decomposition makes that the particles' order doesn't follow the original order. In other words, Solution Vector x follows the original order but Vector b follows a new order due to domain decomposition. So I want to change the Vector b's order and Matrix A's row order to follow the origin order. I have been considering to change my parallel code in these days, but I didn't find a best way. I'm considering to multiply a renumbering identity matrix at both sides of the equation with function MatMatMult. Do you have any suggestions for this problem? If the function MatMatMult can influence the parallel efficiency obviously?<br></div></blockquote><div><br></div><div>I would not do this. The amount of communication to assemble those things would most likely swamp the speedup you gained.</div><div>If anything, reoder x. However, why would you need to be the original order ever? Just use the order after partition. That is how</div><div>parallel codes work for the most part.</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"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Thanks again!</div><div>Daye</div><br><br><div style="zoom:1"></div><div id="m_-8453917964918570104divNeteaseMailCard"></div><br><pre><br>At 2018-04-10 22:07:04, "Smith, Barry F." <<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>> wrote:
>
> When and where do you want to change the row order?
>
> For PETSc and external factorization based solvers this is handled automatically, no need to do anything.
>
> The ordering of matrix rows corresponds to the ordering of the vectors; almost always one partitions and orders the vectors based on the mesh that underlies the problem and there is no reason to reorder once the layout is initially determined.
>
> Barry
>
>
>
>> On Apr 10, 2018, at 8:42 AM, 我 <<a href="mailto:dayedut123@163.com" target="_blank">dayedut123@163.com</a>> wrote:
>>
>> Hello,
>> I want to change the row order of a sparse matrix. Are there any build-in functions and suggestions?
>> Thank you very much!
>> Daye
>>
>>
>>
>
</pre></div><br><br><span title="neteasefooter"><p> </p></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><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><div><br></div><div><a href="http://www.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div>
</div></div>