<p>
Dear Barry,
</p>
<p>
<br>
</p>
<p>
Thank you. For MPI, MVAPICH-2.3.5 is used on my cluster by default, I add PetscLogStagePush("Calling KSPSolve()...") and PetscLogStagePop(). I am using other numerical software and have called PETSc only when solving linear system through PETSc interface supported by the software, but I'm not sure if I have added it correctly. I put the result and info into attachment, please check it.
</p>
<p>
<br>
</p>
<p>
<br>
</p>
<p>
Thanks,
</p>
<p>
Gang
</p>
<br>
<br>
<blockquote name="replyContent" class="ReferenceQuote" style="padding-left:5px;margin-left:5px;border-left:#b6b6b6 2px solid;margin-right:0;">
-----原始邮件-----<br>
<b>发件人:</b><span id="rc_from">"Barry Smith" <bsmith@petsc.dev></span><br>
<b>发送时间:</b><span id="rc_senttime">2021-02-18 10:52:11 (星期四)</span><br>
<b>收件人:</b> "赵刚" <zhaog6@lsec.cc.ac.cn><br>
<b>抄送:</b> PETSc <petsc-users@mcs.anl.gov><br>
<b>主题:</b> Re: [petsc-users] An issue about pipelined CG and Gropp's CG<br>
<br>
<div class="">
<br class="">
</div>
<div class="">
First please see <a href="https://www.mcs.anl.gov/petsc/documentation/faq.html#pipelined" class="">https://www.mcs.anl.gov/petsc/documentation/faq.html#pipelined</a> and verify that the MPI you are using satisfies the requirements and you have appropriate MPI environmental variables set (if needed).
</div>
<div class="">
<br class="">
</div>
<div class="">
<br class="">
</div>
Then please add a stage around the actual computation to get a more useful summary.
<div class="">
<br class="">
</div>
<div class="">
Organize your code like so
</div>
<div class="">
<br class="">
</div>
<div class="">
...
</div>
<div class="">
KSPSetUp()
</div>
<div class="">
PetscLogStagePush(a stage you created)
</div>
<div class="">
KSPSolve()
</div>
<div class="">
PetscLogStagePop()
</div>
<div class="">
...
</div>
<div class="">
<br class="">
<div>
It is unclear where much of the time of your code is being spent, by adding the stage we'll have a clear picture of the time in the actual solver. There are examples of using PetscLogStagePush() in the source.
</div>
<div>
<br class="">
</div>
<div>
With the new -log_view files you generate with these two changes we can get a handle on where the time is being spent and why the pipelining is or is not helping.
</div>
<div>
<br class="">
</div>
<div>
Barry
</div>
<div>
<br class="">
<blockquote type="cite" class="">
<div class="">
On Feb 17, 2021, at 8:31 PM, 赵刚 <<a href="mailto:zhaog6@lsec.cc.ac.cn" class="">zhaog6@lsec.cc.ac.cn</a>> wrote:
</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
Dear Barry,<br class="">
<br class="">
Thank you for your prompt reply. I run ~16M DOFs on 32 nodes (36 cores per node), but CG seems to be faster than pipelined CG and Gropp's CG, I'm puzzled and haven't figured out why. Put the performance output into attachment, please check it.<br class="">
<br class="">
<br class="">
<br class="">
Thanks,<br class="">
Gang<br class="">
<br class="">
<br class="">
> -----原始邮件-----<br class="">
> 发件人: "Barry Smith" <<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>><br class="">
> 发送时间: 2021-02-18 09:17:17 (星期四)<br class="">
> 收件人: "赵刚" <<a href="mailto:zhaog6@lsec.cc.ac.cn" class="">zhaog6@lsec.cc.ac.cn</a>><br class="">
> 抄送: PETSc <<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>><br class="">
> 主题: Re: [petsc-users] An issue about pipelined CG and Gropp's CG<br class="">
> <br class="">
> <br class="">
> <br class="">
> > On Feb 17, 2021, at 6:47 PM, 赵刚 <<a href="mailto:zhaog6@lsec.cc.ac.cn" class="">zhaog6@lsec.cc.ac.cn</a>> wrote:<br class="">
> > <br class="">
> > Dear PETSc team,<br class="">
> > <br class="">
> > I am interested in pipelined CG (-ksp_type pipecg) and Gropp's CG (-ksp_type groppcg), it is expected that this iterative method with pipelined has advantages over traditional CG in the case of multiple processes. So I'd like to ask for Poisson problem, how many computing nodes do I need to show the advantages of pipelined CG or Gropp's CG over CG (No preconditioner is used)?<br class="">
> > <br class="">
> > Currently, I can only use up to 32 nodes (36 cores per nodes) at most on my cluster, but both "pipecg" and "groppcg" seem to be no advantage over "cg" when I solve Poisson equations with homogeneous Dirichlet BC in [0, 1]^2 (remain 20K~60K DOFs per process). I guess the reason would be too few computing nodes.<br class="">
> <br class="">
> 900 cores (assuming they are not memory bandwidth bound) might be enough to see some differences but the differences are likely so small compared to other parallel issues that affect performance that you see no consistently measurable difference.<br class="">
> <br class="">
> Run with -log_view three cases, no pipeline and the two pipelines and send the output. By studying where the time is spent in the different regions of the code with this output one may be able to say something about the pipeline affect.<br class="">
> <br class="">
> Barry<br class="">
> <br class="">
> <br class="">
> > <br class="">
> > Because I am calling PETSc via other numerical software, if need, I would mail related performance information to you by using command line options suggested by PETSc. Thank you.<br class="">
> > <br class="">
> > <br class="">
> > Thanks,<br class="">
> > Gang<br class="">
</<a href="mailto:zhaog6@lsec.cc.ac.cn" class="">zhaog6@lsec.cc.ac.cn</a>></<a href="mailto:petsc-users@mcs.anl.gov" class="">petsc-users@mcs.anl.gov</a>></<a href="mailto:zhaog6@lsec.cc.ac.cn" class="">zhaog6@lsec.cc.ac.cn</a>></<a href="mailto:bsmith@petsc.dev" class="">bsmith@petsc.dev</a>><span id="cid:183022BF-624E-4B80-9D40-D6D636C3C13C"><cg.out></span><span id="cid:25834817-6AAF-45C3-8744-3E1014D4B3F1"><groppcg.out></span><span id="cid:0E3B6B32-70D7-4500-BF88-104498A1A973"><pipecg.out></span>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>