<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <br>
    <div class="moz-cite-prefix">On 28/3/2018 5:45 PM, Matthew Knepley
      wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAMYG4GkNpKcrty_eV2RKDWx5zL=SKXggSZnyo-N1KHD7HDE7zg@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Tue, Mar 27, 2018 at 10:17 PM, TAY
            wee-beng <span dir="ltr"><<a
                href="mailto:zonexo@gmail.com" target="_blank"
                moz-do-not-send="true">zonexo@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <p>Hi Dave,<br>
                  <br>
                  I looked at the output using log_view and re-compile.
                  However, although I use the same options "-xHost -g
                  -O3 -openmp" (some filenames and dir names are now
                  different but they are actually the same), I still get
                  different results timing. I have attach both, fast and
                  slow. So what else can I do to pinpoint the
                  differences?</p>
              </div>
            </blockquote>
            <div>The solver options must be different. In Fast, there is
              almost no time in LUFactor, but in Slow its half the time.</div>
            <div><br>
            </div>
            <div>   Matt <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Hi Matt,<br>
    <br>
    Finally found that it was because I was using KSPRICHARDSON in the
    new code. KSPGMRES in the old code is much faster.<br>
    <br>
    I also tried cg, lsqr, fgmres. CG and GMRES seem similar in term of
    best performance. Are there any other recommendations to try? The
    Poisson eqn is symmetric.<br>
    <br>
    I also tried -pc_type mg -pc_mg_nlevels 2 instead of
    -poisson_pc_type gamg -poisson_pc_gamg_agg_nsmooths 1.<br>
    <br>
    It reduces the runtime from 2.25 to 1.46min.<br>
    <br>
    However, I found that my subroutine is very similar to my momentum
    subroutine, which is based on KSPSolve:<br>
    <br>
    0. DMDACreate, DMDACreate3d etc<br>
    1. Assemble matrix<br>
    2. KSPSetOperators, KSPSetType etc<br>
    3. KSPSolve<br>
    <br>
    However, the 2D Poisson example in ex5f.F90 uses SNESSetDM,
    SNESSolve etc. So does it matter if I use SNESSolve or KSPSolve if
    I'm using -pc_type mg?<br>
    <br>
    <blockquote type="cite"
cite="mid:CAMYG4GkNpKcrty_eV2RKDWx5zL=SKXggSZnyo-N1KHD7HDE7zg@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">
            <blockquote class="gmail_quote" style="margin:0 0 0
              .8ex;border-left:1px #ccc solid;padding-left:1ex">
              <div text="#000000" bgcolor="#FFFFFF">
                <pre class="m_-6652733264220142091moz-signature" cols="72">Thank you very much.

Yours sincerely,

==============================<wbr>==================
TAY Wee-Beng (Zheng Weiming) 郑伟明
Personal research webpage: <a class="m_-6652733264220142091moz-txt-link-freetext" href="http://tayweebeng.wixsite.com/website" target="_blank" moz-do-not-send="true">http://tayweebeng.wixsite.com/<wbr>website</a>
Youtube research showcase: <a class="m_-6652733264220142091moz-txt-link-freetext" href="https://www.youtube.com/channel/UC72ZHtvQNMpNs2uRTSToiLA" target="_blank" moz-do-not-send="true">https://www.youtube.com/<wbr>channel/<wbr>UC72ZHtvQNMpNs2uRTSToiLA</a>
linkedin: <a class="m_-6652733264220142091moz-txt-link-abbreviated" href="http://www.linkedin.com/in/tay-weebeng" target="_blank" moz-do-not-send="true">www.linkedin.com/in/tay-<wbr>weebeng</a>
==============================<wbr>==================</pre>
                <div class="m_-6652733264220142091moz-cite-prefix">On
                  27/3/2018 5:22 PM, Dave May wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr"><br>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On 27 March 2018 at
                        10:16, TAY wee-beng <span dir="ltr"><<a
                            href="mailto:zonexo@gmail.com"
                            target="_blank" moz-do-not-send="true">zonexo@gmail.com</a>></span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">Hi,<br>
                          <br>
                          I have been compiling and building different
                          version of my CFD with the intel 2016, 2018
                          compilers, and also different compiling
                          options.<br>
                          <br>
                          I tested a version of my a.out and it is much
                          faster than the other a.out, using only 3 min
                          instead of more than 10min to solve a certain
                          case using GAMG.<br>
                          <br>
                          However, I can't recall how it was compiled. I
                          only know that I used the intel 2016 compiler.<br>
                          <br>
                          So is there any way I can find out how the
                          a.out was compiled? Like what options were
                          used?</blockquote>
                        <div><br>
                        </div>
                        <div>Since you posted to the list I presume
                          "a.out" links against petsc...</div>
                        <div>If so, run your code with </div>
                        <div>  -log_view</div>
                        <div><br>
                        </div>
                        <div>Upon calling PetscFinalize(), you will get
                          all the options given to PETSc configure, plus
                          the CFLAGS, link lines, etc.</div>
                        <div><br>
                        </div>
                      </div>
                    </div>
                  </div>
                </blockquote>
                <br>
              </div>
            </blockquote>
          </div>
          <br>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div class="gmail_signature" data-smartmail="gmail_signature">
            <div dir="ltr">
              <div>
                <div dir="ltr">
                  <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>
                  <div><br>
                  </div>
                  <div><a href="http://www.caam.rice.edu/%7Emk51/"
                      target="_blank" moz-do-not-send="true">https://www.cse.buffalo.edu/~knepley/</a><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
  </body>
</html>