Hi Jed,<br><br>Thank you for your suggestions.<br><br>Best,<br>Rongliang<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 17 Nov 2011 12:50:23 -0600<br>
From: Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>><br>
Subject: Re: [petsc-users] KSPGMRESOrthog costs too much time<br>
To: PETSc users list <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br>
Message-ID:<br>
<CAM9tzSkqexpY9RD4Z=<a href="mailto:huP25P1yA4viKqSKFTb5hxZQcyZrU1rg@mail.gmail.com">huP25P1yA4viKqSKFTb5hxZQcyZrU1rg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Thu, Nov 17, 2011 at 12:18, Rongliang Chen <<a href="mailto:rongliang.chan@gmail.com">rongliang.chan@gmail.com</a>>wrote:<br>
<br>
> I am using the composite pc now not the PCMG:<br>
><br>
> ierr = PCCompositeAddPC(finepc,PCSHELL);CHKERRQ(ierr);<br>
> ierr = PCCompositeAddPC(finepc,PCASM);CHKERRQ(ierr);<br>
><br>
> ierr = PCCompositeGetPC(finepc,0,&coarsesolve);CHKERRQ(ierr);<br>
> ierr = PCShellSetContext(coarsesolve,ctx);CHKERRQ(ierr);<br>
> ierr = PCShellSetApply(coarsesolve,<br>
> CoarseSolvePCApply);CHKERRQ(ierr);<br>
><br>
> ierr = PCCompositeGetPC(finepc,1,&asmpc);CHKERRQ(ierr);<br>
> ierr = PCSetOptionsPrefix(asmpc,"fine_");CHKERRQ(ierr);<br>
> ierr = PCSetFromOptions(asmpc);CHKERRQ(ierr);<br>
><br>
> ierr = PCSetType(asmpc,PCASM);CHKERRQ(ierr);<br>
> ierr = PCASMSetOverlap(asmpc,0);CHKERRQ(ierr);<br>
> ierr = PCASMSetLocalSubdomains(asmpc,1,&grid->df_global_asm,<br>
> PETSC_NULL);CHKERRQ(ierr);<br>
><br>
<br>
You can make your own event for the coarse level solve. Using PCMG instead<br>
of PCComposite would make your code more flexible, so you may want to<br>
consider doing it at some point.<br>
<br>
<br>
><br>
> I just use two level method now and it is not very easy to try more levels<br>
> since I am using unstructure meshes.<br>
> I tried to solve the coarse level exactly by LU and it works well if the<br>
> coarse problem is small. When the coarse problem is large, LU is also very<br>
> slow (when the fine level problem is large, I can not use very small coarse<br>
> level problem). I found that nearly 90% of the time is spent on the coarse<br>
> level when the number of processor is large (np >512), so I want to know<br>
> which step of the coarse level solver costs the most of the time. Thanks.<br>
><br>
<br>
This is a common problem. Depending on your equations, you might be able to<br>
solve the coarse-level problem using algebraic multigrid. Try<br>
-coarse_pc_type gamg (or however you set up the options prefixes; maybe<br>
also "hypre" or "ml" if you have those installed).<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111117/81aa79c0/attachment-0001.htm" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111117/81aa79c0/attachment-0001.htm</a>><br>
<br>
<br>
</blockquote></div><br>