<br><br><div class="gmail_quote">On Tue, May 15, 2012 at 9:55 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">Dmitry,<div><br></div><div>thanks for remind. I have a new question about PCASM / PCGASM: </div><div><br></div><div>can I get the restricted extension operators, which maps an overlapping subdomain solution</div>
<div>to the global domain?</div></div></blockquote><div> </div><div>I'm not exactly sure what you mean.</div><div><br></div><div>Are you talking about embedding the subdomain vectors back into the original vector?</div>
<div>If so, there is substantial difference in how this is handled in ASM and GASM:</div><div>ASM has a bunch of sequential vectors that can be scattered back into the global vector,</div><div>because the subdomains are always local to at most one processor. </div>
<div><br></div><div>In the GASM case this is rather different, since the subdomains can live on arbitrary subcommunicators </div><div>and there is only one scatter, which is applied to the direct sum of all the subdomain vectors on the original communicator. I'm not sure how useful that last scatter would be for you, since the details of the structure </div>
<div>of the direct sum vector are internal to GASM.</div><div><br></div><div>Dmitry. </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><br></div><div>Thanks!</div><div><div class="h5"><div><br><div><div><div><div>On May 15, 2012, at 3:29 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">There are some additional minor fixes that mostly have to do with outputting the subdomain information with -pc_gasm_view_subdomains (in PCView()) and with -pc_gasm_print_subdomains (during PCSetUp()).<div>
You might want to pull those latest patches, but it won't interfere with your work if you don't use subdomain output.</div>
<div><br></div><div>Thanks.</div><div>Dmitry.<br><br><div class="gmail_quote">On Tue, May 15, 2012 at 7:14 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">Dmitry,<div><br></div><div>thanks for reply. I re-download the codes and tried it again and now it works correctly!</div>
<div><br></div><div>Everything seems ok.</div><div><br></div><div>Thanks,</div><div>Hui</div><div><div><div><br></div><div><br><div><div>On May 15, 2012, at 2:01 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">
Hui,<div>I'm trying to reproduce this problem, unsuccessfully, so far.</div><div>One thing that looks odd is that the output below claims the PC is of type "asm", even though you are running with -dd_type gasm. Could you verify that's the correct output?</div>
<div><br></div><div>Here's the output I get with </div><div>${PETSC_DIR}/${PETSC_ARCH}/bin/mpiexec -np 1 ./gasm_test -n 64 -dd_type asm -dd_ksp_view</div><div><br></div><div><div>PC Object:(dd_) 1 MPI processes</div>
<div>
type: asm</div><div> Additive Schwarz: total subdomain blocks = 2, user-defined overlap</div><div> Additive Schwarz: restriction/interpolation type - RESTRICT</div><div> Local solve is same for all blocks, in the following KSP and PC objects:</div>
<div> KSP Object: (dd_sub_) 1 MPI processes</div><div> type: preonly</div><div> maximum iterations=10000, initial guess is zero</div><div> tolerances: relative=1e-05, absolute=1e-50, divergence=10000</div>
<div> left preconditioning</div><div> using NONE norm type for convergence test</div></div><div> <snip></div><div><br></div><div>and with </div><div><div>${PETSC_DIR}/${PETSC_ARCH}/bin/mpiexec -np 1 ./gasm_test -n 64 -dd_type gasm -dd_ksp_view</div>
<div><br></div><div><div>PC Object:(dd_) 1 MPI processes</div><div> type: gasm</div><div> Generalized additive Schwarz:</div><div> Restriction/interpolation type: RESTRICT</div><div> user-defined overlap</div><div> total number of subdomains = 2</div>
<div> number of local subdomains = 2</div><div> max number of local subdomains = 2</div><div> [0:1] number of locally-supported subdomains = 2</div><div> Subdomain solver info is as follows:</div></div><div> <snip></div>
<div><br></div><div>What convergence are you seeing with the two PC types? It should be the same with 1 and 2 procs for both PCASM and PCGASM. </div><div><br></div><div>Thanks.</div><div>Dmitry.</div><div><br></div><div class="gmail_quote">
On Tue, May 15, 2012 at 4:03 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">Dmitry,<div><br></div><div>I got the newest petsc-dev and I run the test by</div><div><br></div><div> mpirun -np 1 ./gasm_test -dd_type gasm -n 64 -dd_ksp_view</div><div><br></div><div>
which gives the following output</div><div><br></div><div><div>PC Object:(dd_) 1 MPI processes</div><div> type: asm</div><div> Additive Schwarz: total subdomain blocks = 1, amount of overlap = 1</div></div><div> ^^^</div>
<div> note the above number, it should be 2 </div><div><br></div><div>While PCASM has no such problem.</div><div><br></div><div>Thanks,</div><div>Hui</div><div><br></div><div><br><div>
<div><br></div><blockquote type="cite"><div><div>Hui,<div><br>The convergence issue should be resolved in the latest petsc-dev.</div><div>I'm attaching a slightly modified gasm_test.c (reflecting some upcoming API changes) </div>
<div>that should verify that.</div><div>
<br></div><div>Let me know if it works for you.</div><div>Thanks.</div><div>Dmitry.<br><div class="gmail_quote">On Fri, May 11, 2012 at 12:31 PM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">Hi Dmitry,<div><br></div><div>thanks for useful hints. Good day!</div><span><font color="#888888"><div>
<br></div><div>Hui</div></font></span><div><div><div><br><div><div>On May 11, 2012, at 7:17 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">You can call PCSetUp(pc) on either ASM or GASM, and that will destroy and recreate the matrices (including calling <div>
your modification subroutine), but not the subdomains or the subdomain solvers. </div><div>If you just want to modify the submatrices, you can call PC(G)ASMGetSubmatrices() and modify the matrices it returns</div>
<div>(in the same order as the subdomains were set). That's a bit of a hack, since you will essentially be modifying the PC's internal data structures. As long as you are careful, you should be okay, since you already effectively have the same type of access to the submatrices through the Modify callback.</div>
<div><br></div><div>Dmitry.</div><div><div><br><div class="gmail_quote">On Fri, May 11, 2012 at 11:52 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">I just have a question about reuse of PCASM or PCGASM.<div>Suppose I have seted up the PCASM and related KSP and I solved one time.</div>
<div>Next for the same linear system (matrix and RHS), I just want PCASM modify the submatrices (PCSetModifySubmatrices) in a different way, using the same routine for modifying but with</div><div>different user context for the modifying routine. </div>
<div><br></div><div>What can I do for this task? Currently, I destroy the KSP and re-construct it. I guess</div><div>even for PCASM I can re-use it because the partition of subdomains remain the same.</div><div><br></div>
<div>Thanks!</div><div><div><div><br><div><br><div><div>On May 10, 2012, at 6:37 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">Hui,<div>There've been several changes to PCGASM ahead of the new release.</div>
<div>Let me go back and see if it affected the convergence problem.</div><div>Dmitry.<br><br><div class="gmail_quote">On Thu, May 10, 2012 at 4:16 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">Hi Dmitry,<div><br></div><div>is there any news about PCGASM? </div><div><br></div><div>
thanks,</div><div>Hui</div><div><div><div><br><div><div>On Feb 20, 2012, at 6:38 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">Okay, thanks.<div>I'll take a look.</div><div><br></div><div>Dmitry.<br>
<br><div class="gmail_quote">On Mon, Feb 20, 2012 at 11:30 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">For reference, my results are attached.<div><br></div><div>asm1.txt for asm with 1 process,</div>
<div>asm2.txt for asm with 2 processes,</div><div>gasm1.txt for gasm with 1 process, (with the iteration numbers different from others)</div><div>gasm2.txt for gasm with 2 processes</div><div><br></div><div></div></div><br>
<div style="word-wrap:break-word"><div></div></div><br><div style="word-wrap:break-word"><div></div></div><br><div style="word-wrap:break-word"><div></div></div><br><div style="word-wrap:break-word"><div></div><div><br></div>
<div>thank you,</div><div>Hui<br><div><br><div><div>On Feb 20, 2012, at 3:06 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">On Mon, Feb 20, 2012 at 12:59 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word"><br><div><div><div>On Feb 20, 2012, at 12:41 AM, Dmitry Karpeev wrote:</div><br><blockquote type="cite"><br><br><div class="gmail_quote">On Sun, Feb 19, 2012 at 3:08 PM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.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="word-wrap:break-word">I have a new problem: the results from ASM and GASM are different and it seems<div>GASM has something wrong with SetModifySubMatrices. Numerical tests are with </div><div>each subdomain supported only by one subdomain. There are no problems when</div>
<div>I did not modify submatrices. But when I modify submatrices, there are problems</div><div>with GASM but no problems with ASM. </div><div><br></div><div>For example, I use two subdomains. In the first case each subdomain is supported by</div>
<div>one processor and there seems no problem with GASM. But when I use run my program </div><div>with only one proc. so that it supports both of the two subdomains, the iteration </div><div>number is different from the first case and is much larger. On the other hand</div>
<div>ASM has no such problem.</div></div></blockquote><div> </div><div>Are the solutions the same?</div><div>What problem are you solving?</div></div></blockquote><div><br></div></div><div>Yes, the solutions are the same. That's why ASM gives the same results with one or</div>
<div>two processors. But GASM did not. </div></div></div></blockquote><div>Sorry, I wasn't clear: ASM and GASM produced different solutions in the case of two domains per processor?</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><div>I'm solving the Helmholtz equation. Maybe </div><div>I can prepare a simpler example to show this difference.</div></div></div></blockquote><div>That would be helpful. </div>
<div>Thanks.</div><div><br></div><div>Dmitry. </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><div><div><br><blockquote type="cite">
<div class="gmail_quote"><div><br></div><div>Dmitry. </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><div><div><div><br><div><br><div><div>On Feb 15, 2012, at 6:46 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite"><div bgcolor="#FFFFFF"><div>You should be able to. </div>
<div>This behavior is the same as in PCASM,</div><div>except in GASM the matrices live on subcommunicators.</div><div>I am in transit right now, but I can take a closer look in Friday.</div><div><br></div><div>Dmitry<br>
<br>
<br></div><div><br>On Feb 15, 2012, at 8:07, Hui Zhang <<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><div>On Feb 15, 2012, at 11:19 AM, Hui Zhang wrote:</div>
<div><br><blockquote type="cite"><div style="word-wrap:break-word">Hi Dmitry,<div><br></div><div>thanks a lot! Currently, I'm not using ISColoring. Just comes another question</div><div>on PCGASMSetModifySubMatrices(). The user provided function has the prototype</div>
<div><br></div><div><span style="font-family:monospace;white-space:pre-wrap"> func (</span><span style="font-family:monospace;white-space:pre-wrap"><a>PC</a></span><span style="font-family:monospace;white-space:pre-wrap"> pc,</span><span style="font-family:monospace;white-space:pre-wrap"><a>PetscInt</a></span><span style="font-family:monospace;white-space:pre-wrap"> nsub,</span><span style="font-family:monospace;white-space:pre-wrap"><a>IS</a></span><span style="font-family:monospace;white-space:pre-wrap"> *row,</span><span style="font-family:monospace;white-space:pre-wrap"><a>IS</a></span><span style="font-family:monospace;white-space:pre-wrap"> *col,</span><span style="font-family:monospace;white-space:pre-wrap"><a>Mat</a></span><span style="font-family:monospace;white-space:pre-wrap"> *submat,void *ctx);</span></div>
<div><span style="font-family:monospace;white-space:pre-wrap"><br></span></div><div><span style="white-space:pre-wrap">I think the coloumns from the parameter 'col' are always the same <font face="monospace">as the rows </font></span></div>
<div><span style="white-space:pre-wrap"><font face="monospace">from the parameter 'row'. Because PCGASMSetLocalSubdomains() only accepts </font></span></div><div><span style="white-space:pre-wrap"><font face="monospace">index sets but not rows and columns. Has I misunderstood something?</font></span></div>
</div></blockquote><div><br></div><div>As I tested, the row and col are always the same. </div><div><br></div><div>I have a new question. Am I allowed to SetLocalToGlobalMapping() for the submat's</div><div>in the above func()?</div>
<div><br></div><div>thanks,</div><div>Hui</div><br><blockquote type="cite"><div style="word-wrap:break-word"><span style="white-space:pre-wrap"><font face="monospace"><br></font></span></div><div><span style="white-space:pre-wrap"><font face="monospace">thanks,</font></span></div>
<div><span style="white-space:pre-wrap"><font face="monospace">Hui</font></span></div><div><br></div><div><br><div><div>On Feb 11, 2012, at 3:36 PM, Dmitry Karpeev wrote:</div><br><blockquote type="cite">Yes, that's right.<div>
There is no good way to help the user assemble the subdomains at the moment beyond the 2D stuff.</div><div>It is expected that they are generated from mesh subdomains.</div><div>Each IS does carry the subdomains subcomm.</div>
<div><br></div><div>There is ISColoringToList() that is supposed to convert a "coloring" of indices to an array of ISs,</div><div>each having the indices with the same color and the subcomm that supports that color. It is</div>
<div>largely untested, though. You could try using it and give us feedback on any problems you encounter.</div><div><br></div><div>Dmitry.</div><div><br><br><div class="gmail_quote">On Sat, Feb 11, 2012 at 6:06 AM, Hui Zhang <span dir="ltr"><<a href="mailto:mike.hui.zhang@hotmail.com" target="_blank"></a><a href="mailto:mike.hui.zhang@hotmail.com" target="_blank">mike.hui.zhang@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">About PCGASMSetLocalSubdomains(), in the case of one subdomain supported by<br>
multiple processors, shall I always create the arguments 'is[s]' and 'is_local[s]'<br>
in a subcommunicator consisting of processors supporting the subdomain 's'?<br>
<br>
The source code of PCGASMCreateSubdomains2D() seemingly does so.<br>
<br>
Thanks,<br>
Hui<br>
<br>
</blockquote></div><br></div>
</blockquote></div><br></div></blockquote></div><br></div></blockquote></div></blockquote></div><br></div></div></div></div></div></div></blockquote></div><br>
</blockquote></div></div></div><br></div></blockquote></div><br>
</blockquote></div><br></div></div></div><br></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></blockquote></div><br></div></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</div></div><span><gasm_test.c></span></blockquote></div><br></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></blockquote></div><br></div>
</blockquote></div><br></div></div></div></div></div></div></blockquote></div><br>