<div dir="ltr">Awesome. Thanks for doing this Jed.<br><br><div class="gmail_quote">On Sat, Oct 20, 2012 at 5:38 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Fri, Oct 19, 2012 at 6:03 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>></span> wrote:<br>

</div><div class="gmail_quote"><div class="im"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Cool. Jed, could you please point me to an example/tutorial for this? I'm going to give it a shot.</div></blockquote><div><br></div></div><div>This works for SeqAIJ:</div><div><br></div><div>  ierr = MatGetOrdering(A,ordering,&rowperm,&colperm);CHKERRQ(ierr);</div>


<div><div>  ierr = MatPermute(A,rowperm,colperm,&Aperm);CHKERRQ(ierr);</div><div>  ierr = VecPermute(b,colperm,PETSC_FALSE);CHKERRQ(ierr);</div></div><div><br></div><div>  ierr = KSPSetOperators(ksp,Aperm,Aperm,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);</div>


<div>  ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr);</div><div>  ierr = VecPermute(x,rowperm,PETSC_TRUE);CHKERRQ(ierr);</div><div><br></div><div>Now x is the solution back in the original ordering.</div><div><br></div><div><br>


</div><div>There is an example in petsc-dev now.</div><div><br></div><div><a href="https://bitbucket.org/petsc/petsc-dev/src/tip/src/ksp/ksp/examples/tutorials/ex18.c" target="_blank">https://bitbucket.org/petsc/petsc-dev/src/tip/src/ksp/ksp/examples/tutorials/ex18.c</a></div>


<div><br></div><div>It should work with petsc-3.3 in serial, but you need petsc-dev for parallel MatPermute.</div><div><div class="h5"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div><br></div><div>Thanks<div><div><br><br><div class="gmail_quote">On Fri, Oct 19, 2012 at 3:57 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>




<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_You_ can compute a MatOrdering, MatPermute and VecPermute, solve, and permute back. Profile and if the solve is faster, go ahead and lift the ordering code back into your mesh.<div>




<div><br><br><div class="gmail_quote">On Fri, Oct 19, 2012 at 5:48 PM, Mohammad Mirzadeh <span dir="ltr"><<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@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 dir="ltr">Thanks Barry. I think I agree with you that right way to do it is through mesh setup. As a matter of fact I have done that for some of my problems. Yet, I can think of situations where that kind of support might be beneficial, especially if someone (a.k.a me in this case!) is looking for a 'dirty and fast' fix. <div>







<br></div><div>Anyway, I still believe that in long term, one should do the partitioning in a pre-processing step anyways and so there may not be much incentive for adding such a support.</div><div><br></div><div>Thanks again,</div>







<div>Mohammad<div><div><br><br><div class="gmail_quote">On Fri, Oct 19, 2012 at 3:00 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<br>
   Mohammad,<br>
<br>
     We've thought about adding this kind of support this over the years but always came to the conclusion that "the right way to do it" is during the mesh setup step.<br>
<span><font color="#888888"><br>
   Barry<br>
</font></span><div><div><br>
<br>
On Oct 19, 2012, at 4:16 PM, Mohammad Mirzadeh <<a href="mailto:mirzadeh@gmail.com" target="_blank">mirzadeh@gmail.com</a>> wrote:<br>
<br>
> Hi guys,<br>
><br>
> Quick question. *After* the matrix is setup, is it possible to ask PETSc to renumber the nodes internally in the KSPSolve phase to minimize communications for MatMul inside the solver? Can I use the MatPartitioning object for this or is that only intended to partition the mesh as a pre-processing step?<br>








><br>
> Thanks<br>
<br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div></div></div><br>
</blockquote></div><br></div>