So I commented out the line PCSetType(pc, PCGAMG). The line 
KSPSetFromOptions(ksp) was already in the code at the end of our initialization 
routine. I also added .petscrc to the working dir. Here is the current output. 
It seems as if Option left: name:-mg_levels_pc_type jacobi (no value) is still 
present in the output..I dunno.

-Ari

----- Original Message -----
From: "Mark Adams" <[email protected]>
To: "Ari Rappaport" <[email protected]>, "For users of the development version 
of PETSc" <[email protected]>
Sent: Tuesday, July 26, 2016 4:03:03 PM
Subject: Re: [petsc-dev] Algebraic Multigrid


At the end of this you have: 



#PETSc Option Table entries: 
-ksp_view 
-mg_levels_pc_type jacobi 
-options_left 
#End of PETSc Option Table entries 
There is one unused database option. It is: 
Option left: name:-mg_levels_pc_type jacobi (no value) 


So this jacobi parameter is not being used. 


Do you call KPSSetFromOptions? Do you set solver parameters in the code? Like 
PCGAMG? 


You should not set anything in the code, it just confuses things at this point. 
Use KSPSetFromOptions(). You can hardwire stuff before this call, this just 
lets you set the defaults, but you should always call this last to let command 
line parameters override the defaults. 


You can put this in a .petscrc file in the working directory and try again. 



-ksp_type cg 
-ksp_max_it 50 

-ksp_rtol 1.e-6 
-ksp_converged_reason 
-pc_type gamg 
-pc_gamg_type agg 
-pc_gamg_agg_nsmooths 1 
-pc_gamg_coarse_eq_limit 10 
-pc_gamg_reuse_interpolation true 
-pc_gamg_square_graph 1 
-pc_gamg_threshold -0.05 
-mg_levels_ksp_max_it 2 
-mg_levels_ksp_type chebyshev 
-mg_levels_esteig_ksp_type cg 
-mg_levels_esteig_ksp_max_it 10 
-mg_levels_ksp_chebyshev_esteig 0,.05,0,1.05 
-mg_levels_pc_type jacobi 
-pc_hypre_type boomeramg 
-pc_hypre_boomeramg_no_CF 
-pc_hypre_boomeramg_agg_nl 1 
-pc_hypre_boomeramg_coarsen_type HMIS 
-pc_hypre_boomeramg_interp_type ext+i 

LSP version 12.7, revision LSP_160701
Compiled Tue Jul 26 16:21:51 MDT 2016 on squash from /home/mantis/lsp
Compiler flags: -g -Werror -Wmissing-declarations -Wmissing-prototypes -Wcomment -Wuninitialized
Compiler options defined by user: -DCAR_X_Y -DSTATIC_FIELDS -DMATRIX_SOLUTION -DMULTI_PROCESS 

Code options defined at compile-time:
    CAR_X_Y
    CHARGE_DENSITY
    IMPLICIT_FIELDS
    MATRIX_SOLUTION
    MULTI_PROCESS
    STATIC_FIELDS
    STATIC_FIELDS_ADI
    STATIC_IMPLICIT

Coordinate system used:
    CARTESIAN

Input data file: sim.lsp

Simulation started on Tue Jul 26 16:24:09 2016

 *** Warning - error_current_filtering_parameter has no effect unless DIRECT_IMPLICIT compiler option is defined

Standard courant limit for timestep is 4.717309e-03

R1 D0 #cells=2704 #particles=100 (50 cell thickness)
Linear solve converged due to CONVERGED_RTOL iterations 7
KSP Object: 1 MPI processes
  type: cg
  maximum iterations=50
  tolerances:  relative=1e-06, absolute=1e-50, divergence=10000
  left preconditioning
  using nonzero initial guess
  using PRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
  type: gamg
    MG: type is MULTIPLICATIVE, levels=4 cycles=v
      Cycles per PCApply=1
      Using Galerkin computed coarse grid matrices
      GAMG specific options
        Threshold for dropping small values from graph -0.05
        AGG specific options
          Symmetric graph false
  Coarse grid solver -- level -------------------------------
    KSP Object:    (mg_coarse_)     1 MPI processes
      type: gmres
        GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
        GMRES: happy breakdown tolerance 1e-30
      maximum iterations=1, initial guess is zero
      tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
      left preconditioning
      using NONE norm type for convergence test
    PC Object:    (mg_coarse_)     1 MPI processes
      type: bjacobi
        block Jacobi: number of blocks = 1
        Local solve is same for all blocks, in the following KSP and PC objects:
        KSP Object:        (mg_coarse_sub_)         1 MPI processes
          type: preonly
          maximum iterations=1, initial guess is zero
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
          left preconditioning
          using NONE norm type for convergence test
        PC Object:        (mg_coarse_sub_)         1 MPI processes
          type: lu
            LU: out-of-place factorization
            tolerance for zero pivot 2.22045e-14
            using diagonal shift on blocks to prevent zero pivot [INBLOCKS]
            matrix ordering: nd
            factor fill ratio given 5, needed 1
              Factored matrix follows:
                Mat Object:                 1 MPI processes
                  type: seqaij
                  rows=9, cols=9
                  package used to perform factorization: petsc
                  total: nonzeros=79, allocated nonzeros=79
                  total number of mallocs used during MatSetValues calls =0
                    using I-node routines: found 4 nodes, limit used is 5
          linear system matrix = precond matrix:
          Mat Object:           1 MPI processes
            type: seqaij
            rows=9, cols=9
            total: nonzeros=79, allocated nonzeros=79
            total number of mallocs used during MatSetValues calls =0
              using I-node routines: found 4 nodes, limit used is 5
      linear system matrix = precond matrix:
      Mat Object:       1 MPI processes
        type: seqaij
        rows=9, cols=9
        total: nonzeros=79, allocated nonzeros=79
        total number of mallocs used during MatSetValues calls =0
          using I-node routines: found 4 nodes, limit used is 5
  Down solver (pre-smoother) on level 1 -------------------------------
    KSP Object:    (mg_levels_1_)     1 MPI processes
      type: chebyshev
        Chebyshev: eigenvalue estimates:  min = 0.0799936, max = 1.67987
        Chebyshev: eigenvalues estimated using cg with translations  [0 0.05; 0 1.05]
        KSP Object:        (mg_levels_1_esteig_)         1 MPI processes
          type: cg
          maximum iterations=10, initial guess is zero
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
          left preconditioning
          using NONE norm type for convergence test
      maximum iterations=2
      tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
      left preconditioning
      using nonzero initial guess
      using NONE norm type for convergence test
    PC Object:    (mg_levels_1_)     1 MPI processes
      type: jacobi
      linear system matrix = precond matrix:
      Mat Object:       1 MPI processes
        type: seqaij
        rows=69, cols=69
        total: nonzeros=1235, allocated nonzeros=1235
        total number of mallocs used during MatSetValues calls =0
          not using I-node routines
  Up solver (post-smoother) same as down solver (pre-smoother)
  Down solver (pre-smoother) on level 2 -------------------------------
    KSP Object:    (mg_levels_2_)     1 MPI processes
      type: chebyshev
        Chebyshev: eigenvalue estimates:  min = 0.0971442, max = 2.04003
        Chebyshev: eigenvalues estimated using cg with translations  [0 0.05; 0 1.05]
        KSP Object:        (mg_levels_2_esteig_)         1 MPI processes
          type: cg
          maximum iterations=10, initial guess is zero
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
          left preconditioning
          using NONE norm type for convergence test
      maximum iterations=2
      tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
      left preconditioning
      using nonzero initial guess
      using NONE norm type for convergence test
    PC Object:    (mg_levels_2_)     1 MPI processes
      type: jacobi
      linear system matrix = precond matrix:
      Mat Object:       1 MPI processes
        type: seqaij
        rows=380, cols=380
        total: nonzeros=3802, allocated nonzeros=3802
        total number of mallocs used during MatSetValues calls =0
          not using I-node routines
  Up solver (post-smoother) same as down solver (pre-smoother)
  Down solver (pre-smoother) on level 3 -------------------------------
    KSP Object:    (mg_levels_3_)     1 MPI processes
      type: chebyshev
        Chebyshev: eigenvalue estimates:  min = 0.0945854, max = 1.98629
        Chebyshev: eigenvalues estimated using cg with translations  [0 0.05; 0 1.05]
        KSP Object:        (mg_levels_3_esteig_)         1 MPI processes
          type: cg
          maximum iterations=10, initial guess is zero
          tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
          left preconditioning
          using NONE norm type for convergence test
      maximum iterations=2
      tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
      left preconditioning
      using nonzero initial guess
      using NONE norm type for convergence test
    PC Object:    (mg_levels_3_)     1 MPI processes
      type: jacobi
      linear system matrix = precond matrix:
      Mat Object:       1 MPI processes
        type: seqaij
        rows=2601, cols=2601
        total: nonzeros=12801, allocated nonzeros=13005
        total number of mallocs used during MatSetValues calls =0
          not using I-node routines
  Up solver (post-smoother) same as down solver (pre-smoother)
  linear system matrix = precond matrix:
  Mat Object:   1 MPI processes
    type: seqaij
    rows=2601, cols=2601
    total: nonzeros=12801, allocated nonzeros=13005
    total number of mallocs used during MatSetValues calls =0
      not using I-node routines
Matrix static solution iteration=7
Step=1 Time=4.246e-03 Run-time=0.06(s) Number of particles=80
Step=1 Time=4.246e-03(ns) Run-time=0.06(s) at finish
R1 D0 #cells=2704 #particles=80 (50 cell thickness)

Simulation terminated on Tue Jul 26 16:24:09 2016

#PETSc Option Table entries:
-ksp_converged_reason
-ksp_max_it 50
-ksp_rtol 1.e-6
-ksp_type cg
-ksp_view
-mg_levels_esteig_ksp_max_it 10
-mg_levels_esteig_ksp_type cg
-mg_levels_ksp_chebyshev_esteig 0,.05,0,1.05
-mg_levels_ksp_max_it 2
-mg_levels_ksp_type chebyshev
-mg_levels_pc_type jacobi
-mg_levels_pc_type jacobi
-options_left
-pc_gamg_agg_nsmooths 1
-pc_gamg_coarse_eq_limit 10
-pc_gamg_reuse_interpolation true
-pc_gamg_square_graph 1
-pc_gamg_threshold -0.05
-pc_gamg_type agg
-pc_hypre_boomeramg_agg_nl 1
-pc_hypre_boomeramg_coarsen_type HMIS
-pc_hypre_boomeramg_interp_type ext+i
-pc_hypre_boomeramg_no_CF
-pc_hypre_type boomeramg
-pc_type gamg
#End of PETSc Option Table entries
There are 6 unused database options. They are:
Option left: name:-mg_levels_pc_type jacobi (no value)
Option left: name:-pc_hypre_boomeramg_agg_nl value: 1
Option left: name:-pc_hypre_boomeramg_coarsen_type value: HMIS
Option left: name:-pc_hypre_boomeramg_interp_type value: ext+i
Option left: name:-pc_hypre_boomeramg_no_CF (no value)
Option left: name:-pc_hypre_type value: boomeramg

Reply via email to