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