<div dir="ltr">I'm glad it worked. Its funny this problem has been in the repo since last year but in this last week it has been blowing up all over the place.<div><br></div><div>In a nutshell, Chebyshev polynomials have some really nice properties and multigrid smoothers, especially in an AMG context where you don't know anything about the spectra of your (diagonally preconditioned) operator. [skip some linear algebra background]. Chebyshev needs the largest eigenvalue (lam) of your operator, which is easy to compute in theory. Two problems: 1) if you underestimate this lam you die as you have seen, and 2) there is no provable way to get lam cheaply.  But in practice we can get pretty good (under)estimates of lam with Krylov methods (Power method being the simplest of these).  We then increase this estimate with a safety factor like 1.05. Works but not provable.</div><div><br></div><div>Last year we made a change that made this estimate bad in some/many cases.  As far as what are you looking at, these iterations are converging on "max" (lam), at each level, eg:</div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><span style="font-size:12.8px">35 KSP Residual norm 1.017388214943e-04 % max 1.570600354842e+00 min 1.495477205174e-03 max/min 1.050233563847e+03</span><br></font></div><div><font face="monospace, monospace">                                         ^^^^^^^^^^^^^^^^^^^^^</font></div><div><br>This should asymptot nicely to the true lam. The "bug" that we had, and you can probably see it if you go back to the bad solver parameters but use a lot of eigest iterations (ie, 50 here), results in what looks like nice convergence and then all of the sudden lam ("max") jumps up after many iterations. Yikes! This is probably more of a problem with simple test problems than the real world [skip explanation], but it is a big problem in practice as you have seen.</div><div><br></div><div>Again, sorry for the mess,</div><div>Mark</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 23, 2016 at 12:31 PM, Sanjay Govindjee <span dir="ltr"><<a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000">
    Mark,<br>
      Yes, the problem is finite elasticity.  I re-ran the problem with
    the options table and output shown below.  It converges now<br>
    based on the residual tolerance test (KSPConvergedReason == 2); note
    I am using Using Petsc Release Version 3.7.0, Apr, 25, 2016.<br>
    Seems to work now with these options; wish I understood what they
    all meant!<br>
    -sanjay<br>
    <br>
    ------ Options Table ------<br>
    <br>
    -ksp_chebyshev_esteig_random<br>
    -ksp_monitor<br>
    -ksp_type cg<br>
    -ksp_view<br>
    -log_view<br>
    -mg_levels_esteig_ksp_max_it 50<br>
    -mg_levels_esteig_ksp_monitor_singular_value<br>
    -mg_levels_esteig_ksp_type cg<br>
    -mg_levels_ksp_chebyshev_esteig 0,0.05,0,1.05<br>
    -mg_levels_ksp_type chebyshev<br>
    -mg_levels_pc_type sor<br>
    -options_left<br>
    -pc_gamg_agg_nsmooths 1<br>
    -pc_gamg_square_graph 1<span class=""><br>
    -pc_gamg_type agg<br>
    -pc_type gamg<br>
    #End of PETSc Option Table entries<br>
    There is one unused database option. It is:<br>
    Option left: name:-ksp_chebyshev_esteig_random (no value)<br>
    <br>
    <br></span>
    ---- Output -----<br>
    <br>
    <br>
       Residual norm =     6.4807407E-02    1.0000000E+00      t=    
    0.06     0.00<br>
       Residual norm =     6.4807407E-02    1.0000000E+00      t=    
    2.72     0.00<br>
          0 KSP Residual norm 1.560868061707e-03 % max
    1.000000000000e+00 min 1.000000000000e+00 max/min 1.000000000000e+00<br>
          1 KSP Residual norm 6.096709155146e-04 % max
    5.751224548776e-01 min 5.751224548776e-01 max/min 1.000000000000e+00<br>
          2 KSP Residual norm 7.011069458089e-04 % max
    8.790398458008e-01 min 1.423643814416e-01 max/min 6.174577073983e+00<br>
          3 KSP Residual norm 7.860563886831e-04 % max
    9.381463130007e-01 min 6.370569326093e-02 max/min 1.472625545661e+01<br>
          4 KSP Residual norm 7.281118133903e-04 % max
    9.663599650986e-01 min 3.450830062982e-02 max/min 2.800369613865e+01<br>
          5 KSP Residual norm 7.399083718116e-04 % max
    9.794646011330e-01 min 2.160135448201e-02 max/min 4.534274005590e+01<br>
          6 KSP Residual norm 7.629904179692e-04 % max
    9.849620569978e-01 min 1.481091947823e-02 max/min 6.650242467697e+01<br>
          7 KSP Residual norm 7.698477913710e-04 % max
    9.886850579079e-01 min 1.045801989510e-02 max/min 9.453845640235e+01<br>
          8 KSP Residual norm 8.217081868349e-04 % max
    9.919371306726e-01 min 7.371001382474e-03 max/min 1.345729133942e+02<br>
          9 KSP Residual norm 7.524701879786e-04 % max
    9.942899758738e-01 min 5.827670079091e-03 max/min 1.706153509687e+02<br>
         10 KSP Residual norm 6.944661718672e-04 % max
    1.081740430310e+00 min 5.160677620664e-03 max/min 2.096120916327e+02<br>
         11 KSP Residual norm 5.551504568073e-04 % max
    1.486860759049e+00 min 4.666379506027e-03 max/min 3.186326266710e+02<br>
         12 KSP Residual norm 5.259305993307e-04 % max
    1.564857844056e+00 min 4.221790647720e-03 max/min 3.706621134569e+02<br>
         13 KSP Residual norm 5.156103593875e-04 % max
    1.569917781391e+00 min 3.850994097592e-03 max/min 4.076655901322e+02<br>
         14 KSP Residual norm 5.312020352146e-04 % max
    1.570323151514e+00 min 3.568538377912e-03 max/min 4.400465919699e+02<br>
         15 KSP Residual norm 5.305598654979e-04 % max
    1.570412447356e+00 min 3.341861320427e-03 max/min 4.699214888890e+02<br>
         16 KSP Residual norm 5.058601071413e-04 % max
    1.570467828098e+00 min 3.091912672470e-03 max/min 5.079276145416e+02<br>
         17 KSP Residual norm 5.485622395473e-04 % max
    1.570494963661e+00 min 2.876900954621e-03 max/min 5.458981690483e+02<br>
         18 KSP Residual norm 5.368711040867e-04 % max
    1.570521333658e+00 min 2.664379213208e-03 max/min 5.894511283800e+02<br>
         19 KSP Residual norm 5.198795692341e-04 % max
    1.570548096173e+00 min 2.476198885896e-03 max/min 6.342576539867e+02<br>
         20 KSP Residual norm 5.958949153283e-04 % max
    1.570562153443e+00 min 2.291602609346e-03 max/min 6.853553696602e+02<br>
         21 KSP Residual norm 6.378632372927e-04 % max
    1.570571141557e+00 min 2.073298632606e-03 max/min 7.575228753145e+02<br>
         22 KSP Residual norm 5.831338029614e-04 % max
    1.570577774384e+00 min 1.893683789633e-03 max/min 8.293769968259e+02<br>
         23 KSP Residual norm 4.875913917209e-04 % max
    1.570583697638e+00 min 1.759110933887e-03 max/min 8.928281141244e+02<br>
         24 KSP Residual norm 4.107781613610e-04 % max
    1.570587819069e+00 min 1.672892328012e-03 max/min 9.388457300985e+02<br>
         25 KSP Residual norm 3.715001142988e-04 % max
    1.570590462451e+00 min 1.617963853373e-03 max/min 9.707203650914e+02<br>
         26 KSP Residual norm 2.991751132378e-04 % max
    1.570593709995e+00 min 1.573420350354e-03 max/min 9.982035059109e+02<br>
         27 KSP Residual norm 2.208369736689e-04 % max
    1.570597161312e+00 min 1.545543181679e-03 max/min 1.016210468870e+03<br>
         28 KSP Residual norm 1.811301040805e-04 % max
    1.570599147395e+00 min 1.529650294818e-03 max/min 1.026770074647e+03<br>
         29 KSP Residual norm 1.466232980955e-04 % max
    1.570599898730e+00 min 1.518818086503e-03 max/min 1.034093491964e+03<br>
         30 KSP Residual norm 1.206956326419e-04 % max
    1.570600148946e+00 min 1.512437955816e-03 max/min 1.038455920063e+03<br>
         31 KSP Residual norm 8.815660316339e-05 % max
    1.570600276978e+00 min 1.508452842477e-03 max/min 1.041199454667e+03<br>
         32 KSP Residual norm 8.077031357734e-05 % max
    1.570600325445e+00 min 1.505888596198e-03 max/min 1.042972454543e+03<br>
         33 KSP Residual norm 8.820553812137e-05 % max
    1.570600343673e+00 min 1.503328090889e-03 max/min 1.044748882956e+03<br>
         34 KSP Residual norm 9.117950808819e-05 % max
    1.570600352355e+00 min 1.499931693668e-03 max/min 1.047114584608e+03<br>
         35 KSP Residual norm 1.017388214943e-04 % max
    1.570600354842e+00 min 1.495477205174e-03 max/min 1.050233563847e+03<br>
         36 KSP Residual norm 8.890686455242e-05 % max
    1.570600355527e+00 min 1.491021415006e-03 max/min 1.053372097624e+03<br>
         37 KSP Residual norm 6.145275695828e-05 % max
    1.570600355891e+00 min 1.487712171225e-03 max/min 1.055715202355e+03<br>
         38 KSP Residual norm 4.601453163034e-05 % max
    1.570600356004e+00 min 1.486196684310e-03 max/min 1.056791723858e+03<br>
         39 KSP Residual norm 3.537992820781e-05 % max
    1.570600356044e+00 min 1.485426023422e-03 max/min 1.057340002989e+03<br>
         40 KSP Residual norm 2.801997681470e-05 % max
    1.570600356064e+00 min 1.484937369198e-03 max/min 1.057687946066e+03<br>
         41 KSP Residual norm 2.422931135206e-05 % max
    1.570600356072e+00 min 1.484576829299e-03 max/min 1.057944813010e+03<br>
         42 KSP Residual norm 2.099844940173e-05 % max
    1.570600356076e+00 min 1.484295103277e-03 max/min 1.058145615794e+03<br>
         43 KSP Residual norm 1.692165408662e-05 % max
    1.570600356077e+00 min 1.484073208085e-03 max/min 1.058303827278e+03<br>
         44 KSP Residual norm 1.303434704073e-05 % max
    1.570600356078e+00 min 1.483945099557e-03 max/min 1.058395190325e+03<br>
         45 KSP Residual norm 1.116085143372e-05 % max
    1.570600356078e+00 min 1.483862236504e-03 max/min 1.058454294098e+03<br>
         46 KSP Residual norm 1.042314767557e-05 % max
    1.570600356078e+00 min 1.483776389632e-03 max/min 1.058515533104e+03<br>
         47 KSP Residual norm 8.547779619028e-06 % max
    1.570600356078e+00 min 1.483710767635e-03 max/min 1.058562349440e+03<br>
         48 KSP Residual norm 5.686341715603e-06 % max
    1.570600356078e+00 min 1.483675385024e-03 max/min 1.058587593979e+03<br>
         49 KSP Residual norm 3.605023485024e-06 % max
    1.570600356078e+00 min 1.483660745235e-03 max/min 1.058598039425e+03<br>
         50 KSP Residual norm 2.272532759782e-06 % max
    1.570600356078e+00 min 1.483654995309e-03 max/min 1.058602142037e+03<br>
            0 KSP Residual norm 5.279802306740e-03 % max
    1.000000000000e+00 min 1.000000000000e+00 max/min 1.000000000000e+00<br>
            1 KSP Residual norm 3.528673026246e-03 % max
    3.090782483684e-01 min 3.090782483684e-01 max/min 1.000000000000e+00<br>
            2 KSP Residual norm 3.205752762808e-03 % max
    8.446523416360e-01 min 9.580457075356e-02 max/min 8.816409645096e+00<br>
            3 KSP Residual norm 2.374523626799e-03 % max
    9.504624619604e-01 min 6.564631404306e-02 max/min 1.447853509851e+01<br>
            4 KSP Residual norm 1.924918345847e-03 % max
    9.848656903443e-01 min 4.952831543265e-02 max/min 1.988490183325e+01<br>
            5 KSP Residual norm 6.808260964410e-04 % max
    9.938458367029e-01 min 4.251109574134e-02 max/min 2.337850434978e+01<br>
            6 KSP Residual norm 3.315021446270e-04 % max
    9.967726858804e-01 min 4.166488358467e-02 max/min 2.392356824554e+01<br>
            7 KSP Residual norm 1.314681668602e-04 % max
    9.982316137592e-01 min 4.143867906023e-02 max/min 2.408936858987e+01<br>
            8 KSP Residual norm 4.301436610738e-05 % max
    9.989590393061e-01 min 4.138618158843e-02 max/min 2.413750196238e+01<br>
            9 KSP Residual norm 8.016910487452e-06 % max
    9.994371206849e-01 min 4.138180175046e-02 max/min 2.415160960636e+01<br>
           10 KSP Residual norm 6.525723903099e-07 % max
    9.997527609942e-01 min 4.138161245544e-02 max/min 2.415934763467e+01<br>
           11 KSP Residual norm 8.205412727192e-08 % max
    9.998804196297e-01 min 4.138161047930e-02 max/min 2.416243370059e+01<br>
           12 KSP Residual norm 1.645897401565e-08 % max
    9.999250934790e-01 min 4.138161045086e-02 max/min 2.416351327521e+01<br>
           13 KSP Residual norm 2.636218490435e-09 % max
    9.999479210248e-01 min 4.138161044973e-02 max/min 2.416406491090e+01<br>
           14 KSP Residual norm 2.614816263321e-10 % max
    9.999674891694e-01 min 4.138161044968e-02 max/min 2.416453778147e+01<br>
           15 KSP Residual norm 2.309894761749e-11 % max
    9.999797578219e-01 min 4.138161044968e-02 max/min 2.416483425742e+01<br>
           16 KSP Residual norm 2.261461487058e-12 % max
    9.999874664751e-01 min 4.138161044968e-02 max/min 2.416502053952e+01<br>
           17 KSP Residual norm 2.659598917594e-13 % max
    9.999898150784e-01 min 4.138161044968e-02 max/min 2.416507729428e+01<br>
           18 KSP Residual norm 1.822011884274e-14 % max
    9.999918194957e-01 min 4.138161044968e-02 max/min 2.416512573167e+01<br>
           19 KSP Residual norm 1.042398553176e-15 % max
    9.999933278733e-01 min 4.138161044968e-02 max/min 2.416516218210e+01<br>
      0 KSP Residual norm 8.439161590194e-02 <br>
      1 KSP Residual norm 7.614890998257e-03 <br>
      2 KSP Residual norm 1.514029318872e-03 <br>
      3 KSP Residual norm 3.781832295258e-04 <br>
      4 KSP Residual norm 3.799411703870e-05 <br>
      5 KSP Residual norm 4.799680240826e-06 <br>
      6 KSP Residual norm 9.360965396987e-07 <br>
      7 KSP Residual norm 1.250237476907e-07 <br>
      8 KSP Residual norm 2.036465606099e-08 <br>
      9 KSP Residual norm 3.993471620298e-09 <br>
     10 KSP Residual norm 5.041262213944e-10 <br>
    KSP Object: 2 MPI processes<br>
      type: cg<br>
      maximum iterations=10000, initial guess is zero<br>
      tolerances:  relative=1e-08, absolute=1e-16, divergence=1e+16<br>
      left preconditioning<br>
      using PRECONDITIONED norm type for convergence test<br>
    PC Object: 2 MPI processes<br>
      type: gamg<br>
        MG: type is MULTIPLICATIVE, levels=3 cycles=v<br>
          Cycles per PCApply=1<br>
          Using Galerkin computed coarse grid matrices<br>
          GAMG specific options<br>
            Threshold for dropping small values from graph 0.<br>
            AGG specific options<br>
              Symmetric graph false<br>
      Coarse grid solver -- level -------------------------------<br>
        KSP Object:    (mg_coarse_)     2 MPI processes<br>
          type: preonly<br>
          maximum iterations=10000, initial guess is zero<br>
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.<br>
          left preconditioning<br>
          using NONE norm type for convergence test<br>
        PC Object:    (mg_coarse_)     2 MPI processes<br>
          type: bjacobi<br>
            block Jacobi: number of blocks = 2<br>
            Local solve is same for all blocks, in the following KSP and
    PC objects:<br>
          KSP Object:      (mg_coarse_sub_)       1 MPI processes<br>
            type: preonly<br>
            maximum iterations=1, initial guess is zero<br>
            tolerances:  relative=1e-05, absolute=1e-50,
    divergence=10000.<br>
            left preconditioning<br>
            using NONE norm type for convergence test<br>
          PC Object:      (mg_coarse_sub_)       1 MPI processes<br>
            type: lu<br>
              LU: out-of-place factorization<br>
              tolerance for zero pivot 2.22045e-14<br>
              using diagonal shift on blocks to prevent zero pivot
    [INBLOCKS]<br>
              matrix ordering: nd<br>
              factor fill ratio given 5., needed 1.<br>
                Factored matrix follows:<br>
                  Mat Object:               1 MPI processes<br>
                    type: seqaij<br>
                    rows=9, cols=9, bs=3<br>
                    package used to perform factorization: petsc<br>
                    total: nonzeros=81, allocated nonzeros=81<br>
                    total number of mallocs used during MatSetValues
    calls =0<br>
                      using I-node routines: found 2 nodes, limit used
    is 5<br>
            linear system matrix = precond matrix:<br>
            Mat Object:         1 MPI processes<br>
              type: seqaij<br>
              rows=9, cols=9, bs=3<br>
              total: nonzeros=81, allocated nonzeros=81<br>
              total number of mallocs used during MatSetValues calls =0<br>
                using I-node routines: found 2 nodes, limit used is 5<br>
          linear system matrix = precond matrix:<br>
          Mat Object:       2 MPI processes<br>
            type: mpiaij<br>
            rows=9, cols=9, bs=3<br>
            total: nonzeros=81, allocated nonzeros=81<br>
            total number of mallocs used during MatSetValues calls =0<br>
              using I-node (on process 0) routines: found 2 nodes, limit
    used is 5<br>
      Down solver (pre-smoother) on level 1
    -------------------------------<br>
        KSP Object:    (mg_levels_1_)     2 MPI processes<br>
          type: chebyshev<br>
            Chebyshev: eigenvalue estimates:  min = 0.0499997, max =
    1.04999<br>
            Chebyshev: eigenvalues estimated using cg with translations 
    [0. 0.05; 0. 1.05]<br>
            KSP Object:        (mg_levels_1_esteig_)         2 MPI
    processes<br>
              type: cg<br>
              maximum iterations=50, initial guess is zero<br>
              tolerances:  relative=1e-12, absolute=1e-50,
    divergence=10000.<br>
              left preconditioning<br>
              using PRECONDITIONED norm type for convergence test<br>
          maximum iterations=2<br>
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.<br>
          left preconditioning<br>
          using nonzero initial guess<br>
          using NONE norm type for convergence test<br>
        PC Object:    (mg_levels_1_)     2 MPI processes<br>
          type: sor<br>
            SOR: type = local_symmetric, iterations = 1, local
    iterations = 1, omega = 1.<br>
          linear system matrix = precond matrix:<br>
          Mat Object:       2 MPI processes<br>
            type: mpiaij<br>
            rows=54, cols=54, bs=3<br>
            total: nonzeros=1764, allocated nonzeros=1764<br>
            total number of mallocs used during MatSetValues calls =0<br>
              using I-node (on process 0) routines: found 18 nodes,
    limit used is 5<br>
      Up solver (post-smoother) same as down solver (pre-smoother)<br>
      Down solver (pre-smoother) on level 2
    -------------------------------<br>
        KSP Object:    (mg_levels_2_)     2 MPI processes<br>
          type: chebyshev<br>
            Chebyshev: eigenvalue estimates:  min = 0.07853, max =
    1.64913<br>
            Chebyshev: eigenvalues estimated using cg with translations 
    [0. 0.05; 0. 1.05]<br>
            KSP Object:        (mg_levels_2_esteig_)         2 MPI
    processes<br>
              type: cg<br>
              maximum iterations=50, initial guess is zero<br>
              tolerances:  relative=1e-12, absolute=1e-50,
    divergence=10000.<br>
              left preconditioning<br>
              using PRECONDITIONED norm type for convergence test<br>
          maximum iterations=2<br>
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000.<br>
          left preconditioning<br>
          using nonzero initial guess<br>
          using NONE norm type for convergence test<br>
        PC Object:    (mg_levels_2_)     2 MPI processes<br>
          type: sor<br>
            SOR: type = local_symmetric, iterations = 1, local
    iterations = 1, omega = 1.<br>
          linear system matrix = precond matrix:<br>
          Mat Object:       2 MPI processes<br>
            type: mpiaij<br>
            rows=882, cols=882, bs=2<br>
            total: nonzeros=26244, allocated nonzeros=26244<br>
            total number of mallocs used during MatSetValues calls =0<br>
              using I-node (on process 0) routines: found 189 nodes,
    limit used is 5<br>
      Up solver (post-smoother) same as down solver (pre-smoother)<br>
      linear system matrix = precond matrix:<br>
      Mat Object:   2 MPI processes<br>
        type: mpiaij<br>
        rows=882, cols=882, bs=2<br>
        total: nonzeros=26244, allocated nonzeros=26244<br>
        total number of mallocs used during MatSetValues calls =0<br>
          using I-node (on process 0) routines: found 189 nodes, limit
    used is 5<br>
    CONVERGENCE:  Satisfied residual tolerance Iterations =           10<div><div class="h5"><br>
    <br>
    <br>
    <div>On 5/22/16 3:02 PM, Mark Adams wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">I thought you would have this also, so
          add it (I assume this is 3D elasticity):</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">-pc_gamg_square_graph 1 </div>
        <div class="gmail_extra">-mg_levels_ksp_type chebyshev </div>
        <div class="gmail_extra">-mg_levels_pc_type sor <br>
        </div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Plus what I just mentioned:</div>
        <div class="gmail_extra"><br>
          -mg_levels_esteig_ksp_type cg <br>
          -mg_levels_ksp_chebyshev_esteig 0,0.05,0,1.05</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">Just for diagnostics add:</div>
        <div class="gmail_extra"><br>
        </div>
        <div class="gmail_extra">-mg_levels_esteig_ksp_max_it 50 <br>
        </div>
        <div class="gmail_extra">
          <div class="gmail_extra">-mg_levels_esteig_ksp_monitor_singular_value</div>
          <div class="gmail_extra"><span style="font-size:12.8px">-ksp_view</span><br>
          </div>
          <div class="gmail_extra"><br>
          </div>
          <div><br>
          </div>
        </div>
        <div class="gmail_extra"><br>
          <div class="gmail_quote">On Sun, May 22, 2016 at 5:38 PM,
            Sanjay Govindjee <span dir="ltr"><<a href="mailto:s_g@berkeley.edu" target="_blank"></a><a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>></span> wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000"> Mark, <br>
                  Can you give me the full option line that you want me
                to use?  I currently have:<br>
                <br>
                -ksp_type cg -ksp_monitor -ksp_chebyshev_esteig_random
                -log_view -pc_type gamg -pc_gamg_type agg
                -pc_gamg_agg_nsmooths 1 -options_left<span><font color="#888888"><br>
                    <br>
                    -sanjay</font></span>
                <div>
                  <div><br>
                    <br>
                    <div>On 5/22/16 2:29 PM, Mark Adams wrote:<br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">Humm, maybe we have version mixup:
                        <div><br>
                          <div>src/ksp/ksp/impls/cheby/cheby.c:    ierr
                            =
                            PetscOptionsBool("-ksp_chebyshev_esteig_random","Use
                            random right hand side for
estimate","KSPChebyshevEstEigSetUseRandom",cheb->userandom,&cheb->userandom<br>
                            <div><br>
                            </div>
                            <div>Also, you should use CG. These other
                              options are the defaults but CG is not:</div>
                            <div><br>
                            </div>
                            <div>-mg_levels_esteig_ksp_type cg </div>
                            <div>-mg_levels_esteig_ksp_max_it 10 </div>
                            <div>-mg_levels_ksp_chebyshev_esteig
                              0,0.05,0,1.05<br>
                            </div>
                          </div>
                        </div>
                        <div><br>
                        </div>
                        <div>Anyway. you can also run with -info, which
                          will be very noisy, but just grep for GAMG and
                          send me that.</div>
                        <div><br>
                        </div>
                        <div>Mark</div>
                        <div><br>
                        </div>
                        <div><br>
                        </div>
                      </div>
                      <div class="gmail_extra"><br>
                        <div class="gmail_quote">On Sat, May 21, 2016 at
                          6:03 PM, Sanjay Govindjee <span dir="ltr"><<a href="mailto:s_g@berkeley.edu" target="_blank"></a><a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>></span>
                          wrote:<br>
                          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
                            <div bgcolor="#FFFFFF" text="#000000"> Mark,<br>
                                I added the option you mentioned but it
                              seems not to use it; -options_left
                              reports:<br>
                              <br>
                              #PETSc Option Table entries:<br>
                              -ksp_chebyshev_esteig_random<br>
                              -ksp_monitor<br>
                              -ksp_type cg<br>
                              -log_view<br>
                              -options_left<br>
                              -pc_gamg_agg_nsmooths 1<br>
                              -pc_gamg_type agg<br>
                              -pc_type gamg<br>
                              #End of PETSc Option Table entries<br>
                              There is one unused database option. It
                              is:<br>
                              Option left:
                              name:-ksp_chebyshev_esteig_random (no
                              value)
                              <div>
                                <div><br>
                                  <br>
                                  <br>
                                  <div>On 5/21/16 12:36 PM, Mark Adams
                                    wrote:<br>
                                  </div>
                                  <blockquote type="cite">
                                    <div dir="ltr">Barry, this is
                                      probably the Chebyshev problem.
                                      <div><br>
                                      </div>
                                      <div>Sanjay, this is fixed but has
                                        not yet been moved to the master
                                        branch.  You can fix this now
                                        with with
                                        -ksp_chebyshev_esteig_random. 
                                        This should recover v3.5
                                        semantics.</div>
                                      <div><br>
                                      </div>
                                      <div>Mark </div>
                                      <div class="gmail_extra"><br>
                                        <div class="gmail_quote">On Thu,
                                          May 19, 2016 at 2:42 PM, Barry
                                          Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank"></a><a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span>
                                          wrote:<br>
                                          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><br>
                                               We see this occasionally,
                                            there is nothing in the
                                            definition of GAMG that
                                            guarantees a positive
                                            definite preconditioner even
                                            if the operator was positive
                                            definite so we don't think
                                            this is a bug in the code.
                                            We've found using a slightly
                                            stronger smoother, like one
                                            more smoothing step seems to
                                            remove the problem.<br>
                                            <br>
                                               Barry<br>
                                            <div>
                                              <div><br>
                                                > On May 19, 2016, at
                                                1:07 PM, Sanjay
                                                Govindjee <<a href="mailto:s_g@berkeley.edu" target="_blank"></a><a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>>
                                                wrote:<br>
                                                ><br>
                                                > I am trying to
                                                solve a very ordinary
                                                nonlinear elasticity
                                                problem<br>
                                                > using -ksp_type cg
                                                -pc_type gamg in PETSc
                                                3.7.0, which worked fine<br>
                                                > in PETSc 3.5.3.<br>
                                                ><br>
                                                > The problem I am
                                                seeing is on my first
                                                Newton iteration, the
                                                Ax=b<br>
                                                > solve returns with
                                                and Indefinite
                                                Preconditioner error
                                                (KSPGetConvergedReason
                                                == -8):<br>
                                                > (log_view.txt
                                                output also attached)<br>
                                                ><br>
                                                >   0 KSP Residual
                                                norm 8.411630828687e-02<br>
                                                >   1 KSP Residual
                                                norm 2.852209578900e-02<br>
                                                >   NO CONVERGENCE
                                                REASON:  Indefinite
                                                Preconditioner<br>
                                                >   NO CONVERGENCE
                                                REASON:  Indefinite
                                                Preconditioner<br>
                                                ><br>
                                                > On the next and
                                                subsequent Newton
                                                iterations, I see
                                                perfectly normal<br>
                                                > behavior and the
                                                problem converges
                                                quadratically.  The
                                                results look fine.<br>
                                                ><br>
                                                > I tried the same
                                                problem with -pc_type
                                                jacobi as well as
                                                super-lu, and mumps<br>
                                                > and they all work
                                                without complaint.<br>
                                                ><br>
                                                > My run line for
                                                GAMG is:<br>
                                                > -ksp_type cg
                                                -ksp_monitor -log_view
                                                -pc_type gamg
                                                -pc_gamg_type agg
                                                -pc_gamg_agg_nsmooths 1
                                                -options_left<br>
                                                ><br>
                                                > The code flow looks
                                                like:<br>
                                                ><br>
                                                > ! If no matrix
                                                allocation yet<br>
                                                > if(Kmat.eq.0) then<br>
                                                >   call
                                                MatCreate(PETSC_COMM_WORLD,Kmat,ierr)<br>
                                                >   call
                                                MatSetSizes(Kmat,numpeq,numpeq,PETSC_DETERMINE,PETSC_DETERMINE,ierr)<br>
                                                >   call
                                                MatSetBlockSize(Kmat,nsbk,ierr)<br>
                                                >   call
                                                MatSetFromOptions(Kmat,
                                                ierr)<br>
                                                >   call
                                                MatSetType(Kmat,MATAIJ,ierr)<br>
                                                >   call
MatMPIAIJSetPreallocation(Kmat,PETSC_NULL_INTEGER,mr(np(246)),PETSC_NULL_INTEGER,mr(np(247)),ierr)<br>
                                                >   call
                                                MatSeqAIJSetPreallocation(Kmat,PETSC_NULL_INTEGER,mr(np(246)),ierr)<br>
                                                > endif<br>
                                                ><br>
                                                > call
                                                MatZeroEntries(Kmat,ierr)<br>
                                                ><br>
                                                > ! Code to set
                                                values in matrix<br>
                                                ><br>
                                                > call
                                                MatAssemblyBegin(Kmat,
                                                MAT_FINAL_ASSEMBLY,
                                                ierr)<br>
                                                > call
                                                MatAssemblyEnd(Kmat,
                                                MAT_FINAL_ASSEMBLY,
                                                ierr)<br>
                                                > call
                                                MatSetOption(Kmat,MAT_NEW_NONZERO_LOCATIONS,PETSC_TRUE,ierr)<br>
                                                ><br>
                                                > ! If no rhs
                                                allocation yet<br>
                                                > if(rhs.eq.0) then<br>
                                                >   call VecCreate   
                                                    (PETSC_COMM_WORLD,
                                                rhs, ierr)<br>
                                                >   call VecSetSizes 
                                                    (rhs, numpeq,
                                                PETSC_DECIDE, ierr)<br>
                                                >   call
                                                VecSetFromOptions(rhs,
                                                ierr)<br>
                                                > endif<br>
                                                ><br>
                                                > ! Code to set
                                                values in RHS<br>
                                                ><br>
                                                > call
                                                VecAssemblyBegin(rhs,
                                                ierr)<br>
                                                > call
                                                VecAssemblyEnd(rhs,
                                                ierr)<br>
                                                ><br>
                                                > if(kspsol_exists)
                                                then<br>
                                                >   call
                                                KSPDestroy(kspsol,ierr)<br>
                                                > endif<br>
                                                ><br>
                                                > call
                                                KSPCreate(PETSC_COMM_WORLD,
                                                kspsol   ,ierr)<br>
                                                > call
                                                KSPSetOperators(kspsol,
                                                Kmat, Kmat, ierr)<br>
                                                > call
                                                KSPSetFromOptions(kspsol,ierr)<br>
                                                > call
                                                KSPGetPC(kspsol, pc ,   
                                                  ierr)<br>
                                                ><br>
                                                > call
                                                PCSetCoordinates(pc,ndm,numpn,hr(np(43)),ierr)<br>
                                                ><br>
                                                > call
                                                KSPSolve(kspsol, rhs,
                                                sol, ierr)<br>
                                                > call
                                                KSPGetConvergedReason(kspsol,reason,ierr)<br>
                                                ><br>
                                                > ! update solution,
                                                go back to the top<br>
                                                ><br>
                                                > reason is coming
                                                back as -8 on my first
                                                Ax=b solve and 2 or 3
                                                after that<br>
                                                > (with gamg).  With
                                                the other solvers it is
                                                coming back as 2 or 3
                                                for<br>
                                                > iterative options
                                                and 4 if I use one of
                                                the direct solvers.<br>
                                                ><br>
                                                > Any ideas on what
                                                is causing the
                                                Indefinite PC on the
                                                first iteration with
                                                GAMG?<br>
                                                ><br>
                                                > Thanks in advance,<br>
                                                > -sanjay<br>
                                                ><br>
                                                > --<br>
                                                >
                                                -----------------------------------------------<br>
                                                > Sanjay Govindjee,
                                                PhD, PE<br>
                                                > Professor of Civil
                                                Engineering<br>
                                                ><br>
                                                > 779 Davis Hall<br>
                                                > University of
                                                California<br>
                                                > Berkeley, CA
                                                94720-1710<br>
                                                ><br>
                                                > Voice:  <a href="tel:%2B1%20510%20642%206060" value="+15106426060" target="_blank">+1
                                                  510 642 6060</a><br>
                                                > FAX:    <a href="tel:%2B1%20510%20643%205264" value="+15106435264" target="_blank">+1
                                                  510 643 5264</a><br>
                                                ><br>
                                                > <a href="mailto:s_g@berkeley.edu" target="_blank"></a><a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a><br>
                                                > <a href="http://www.ce.berkeley.edu/%7Esanjay" rel="noreferrer" target="_blank"></a><a href="http://www.ce.berkeley.edu/~sanjay" target="_blank">http://www.ce.berkeley.edu/~sanjay</a><br>
                                                ><br>
                                                >
                                                -----------------------------------------------<br>
                                                ><br>
                                                > Books:<br>
                                                ><br>
                                                > Engineering
                                                Mechanics of Deformable<br>
                                                > Solids: A
                                                Presentation with
                                                Exercises<br>
                                                ><br>
                                                > <a href="http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641" rel="noreferrer" target="_blank"></a><a href="http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641" target="_blank">http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641</a><br>
                                                > <a href="http://ukcatalogue.oup.com/product/9780199651641.do" rel="noreferrer" target="_blank"></a><a href="http://ukcatalogue.oup.com/product/9780199651641.do" target="_blank">http://ukcatalogue.oup.com/product/9780199651641.do</a><br>
                                                > <a href="http://amzn.com/0199651647" rel="noreferrer" target="_blank"></a><a href="http://amzn.com/0199651647" target="_blank">http://amzn.com/0199651647</a><br>
                                                ><br>
                                                ><br>
                                                > Engineering
                                                Mechanics 3 (Dynamics)
                                                2nd Edition<br>
                                                ><br>
                                                > <a href="http://www.springer.com/978-3-642-53711-0" rel="noreferrer" target="_blank"></a><a href="http://www.springer.com/978-3-642-53711-0" target="_blank">http://www.springer.com/978-3-642-53711-0</a><br>
                                                > <a href="http://amzn.com/3642537111" rel="noreferrer" target="_blank"></a><a href="http://amzn.com/3642537111" target="_blank">http://amzn.com/3642537111</a><br>
                                                ><br>
                                                ><br>
                                                > Engineering
                                                Mechanics 3,
                                                Supplementary Problems:
                                                Dynamics<br>
                                                ><br>
                                                > <a href="http://www.amzn.com/B00SOXN8JU" rel="noreferrer" target="_blank"></a><a href="http://www.amzn.com/B00SOXN8JU" target="_blank">http://www.amzn.com/B00SOXN8JU</a><br>
                                                ><br>
                                                ><br>
                                                >
                                                -----------------------------------------------<br>
                                                ><br>
                                              </div>
                                            </div>
                                            > <log_view.txt><br>
                                            <br>
                                          </blockquote>
                                        </div>
                                        <br>
                                      </div>
                                    </div>
                                  </blockquote>
                                  <br>
                                  <pre cols="72">-- 
-----------------------------------------------
Sanjay Govindjee, PhD, PE
Professor of Civil Engineering

779 Davis Hall
University of California
Berkeley, CA 94720-1710

Voice:  <a href="tel:%2B1%20510%20642%206060" value="+15106426060" target="_blank">+1 510 642 6060</a>
FAX:    <a href="tel:%2B1%20510%20643%205264" value="+15106435264" target="_blank">+1 510 643 5264</a>
<a href="mailto:s_g@berkeley.edu" target="_blank">s_g@berkeley.edu</a>
<a href="http://www.ce.berkeley.edu/%7Esanjay" target="_blank">http://www.ce.berkeley.edu/~sanjay</a>
-----------------------------------------------

Books:  

Engineering Mechanics of Deformable 
Solids: A Presentation with Exercises
<a href="http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641" target="_blank">http://www.oup.com/us/catalog/general/subject/Physics/MaterialsScience/?view=usa&ci=9780199651641</a>
<a href="http://ukcatalogue.oup.com/product/9780199651641.do" target="_blank">http://ukcatalogue.oup.com/product/9780199651641.do</a>
<a href="http://amzn.com/0199651647" target="_blank">http://amzn.com/0199651647</a>

Engineering Mechanics 3 (Dynamics) 2nd Edition
<a href="http://www.springer.com/978-3-642-53711-0" target="_blank">http://www.springer.com/978-3-642-53711-0</a>
<a href="http://amzn.com/3642537111" target="_blank">http://amzn.com/3642537111</a>

Engineering Mechanics 3, Supplementary Problems: Dynamics 
<a href="http://www.amzn.com/B00SOXN8JU" target="_blank">http://www.amzn.com/B00SOXN8JU</a>

-----------------------------------------------
</pre>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </blockquote>
                    <br>
                  </div>
                </div>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
    </blockquote>
    <br>
    <pre cols="72"></pre>
  </div></div></div>

</blockquote></div><br></div>