<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Hi,<br>
    <br>
    Sorry about that. I just run interactively to get the output.<br>
    <br>
    Now I issued :<br>
    <br>
    mpiexec -np 1 ./a.out&nbsp; -ksp_type gmres -ksp_gmres_restart 1000
    -ksp_gmres_modifiedgramschmidt -ksp_monitor_true_residual -ksp_view
    -pc_type asm -sub_pc_type lu &gt; log1<br>
    <br>
    Same for the fgmres. Hope it's ok now.<br>
    <br>
    Thanks!<br>
    <pre class="moz-signature" cols="72">Yours sincerely,

TAY wee-beng</pre>
    <br>
    On 10/7/2011 12:26 AM, Matthew Knepley wrote:
    <blockquote
cite="mid:CAMYG4G=SXftxRVqt4A=BrWwrD35g7gK3OuYi7cuuNbSiJmAO9w@mail.gmail.com"
      type="cite">2011/7/9 TAY wee-beng <span dir="ltr">&lt;<a
          moz-do-not-send="true" href="mailto:zonexo@gmail.com">zonexo@gmail.com</a>&gt;</span><br>
      <div class="gmail_quote">
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div bgcolor="#ffffff" text="#000000"> Hi Jed, <br>
            <br>
            I have attached the output runing under linux. It's only
            running with 1 processor. I am using runge kutta 3rd order
            to solve my problem, so there's 3 substeps per time step ie
            I need to solve the x/y momentum eqns 3 times per time step.<br>
          </div>
        </blockquote>
        <div><br>
        </div>
        <div>1) As Jed said, you have repeated output. Something is
          wrong with your MPI setup. I suspect you are using</div>
        <div>&nbsp; &nbsp; the wrong mpiexec. Please do not send parallel results
          until your serial results work.</div>
        <div><br>
        </div>
        <div>2) Always run with -ksp_view when you send results</div>
        <div><br>
        </div>
        <div>3) You did not try using LU as Jed suggested.</div>
        <div><br>
        </div>
        <div>&nbsp; &nbsp;Matt</div>
        <div>&nbsp;</div>
        <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
          0.8ex; border-left: 1px solid rgb(204, 204, 204);
          padding-left: 1ex;">
          <div bgcolor="#ffffff" text="#000000"> The error occurs at
            t=2, substep=2. It stated in the output.<br>
            <br>
            Btw, I am solving the x and y momentum eqns separately,
            since they are independent of one another. How can I solve
            it together?<br>
            <br>
            My code is:<br>
            <br>
            call
            MatSetValues(A_semi_x,1,II,1,JJ,semi_mat_x(k,kk),INSERT_VALUES,ierr)
            ...<br>
            <br>
            call MatAssemblyBegin(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)<br>
            call MatAssemblyEnd(A_semi_x,MAT_FINAL_ASSEMBLY,ierr)<br>
            <br>
            call KSPGetPC(ksp_semi_x,pc_semi_x,ierr)<br>
            ksptype=KSPBCGS<br>
            call KSPSetType(ksp_semi_x,ksptype,ierr)<br>
            call KSPSetFromOptions(ksp_semi_x,ierr)<br>
            <br>
            tol=1.e-5<br>
            <br>
            call
KSPSetTolerances(ksp_semi_x,tol,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_DOUBLE_PRECISION,PETSC_DEFAULT_INTEGER,ierr)<br>
            <br>
            exactly the same for y...<br>
            <br>
            call VecAssemblyBegin(b_rhs_semi_x,ierr)<br>
            call VecAssemblyEnd(b_rhs_semi_x,ierr)<br>
            <br>
            call VecAssemblyBegin(xx_semi_x,ierr)<br>
            call VecAssemblyEnd(xx_semi_x,ierr)<br>
            &nbsp;&nbsp;&nbsp; <br>
            call
            KSPSetOperators(ksp_semi_x,A_semi_x,A_semi_x,SAME_NONZERO_PATTERN,ierr)<br>
            call KSPSolve(ksp_semi_x,b_rhs_semi_x,xx_semi_x,ierr)<br>
            call KSPGetConvergedReason(ksp_semi_x,reason,ierr)<br>
            <br>
            exactly the same for y...<br>
            <br>
            Thanks alot!<br>
            <pre cols="72">Yours sincerely,

TAY wee-beng</pre>
            <br>
            On 9/7/2011 12:26 AM, Jed Brown wrote:
            <blockquote type="cite">
              <div class="gmail_quote">On Fri, Jul 8, 2011 at 17:17, TAY
                wee-beng <span dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:zonexo@gmail.com" target="_blank">zonexo@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  <div bgcolor="#ffffff" text="#000000"> Hi Jed,<br>
                    <br>
                    This is my output when the error happens for gmres:<br>
                    <br>
                    &nbsp; 2 KSP preconditioned resid norm
                    1.556688898463e+007 true resid norm 2.58995443<br>
                    8801e+003 ||Ae||/||Ax|| 1.232088736212e+003<br>
                    &nbsp; 2 KSP preconditioned resid norm
                    1.556688898463e+007 true resid norm 2.58995443<br>
                    8801e+003 ||Ae||/||Ax|| 1.232088736212e+003<br>
                    &nbsp; 3 KSP preconditioned resid norm
                    1.207952812560e+003 true resid norm 9.05939430<br>
                    1179e+003 ||Ae||/||Ax|| 4.309719703237e+003<br>
                    &nbsp; 3 KSP preconditioned resid norm
                    1.207952812560e+003 true resid norm 9.05939430<br>
                    1179e+003 ||Ae||/||Ax|| 4.309719703237e+003&nbsp;3 KSP
                    preconditioned resid norm 1.207952812560e+003 true
                    resid norm 9.05939430<br>
                    1179e+003 ||Ae||/||Ax|| 4.309719703237e+003<br>
                    &nbsp; 3 KSP preconditioned resid norm
                    1.207952812560e+003 true resid norm 9.05939430<br>
                    1179e+003 ||Ae||/||Ax|| 4.309719703237e+003<br>
                    &nbsp; 3 KSP preconditioned resid norm
                    1.207952812560e+003 true resid norm 9.05939430<br>
                    1179e+003 ||Ae||/||Ax|| 4.309719703237e+003<br>
                    &nbsp; 4 KSP preconditioned resid norm
                    3.815055004710e+001 true resid norm 1.96385966<br>
                    1729e+002 ||Ae||/||Ax|| 9.342439899591e+001<br>
                    &nbsp; 4 KSP preconditioned resid norm
                    3.815055004710e+001 true resid norm 1.96385966<br>
                    1729e+002 ||Ae||/||Ax|| 9.342439899591e+001<br>
                    &nbsp; 4 KSP preconditioned resid norm
                    3.815055004710e+001 true resid norm 1.96385966<br>
                    1729e+002 ||Ae||/||Ax|| 9.342439899591e+001<br>
                    &nbsp; 4 KSP preconditioned resid norm
                    3.815055004710e+001 true resid norm 1.96385966<br>
                    1729e+002 ||Ae||/||Ax|| 9.342439899591e+001<br>
                    &nbsp; 4 KSP preconditioned resid norm
                    3.815055004710e+001 true resid norm 1.96385966<br>
                    1729e+002 ||Ae||/||Ax|| 9.342439899591e+001<br>
                  </div>
                </blockquote>
                <div><br>
                </div>
                <div>Why is the same line output multiple times? Do you
                  have an MPI problem?</div>
                <div><br>
                </div>
                <div>This convergence looks funky; I suspect your
                  preconditioner is singular and/or nonlinear. Please
                  send -ksp_view output as you are running here and with
                  -pc_type asm -sub_pc_type lu.</div>
                <div>&nbsp;</div>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">
                  <div bgcolor="#ffffff" text="#000000"> <br>
                    for fgmres:<br>
                    <br>
                    &nbsp;34 KSP preconditioned resid norm
                    2.428114102327e-005 true resid norm 3.35941610<br>
                    6265e-005 ||Ae||/||Ax|| 1.598129588716e-005<br>
                    &nbsp;34 KSP preconditioned resid norm
                    2.428114102327e-005 true resid norm 3.35941610<br>
                    6265e-005 ||Ae||/||Ax|| 1.598129588716e-005<br>
                    &nbsp;35 KSP preconditioned resid norm
                    2.200715659545e-005 true resid norm 3.88294769<br>
                    5703e-005 ||Ae||/||Ax|| 1.847182191086e-005<br>
                    &nbsp;35 KSP preconditioned resid norm
                    2.200715659545e-005 true resid norm 3.88294769<br>
                    5703e-005 ||Ae||/||Ax|| 1.847182191086e-005<br>
                    &nbsp;35 KSP preconditioned resid norm
                    2.200715659545e-005 true resid norm 3.88294769<br>
                    5703e-005 ||Ae||/||Ax|| 1.847182191086e-005<br>
                    &nbsp;35 KSP preconditioned resid norm
                    2.200715659545e-005 true resid norm 3.88294769<br>
                    5703e-005 ||Ae||/||Ax|| 1.847182191086e-005<br>
                    &nbsp;35 KSP preconditioned resid norm
                    2.200715659545e-005 true resid norm 3.88294769<br>
                    5703e-005 ||Ae||/||Ax|| 1.847182191086e-005<br>
                    &nbsp;36 KSP preconditioned resid norm
                    2.011575409369e-005 true resid norm 3.89282805<br>
                    6204e-005 ||Ae||/||Ax|| 1.851882441357e-005<br>
                    &nbsp;36 KSP preconditioned resid norm
                    2.011575409369e-005 true resid norm 3.89282805<br>
                    6204e-005 ||Ae||/||Ax|| 1.851882441357e-005<br>
                    &nbsp;36 KSP preconditioned resid norm
                    2.011575409369e-005 true resid norm 3.89282805<br>
                    6204e-005 ||Ae||/||Ax|| 1.851882441357e-005<br>
                    &nbsp;36 KSP preconditioned resid norm
                    2.011575409369e-005 true resid norm 3.89282805<br>
                    6204e-005 ||Ae||/||Ax|| 1.851882441357e-005<br>
                    &nbsp;36 KSP preconditioned resid norm
                    2.011575409369e-005 true resid norm 3.89282805<br>
                    6204e-005 ||Ae||/||Ax|| 1.851882441357e-005<br>
                    <br>
                    Btw, I am solving the x and y momentum eqns so there
                    's 2 eqns to solve.</div>
                </blockquote>
                <div><br>
                </div>
                <div>Do you solve them separately or both at once? (We
                  usually recommend the latter.)</div>
                <div>&nbsp;</div>
              </div>
            </blockquote>
          </div>
        </blockquote>
      </div>
      <br>
      <br clear="all">
      <br>
      -- <br>
      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<br>
    </blockquote>
  </body>
</html>