[petsc-users] Problem of using PCFactorSetDropTolerance

Zhang, Hong hzhang at mcs.anl.gov
Wed Feb 28 08:49:45 CST 2024


Sequential solver superlu ILU supports drop tolerance. For example, petsc/src/ksp/ksp/tutorials/ex2.c:
./ex2 -pc_type ilu -pc_factor_mat_solver_type superlu -help |grep superlu
...
-mat_superlu_ilu_droptol: <now 0.0001 : formerly 0.0001>: ILU_DropTol (None)

i.e., you can run it as
$ ./ex2 -pc_type ilu -pc_factor_mat_solver_type superlu -mat_superlu_ilu_droptol 0.0001 -ksp_monitor
  0 KSP Residual norm 7.483267010387e+00
  1 KSP Residual norm 5.109625265233e-05
Norm of error 5.10959e-05 iterations 1

$ ./ex2 -pc_type ilu -pc_factor_mat_solver_type superlu -mat_superlu_ilu_droptol 0.001 -ksp_monitor
  0 KSP Residual norm 7.473227154663e+00
  1 KSP Residual norm 5.916533165499e-03
  2 KSP Residual norm 1.638603182685e-06
Norm of error 1.6387e-06 iterations 2

Hong
________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Barry Smith <bsmith at petsc.dev>
Sent: Tuesday, February 27, 2024 11:27 AM
To: Константин Мурусидзе <konstantin.murusidze at math.msu.ru>
Cc: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Problem of using PCFactorSetDropTolerance

We don't consider drop tolerance preconditioners as reliable or robust so I don't see anyone implementing it. On Feb 27, 2024, at 10: 11 AM, Константин Мурусидзе <konstantin. murusidze@ math. msu. ru> wrote: Thank you! Should we expect it
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.

ZjQcmQRYFpfptBannerEnd

   We don't consider drop tolerance preconditioners as reliable or robust so I don't see anyone implementing it.



On Feb 27, 2024, at 10:11 AM, Константин Мурусидзе <konstantin.murusidze at math.msu.ru> wrote:

Thank you! Should we expect it to appear in the near future?


27.02.2024, 18:07, "Barry Smith" <bsmith at petsc.dev>:

   I'm sorry for the confusion. PETSc does not have a drop tolerance ILU so this function does nothing as you've noted.

   Barry


On Feb 27, 2024, at 7:27 AM, Константин Мурусидзе <konstantin.murusidze at math.msu.ru<mailto:konstantin.murusidze at math.msu.ru>> wrote:

This Message Is From an External Sender
This message came from outside your organization.
Hello! I have such problem, while solving linear system and using PCFactorSetDropTolerance. As I understand this  function could significantly reduce number of iterations of system of solution, but there is no iterations decreasing.I had try a lot of options for this function, but there is no result
Could you suggest me if I have some mistake, while I setting up the preconditioner?

    PetscCall(KSPSetType(ksp, KSPCG));
    PetscCall(KSPSetInitialGuessNonzero(ksp,PETSC_TRUE));
    PetscCall(KSPSetNormType(ksp, KSP_NORM_DEFAULT));
    PetscCall(KSPCGSetType(ksp, KSP_CG_SYMMETRIC));

    PetscCall(KSPGetPC(ksp, &pc));
    PetscCall(PCSetType(pc, PCILU));
    PetscCall(PCFactorSetShiftType(pc, MAT_SHIFT_POSITIVE_DEFINITE));

    PetscCall(PCFactorSetLevels(pc, 2));
    PetscCall(PCFactorSetReuseOrdering(pc,PETSC_TRUE));
    PetscCall(PCFactorSetDropTolerance(pc, 1.e-5, 1.e-3, 10000));
    PetscCall(PCFactorSetZeroPivot(pc, 1.e-3));
    PetscCall(KSPSetTolerances(ksp, 1.e-8, 1.e-8, PETSC_DEFAULT, PETSC_DEFAULT));

    PetscCall(KSPSetFromOptions(ksp));

    PetscCall(KSPSolve(ksp, b, x));
     PetscCall(KSPGetIterationNumber(ksp, &its));


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20240228/4fadf2f0/attachment.html>


More information about the petsc-users mailing list