<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 14, 2016 at 12:58 PM, Chih-Hao Chen <span dir="ltr"><<a href="mailto:chih-hao.chen2@mail.mcgill.ca" target="_blank">chih-hao.chen2@mail.mcgill.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Hell Matt,
<div><br></div>
<div>Thanks for the information.</div>
<div>I am still trying it now.</div>
<div>But I observed an interesting thing about the performance difference when running ex8.c about the ASM.</div>
<div>When using Mvapich2 for mph, its convergence speed is much faster than OpenMPI.</div>
<div>Is it becasue the ASM function has been optimized based on Mvapich2?</div></div></blockquote><div><br></div><div>No, it is probably because you have a different partition on the two cases. For performance questions, we</div><div>need to see the output of -log_summary for each case.</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="word-wrap:break-word">
<div>Thanks very much.</div>
<div><br>
</div>
<div><br>
</div>
<div>Best,</div>
<div>Chih-Hao<br>
<div>
<blockquote type="cite">
<div>On Mar 10, 2016, at 4:28 PM, Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:</div>
<br>
<div>
<div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div class="gmail_extra">
<div class="gmail_quote">On Thu, Mar 10, 2016 at 3:23 PM, Chih-Hao Chen<span> </span><span dir="ltr"><<a href="mailto:chih-hao.chen2@mail.mcgill.ca" target="_blank">chih-hao.chen2@mail.mcgill.ca</a>></span><span> </span>wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><span style="font-size:14px">Hello PETSc members,</span>
<div><span style="font-size:14px"><br>
</span></div>
<div><span style="font-size:14px"><br>
</span></div>
<div><span style="font-size:14px">Sorry for asking for help about the ASM in petsc4py.</span></div>
<div><span style="font-size:14px">Currently I am using your ASM as my preconditioned in my solver.</span></div>
<div><span style="font-size:14px">I know how to setup the PCASM based on the ex8.c in the following link.</span></div>
<div><span style="font-size:14px"><a href="http://www.mcs.anl.gov/petsc/petsc-3.4/src/ksp/ksp/examples/tutorials/ex8.c" target="_blank">http://www.mcs.anl.gov/petsc/petsc-3.4/src/ksp/ksp/examples/tutorials/ex8.c</a></span></div>
<div><span style="font-size:14px"><br>
</span></div>
<div><span style="font-size:14px">But when using the function “getASMSubKSP” in petsc4py, </span></div>
<div><span style="font-size:14px">I have tried several methods, but still cannot get the subksp from each mpi.</span></div>
</div>
</blockquote>
<div><br>
</div>
<div>The subKSPs do not have to do with MPI. On each rank, you get the local KSPs.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div><span style="font-size:14px">Here is the snippet of the code of the function.</span></div>
<div>
<pre><span style="font-size:14px">def getASMSubKSP(self):
<a name="1027171775_-9334186_l-266"></a>        cdef PetscInt i = 0, n = 0
<a name="1027171775_-9334186_l-267"></a>        cdef PetscKSP *p = NULL
<a name="1027171775_-9334186_l-268"></a>        CHKERR( PCASMGetSubKSP(self.pc, <span>&</span>n, NULL, <span>&</span>p) )
<a name="1027171775_-9334186_l-269"></a>        return <span>[</span><span>ref_KSP</span><span>(</span><span>p</span><span>[</span><span>i</span><span>]</span>) for i from 0 <span><</span>= i <span><n</span><span>]</span></span></pre>
<div><span style="font-size:14px"><br>
</span></div>
</div>
<div><span style="font-size:14px">In ex8.c, we could use a “FOR” loop to access the indiivdual subksp.</span></div>
<div><span style="font-size:14px">But in python, could I use “FOR” loop to get all the subksps with:</span></div>
<div><span style="font-size:14px"><br>
</span></div>
<div><span style="font-size:14px">subksp[i] = pc.getASMSubKSP[i] </span></div>
</div>
</blockquote>
<div><br>
</div>
<div>I do not understand this, but I think the answer is no.</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div><span style="font-size:14px">Another question is in ex8.c, it seems I don’t need to do any setup to decompose the RHS vector.</span></div>
<div><span style="font-size:14px">But do I need to decompose the RHS vector with any settings if I don’t use PETSc solvers but with your preconditioners?</span></div>
</div>
</blockquote>
<div><br>
</div>
<div>I do not understand what you mean by "decompose the RHS vector".</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-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word">
<div><span style="font-size:14px">Thanks very much.</span></div>
<div><span style="font-size:14px"><br>
</span></div>
<div><span style="font-size:14px">Best,</span></div>
<div><span style="font-size:14px">Chih-Hao</span></div>
<div><span style="font-size:14px"><br>
</span></div>
<div><br>
</div>
</div>
</blockquote>
</div>
<br>
<br clear="all"><span class="HOEnZb"><font color="#888888">
<div><br>
</div>
--<span> </span><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></div>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</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>