[petsc-users] Solving Poisson equation with multigrid

Matthew Knepley knepley at gmail.com
Wed May 29 19:17:07 CDT 2013


On Wed, May 29, 2013 at 7:22 PM, Michele Rosso <mrosso at uci.edu> wrote:

>  I attached the complete output.
> I used 2 processors for this run. I wanted to use only one to have a
> cleaner output but I could not because of this error:
>

There are 2 problems here:

  1) GAMG is not accepting options for the coarse grid solver

  2) You do not appear to using PETSc 3.4, or the shift you are trying to
set would be there by default

    Matt


> [0]PCSetData_AGG bs=1 MM=32768
> [0]PETSC ERROR: --------------------- Error Message
> ------------------------------------
> [0]PETSC ERROR: Arguments are incompatible!
> [0]PETSC ERROR: MatMatMult requires A, mpiaij, to be compatible with B,
> seqaij!
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 3, Wed Aug 29 11:26:24
> CDT 2012
> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
> [0]PETSC ERROR: See docs/index.html for manual pages.
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: ./hit on a  named nid15343 by Unknown Wed May 29 18:15:24
> 2013
> [0]PETSC ERROR: Libraries linked from
> [0]PETSC ERROR: Configure run at
> [0]PETSC ERROR: Configure options
> [0]PETSC ERROR:
> ------------------------------------------------------------------------
> [0]PETSC ERROR: MatMatMult() line 8614 in src/mat/interface/matrix.c
> [0]PETSC ERROR: PCGAMGOptprol_AGG() line 1358 in
> src/ksp/pc/impls/gamg/agg.c
> [0]PETSC ERROR: PCSetUp_GAMG() line 673 in src/ksp/pc/impls/gamg/gamg.c
> [0]PETSC ERROR: PCSetUp() line 832 in src/ksp/pc/interface/precon.c
> [0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c
> hit: gamg.c:568: PCSetUp_GAMG: Assertion `pc->setupcalled' failed.
>
>  On 05/29/2013 02:29 PM, Matthew Knepley wrote:
>
> On Wed, May 29, 2013 at 5:25 PM, Michele Rosso <mrosso at uci.edu> wrote:
>
>>  Hi,
>>
>> I proceeded as Matt suggested. I am running without nullspace
>> (Dirichlet's BCs) with the following options:
>>
>> -pc_type gamg  -pc_mg_cycle_type v  -pc_gamg_agg_nsmooths 1
>> -mg_coarse_sub_pc_factor_shift_type NONZERO -ksp_view -options_left
>>
>> The results are fine and the run finishes. The output of -ksp_view does
>> not say anything about the coarse solver being shifted.
>> In fact the option  -mg_coarse_sub_pc_factor_shift_type NONZERO is not
>> used:
>>
>
>  Please show us the COMPLETE output.
>
>    Thanks,
>
>       Matt
>
>
>>  #PETSc Option Table entries:
>> -ksp_view
>> -mg_coarse_sub_pc_factor_shift_type NONZERO
>> -options_left
>> -pc_gamg_agg_nsmooths 1
>> -pc_mg_cycle_type v
>> -pc_type gamg
>> #End of PETSc Option Table entries
>> There is one unused database option. It is:
>> Option left: name:-mg_coarse_sub_pc_factor_shift_type value: NONZERO
>>
>> Michele
>>
>>
>>  On 05/24/2013 03:20 PM, Matthew Knepley wrote:
>>
>> On Fri, May 24, 2013 at 5:18 PM, Michele Rosso <mrosso at uci.edu> wrote:
>>
>>>  Using
>>>
>>> -pc_type gamg -pc_mg_cycle_type v -pc_gamg_agg_nsmooths 1
>>> -mg_coarse_sub_pc_factor_shift_type NONZERO  -option_left -ksp_view
>>>
>>
>>  This is what debugging is about. We are not running your problem. How
>> could this be debugged?
>>
>>  1) Run the problem w/o a null space so that it finishes
>>
>>  2) Look at the output for -ksp_view
>>
>>  3) Does the coarse solver say that it is shifted?
>>
>>  4) Are there options which were unused?
>>
>>     Matt
>>
>>
>>>  still produces the same error:
>>>
>>> [0]PCSetData_AGG bs=1 MM=131072
>>> [0]PETSC ERROR: --------------------- Error Message
>>> ------------------------------------
>>> [0]PETSC ERROR: Detected zero pivot in LU factorization:
>>> see http://www.mcs.anl.gov/petsc/documentation/faq.html#ZeroPivot!
>>> [0]PETSC ERROR: Zero pivot row 280 value 6.56964e-17 tolerance
>>> 2.22045e-14!
>>> [0]PETSC ERROR:
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 3, Wed Aug 29
>>> 11:26:24 CDT 2012
>>> [0]PETSC ERROR: See docs/changes/index.html for recent updates.
>>> [0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
>>> [0]PETSC ERROR: See docs/index.html for manual pages.
>>> [0]PETSC ERROR:
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: ./hit on a  named nid15363 by Unknown Fri May 24
>>> 17:06:50 2013
>>> [0]PETSC ERROR: Libraries linked from
>>> [0]PETSC ERROR: Configure run at
>>> [0]PETSC ERROR: Configure options
>>> [0]PETSC ERROR:
>>> ------------------------------------------------------------------------
>>> [0]PETSC ERROR: MatPivotCheck_none() line 583 in
>>> src/mat/impls/aij/seq//ptmp/skelly/petsc/3.3.03/cray_interlagos_build/real/src/include/petsc-private/matimpl.h
>>> [0]PETSC ERROR: MatPivotCheck() line 602 in
>>> src/mat/impls/aij/seq//ptmp/skelly/petsc/3.3.03/cray_interlagos_build/real/src/include/petsc-private/matimpl.h
>>> [0]PETSC ERROR: MatLUFactorNumeric_SeqAIJ() line 585 in
>>> src/mat/impls/aij/seq/aijfact.c
>>> [0]PETSC ERROR: MatLUFactorNumeric() line 2803 in
>>> src/mat/interface/matrix.c
>>> [0]PETSC ERROR: PCSetUp_LU() line 160 in src/ksp/pc/impls/factor/lu/lu.c
>>> [0]PETSC ERROR: PCSetUp() line 832 in src/ksp/pc/interface/precon.c
>>> [0]PETSC ERROR: KSPSetUp() line 278 in src/ksp/ksp/interface/itfunc.c
>>> [0]PETSC ERROR: PCSetUpOnBlocks_BJacobi_Singleblock() line 715 in
>>> src/ksp/pc/impls/bjacobi/bjacobi.c
>>> [0]PETSC ERROR: PCSetUpOnBlocks() line 865 in
>>> src/ksp/pc/interface/precon.c
>>> [0]PETSC ERROR: KSPSetUpOnBlocks() line 154 in
>>> src/ksp/ksp/interface/itfunc.c
>>> [0]PETSC ERROR: KSPSolve() line 403 in src/ksp/ksp/interface/itfunc.c
>>> [0]PETSC ERROR: PCSetUpOnBlocks_BJacobi_Singleblock() line 715 in
>>> src/ksp/pc/impls/bjacobi/bjacobi.c
>>> [0]PETSC ERROR: PCSetUpOnBlocks() line 865 in
>>> src/ksp/pc/interface/precon.c
>>> [0]PETSC ERROR: KSPSetUpOnBlocks() line 154 in
>>> src/ksp/ksp/interface/itfunc.c
>>> [0]PETSC ERROR: KSPSolve() line 403 in src/ksp/ksp/interface/itfunc.c
>>> [0]PETSC ERROR: PCMGMCycle_Private() line 20 in src/ksp/pc/impls/mg/mg.c
>>> [0]PETSC ERROR: PCMGMCycle_Private() line 49 in src/ksp/pc/impls/mg/mg.c
>>> [0]PETSC ERROR: PCMGMCycle_Private() line 49 in src/ksp/pc/impls/mg/mg.c
>>> [0]PETSC ERROR: PCMGMCycle_Private() line 49 in src/ksp/pc/impls/mg/mg.c
>>> [0]PETSC ERROR: PCApply_MG() line 326 in src/ksp/pc/impls/mg/mg.c
>>> [0]PETSC ERROR: PCApply() line 384 in src/ksp/pc/interface/precon.c
>>> [0]PETSC ERROR: KSPSolve_CG() line 139 in src/ksp/ksp/impls/cg/cg.c
>>> [0]PETSC ERROR: KSPSolve() line 446 in src/ksp/ksp/interface/itfunc.c
>>>
>>>  On 05/24/2013 02:51 PM, Jed Brown wrote:
>>>
>>> Michele Rosso <mrosso at uci.edu> <mrosso at uci.edu> writes:
>>>
>>>
>>>      With petsc-3.4 (which you should upgrade to), use
>>>     -mg_coarse_sub_pc_factor_shift_type NONZERO
>>>
>>>  Actually, use this with petsc-3.3 also (and please upgrade to
>>> petsc-3.4).
>>>
>>> The option you were passing was not being used.
>>>
>>>
>>>
>>>
>>
>>
>>  --
>> What most experimenters take for granted before they begin their
>> experiments is infinitely more interesting than any results to which their
>> experiments lead.
>> -- Norbert Wiener
>>
>>
>>
>
>
>  --
> What most experimenters take for granted before they begin their
> experiments is infinitely more interesting than any results to which their
> experiments lead.
> -- Norbert Wiener
>
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130529/4a133072/attachment.html>


More information about the petsc-users mailing list