<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div>It turns out that I can not set PC side as right when KSP type is set to pre_only. After I fixed that, it works fine.</div><div> </div><div>This brings me a question: why do I have to set KSP type to pre_only when SuperLU's ILUTP is used as preconditioner? Can I still set KSP type as KSPBCGS (which seems to be the fastest with PETSc's ILU for my cases)?</div><div> </div><div>Thanks,</div><div>Qin</div><div><br></div> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <div style="margin: 5px 0px; padding: 0px; border: 1px solid rgb(204, 204, 204);
height: 0px; line-height: 0; font-size: 0px;" class="hr" contentEditable="false" readonly="true"></div> <font size="2" face="Arial"> <b><span style="font-weight: bold;">From:</span></b> Barry Smith <bsmith@mcs.anl.gov><br> <b><span style="font-weight: bold;">To:</span></b> Qin Lu <lu_qin_2000@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> Xiaoye S. Li <xsli@lbl.gov>; "petsc-users@mcs.anl.gov" <petsc-users@mcs.anl.gov> <br> <b><span style="font-weight: bold;">Sent:</span></b> Tuesday, May 13, 2014 8:31 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [petsc-users] ILUTP in PETSc<br> </font> </div> <div class="y_msg_container"><br><br clear="none"> Works fine for me. Please please please ALWAYS cut and paste the entire error message that is printed. We print the information for a reason, because it provides clues as to what went wrong.<br clear="none"><br clear="none"><br
clear="none"> ./ex10 -f0 ~/Datafiles/Matrices/arco1 -pc_type ilu -pc_factor_mat_solver_package superlu -mat_superlu_ilu_droptol 1.e-8 -ksp_monitor_true_residual -ksp_rtol 1.e-12 -ksp_view<br clear="none"><br clear="none"> 0 KSP preconditioned resid norm 2.544968580491e+03 true resid norm 7.410897708964e+00 ||r(i)||/||b|| 1.000000000000e+00<br clear="none"> 1 KSP preconditioned resid norm 2.467110329809e-06 true resid norm 1.439993537311e-07 ||r(i)||/||b|| 1.943075716143e-08<br clear="none"> 2 KSP preconditioned resid norm 1.522204461523e-12 true resid norm 2.699724724531e-11 ||r(i)||/||b|| 3.642911871885e-12<br clear="none">KSP Object: 1 MPI processes<br clear="none"> type: gmres<br clear="none"> GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br clear="none"> GMRES: happy breakdown tolerance 1e-30<br clear="none"> maximum
iterations=10000, initial guess is zero<br clear="none"> tolerances: relative=1e-12, absolute=1e-50, divergence=10000<br clear="none"> left preconditioning<br clear="none"> using PRECONDITIONED norm type for convergence test<br clear="none">PC Object: 1 MPI processes<br clear="none"> type: ilu<br clear="none"> ILU: out-of-place factorization<br clear="none"> 0 levels of fill<br clear="none"> tolerance for zero pivot 2.22045e-14<br clear="none"> using diagonal shift on blocks to prevent zero pivot [INBLOCKS]<br clear="none"> matrix ordering: natural<br clear="none"> factor fill ratio given 0, needed 0<br clear="none"> Factored matrix follows:<br clear="none"> Mat Object: 1 MPI processes<br clear="none"> type: seqaij<br clear="none">
rows=1501, cols=1501<br clear="none"> package used to perform factorization: superlu<br clear="none"> total: nonzeros=0, allocated nonzeros=0<br clear="none"> total number of mallocs used during MatSetValues calls =0<br clear="none"> SuperLU run parameters:<br clear="none"> Equil: YES<br clear="none"> ColPerm: 3<br clear="none"> IterRefine: 0<br clear="none"> SymmetricMode: NO<br clear="none"> DiagPivotThresh: 0.1<br clear="none"> PivotGrowth: NO<br clear="none">
ConditionNumber: NO<br clear="none"> RowPerm: 1<br clear="none"> ReplaceTinyPivot: NO<br clear="none"> PrintStat: NO<br clear="none"> lwork: 0<br clear="none"> ILU_DropTol: 1e-08<br clear="none"> ILU_FillTol: 0.01<br clear="none"> ILU_FillFactor: 10<br clear="none"> ILU_DropRule: 9<br clear="none"> ILU_Norm: 2<br clear="none"> ILU_MILU: 0<br clear="none"> linear system matrix = precond matrix:<br clear="none"> Mat Object: 1 MPI processes<br
clear="none"> type: seqaij<br clear="none"> rows=1501, cols=1501<br clear="none"> total: nonzeros=26131, allocated nonzeros=26131<br clear="none"> total number of mallocs used during MatSetValues calls =0<br clear="none"> using I-node routines: found 501 nodes, limit used is 5<br clear="none">Number of iterations = 2<br clear="none">Residual norm 2.69972e-11<br clear="none">~/Src/petsc/src/ksp/ksp/examples/tutorials master <br clear="none"><div id="yqtfd16630" class="yqt7269916476"><br clear="none">On May 13, 2014, at 12:17 PM, Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> wrote:<br clear="none"><br clear="none">> I tried to use command line options as the example suggested ('-ksp_type preonly -pc_type ilu -pc_factor_mat_solver_package superlu -mat_superlu_ilu_droptol 1.e-8')
without changing my source code, but then the call to KSPSetUp returned error number 56.<br clear="none">> <br clear="none">> Does this mean I still need to change the source code (such as adding calls to PCFactorSetMatSolverPackage, PCFactorGetMatrix, etc.)in addition to the command line options?<br clear="none">> <br clear="none">> I ask this since the use of SuperLU seems to be different from using Hypre, which can be invoked with command line options without changing source code.<br clear="none">> <br clear="none">> Thanks a lot,<br clear="none">> Qin <br clear="none">> <br clear="none">> <br clear="none">> ----- Original Message -----<br clear="none">> From: Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" shape="rect" ymailto="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>><br clear="none">> To: Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect"
ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>><br clear="none">> Cc: Xiaoye S. Li <<a href="mailto:xsli@lbl.gov" shape="rect" ymailto="mailto:xsli@lbl.gov">xsli@lbl.gov</a>>; "<a href="mailto:petsc-users@mcs.anl.gov" shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>><br clear="none">> Sent: Monday, May 12, 2014 5:11 PM<br clear="none">> Subject: Re: [petsc-users] ILUTP in PETSc<br clear="none">> <br clear="none">> <br clear="none">> See for example: <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSOLVERSUPERLU.html" shape="rect" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MATSOLVERSUPERLU.html</a><br clear="none">> <br clear="none">> <br clear="none">> <br
clear="none">> <br clear="none">> <br clear="none">> On May 12, 2014, at 4:54 PM, Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> wrote:<br clear="none">> <br clear="none">>> Hello,<br clear="none">>> <br clear="none">>> I have built PETSc with SuperLU, but what are PETSc's command line options to invoke SuperLU's ILUTP preconditioner and to set the dropping tolerance? (-mat_superlu_ilu_droptol for the latter?)<br clear="none">>> <br clear="none">>> Do I need to do some programming in order to call SuperLU's preconditioner, or the command line options would work? <br clear="none">>> <br clear="none">>> Many thanks,<br clear="none">>> Qin <br clear="none">>> <br clear="none">>> <br clear="none">>> From: Xiaoye S. Li <<a href="mailto:xsli@lbl.gov" shape="rect"
ymailto="mailto:xsli@lbl.gov">xsli@lbl.gov</a>><br clear="none">>> To: Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" shape="rect" ymailto="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> <br clear="none">>> Cc: Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>>; "<a href="mailto:petsc-users@mcs.anl.gov" shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>" <<a href="mailto:petsc-users@mcs.anl.gov" shape="rect" ymailto="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</a>> <br clear="none">>> Sent: Friday, May 2, 2014 3:40 PM<br clear="none">>> Subject: Re: [petsc-users] ILUTP in PETSc<br clear="none">>> <br clear="none">>> <br clear="none">>> <br clear="none">>> The sequential SuperLU has ILUTP implementation, not in parallel versions. PETSc already supports the option
of using SuperLU, so you should be able to try easily. <br clear="none">>> <br clear="none">>> In SuperLU distribution:<br clear="none">>> <br clear="none">>> EXAMPLE/zitersol.c : an example to use GMRES with ILUTP preconditioner (returned from driver SRC/zgsisx.c)<br clear="none">>> <br clear="none">>> SRC/zgsitrf.c : the actual ILUTP factorization routine<br clear="none">>> <br clear="none">>> <br clear="none">>> Sherry Li<br clear="none">>> <br clear="none">>> <br clear="none">>> <br clear="none">>> On Fri, May 2, 2014 at 12:25 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov" shape="rect" ymailto="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br clear="none">>> <br clear="none">>> <br clear="none">>>> At <a href="http://www.mcs.anl.gov/petsc/documentation/linearsolvertable.html" shape="rect"
target="_blank">http://www.mcs.anl.gov/petsc/documentation/linearsolvertable.html</a>there are two listed. ./configure —download-hypre<br clear="none">>>> <br clear="none">>>> mpiexec -n 23 ./yourprogram -pc_type hypre -pc_hypre_type ilupt or euclid<br clear="none">>>> <br clear="none">>>> you can also add -help to see what options are available.<br clear="none">>>> <br clear="none">>>> Both pretty much suck and I can’t image much reason for using them.<br clear="none">>>> <br clear="none">>>> Barry<br clear="none">>>> <br clear="none">>>> <br clear="none">>>> <br clear="none">>>> On May 2, 2014, at 10:27 AM, Qin Lu <<a href="mailto:lu_qin_2000@yahoo.com" shape="rect" ymailto="mailto:lu_qin_2000@yahoo.com">lu_qin_2000@yahoo.com</a>> wrote:<br clear="none">>>> <br clear="none">>>>> Hello,<br
clear="none">>>>> <br clear="none">>>>> I am interested in using ILUTP preconditioner with PETSc linear solver. There is an online doc <a href="https://fs.hlrs.de/projects/par/par_prog_ws/pdf/petsc_nersc01_short.pdfthat" shape="rect" target="_blank">https://fs.hlrs.de/projects/par/par_prog_ws/pdf/petsc_nersc01_short.pdfthat</a>mentioned it is available in PETSc with other packages (page 62-63). Is there any instructions or examples on how to use it?<br clear="none">>>>> <br clear="none">>>>> Many thanks,<br clear="none">>>>> Qin<br clear="none">>>> <br clear="none">>>> <br clear="none"></div><br><br></div> </div> </div> </div></body></html>