<div dir="ltr"><div dir="ltr">On Tue, Jun 30, 2020 at 7:59 AM Andrea Iob <<a href="mailto:andrea_iob@hotmail.com">andrea_iob@hotmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I'm trying to solve a linear system using HYPRE/BoomerAMG as preconditioner. The system comes from a two-dimensional adjoint Navier-Stokes problem.</div></div></blockquote><div><br></div><div>Do you expect the system you are solving to be elliptic? BoomerAMG is designed for elliptic systems, and can easily fail if applied</div><div>to a more general system, say one with zeros on the diagonal.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> The mesh is structured (6400 cells) and there are 24 DoFs for each cell (the matrix has a total of 153600 rows).
The condition number of the matrix should be in the order of 1e9. Using ILU preconditioner and FGMRES, the system is correctly solved (it takes 800 iterations to reach a residual of 1e-12). However, replacing ILU with HYPRE/BoomerAMG, the solver stops right
after the first iteration (DIVERGED_NANORINF). I've tried different BoomerAMG options and different solvers (including Richardson to use BoomerAMG without a Krylov method), but I always get the same DIVERGED_NANORINF error.<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Using the same HYPRE/BoomerAMG + FGMERS setup on another problem (Laplacian on a highly stretched grid), the solver reaches convergence very quickly without any problems.
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
At the bottom of this mail, you'll find the log of a run that stops with DIVERGED_NANORINF. Do you spot something in my setup that may explain why the solver is not converging?
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks. Best regards,</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Andrea</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<font size="2"><span style="font-size:11pt">-----------------------------------------</span></font><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<font size="2"><span style="font-size:11pt">Assembly started...<br>
Reading matrix file...<br>
- Number of rows (N) = 153600<br>
- Number of non-zero entries (NNZ) = 18247680<br>
Assembly completed.<br>
Time elapsed 83.3231s<br>
Set up started...<br>
Set up completed.<br>
Time elapsed 6.62441s<br>
Solution started...<br>
0 KSP unpreconditioned resid norm 7.736650641501e-01 true resid norm 7.736650641501e-01 ||r(i)||/||b|| 1.000000000000e+00<br>
0 KSP Residual norm 7.736650641501e-01 % max 1.000000000000e+00 min 1.000000000000e+00 max/min 1.000000000000e+00<br>
[0]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------<br>
[0]PETSC ERROR:<br>
[0]PETSC ERROR: KSPSolve has not converged due to Nan or Inf inner product<br>
[0]PETSC ERROR: See <a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" rel="noopener noreferrer" target="_blank">
http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<br>
[0]PETSC ERROR: Petsc Release Version 3.10.3, unknown<br>
[0]PETSC ERROR: bitpit_system_solver on a named xxx by xxx Tue Jun 30 09:42:09 2020<br>
[0]PETSC ERROR: Configure options PETSC_ARCH=arch-linux2-c-opt-gcc7-hypre --with-blaslapack-dir=/opt/lapack/3.8.0-gcc.7.4.0/lib64 --with-debugging=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 --with-valgrind=1 --with-valgrind-dir=/opt/valgrind/3.14.0/ --prefix=/opt/petsc/3.10.3_gcc-7.4.0
--with-mpi=1 --download-hypre<br>
[0]PETSC ERROR: #1 KSPGMRESClassicalGramSchmidtOrthogonalization() line 67 in /root/InstallSources/petsc/src/ksp/ksp/impls/gmres/borthog2.c<br>
[0]PETSC ERROR: #2 KSPFGMRESCycle() line 175 in /root/InstallSources/petsc/src/ksp/ksp/impls/gmres/fgmres/fgmres.c<br>
[0]PETSC ERROR: #3 KSPSolve_FGMRES() line 291 in /root/InstallSources/petsc/src/ksp/ksp/impls/gmres/fgmres/fgmres.c<br>
[0]PETSC ERROR: #4 KSPSolve() line 780 in /root/InstallSources/petsc/src/ksp/ksp/interface/itfunc.c<br>
KSP Object: 1 MPI processes<br>
type: fgmres<br>
restart=45, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement<br>
happy breakdown tolerance 1e-30<br>
maximum iterations=10000, nonzero initial guess<br>
tolerances: relative=1e-12, absolute=1e-50, divergence=10000.<br>
right preconditioning<br>
using UNPRECONDITIONED norm type for convergence test<br>
PC Object: 1 MPI processes<br>
type: hypre<br>
HYPRE BoomerAMG preconditioning<br>
Cycle type V<br>
Maximum number of levels 25<br>
Maximum number of iterations PER hypre call 1<br>
Convergence tolerance PER hypre call 0.<br>
Threshold for strong coupling 0.7<br>
Interpolation truncation factor 0.3<br>
Interpolation: max elements per row 2<br>
Number of levels of aggressive coarsening 4<br>
Number of paths for aggressive coarsening 5<br>
Maximum row sums 0.9<br>
Sweeps down 1<br>
Sweeps up 1<br>
Sweeps on coarse 1<br>
Relax down sequential-Gauss-Seidel<br>
Relax up sequential-Gauss-Seidel<br>
Relax on coarse Gaussian-elimination<br>
Relax weight (all) 1.<br>
Outer relax weight (all) 1.<br>
Using CF-relaxation<br>
Smooth type Euclid<br>
Smooth num levels 25<br>
Euclid ILU(k) levels 0<br>
Euclid ILU(k) drop tolerance 0.<br>
Euclid ILU use Block-Jacobi? 1<br>
Measure type local<br>
Coarsen type HMIS<br>
Interpolation type ext+i<br>
linear system matrix = precond matrix:<br>
Mat Object: Mat_0x1e88040_0 1 MPI processes<br>
type: seqaij<br>
rows=153600, cols=153600, bs=24<br>
total: nonzeros=18247680, allocated nonzeros=18247680<br>
total number of mallocs used during MatSetValues calls =0<br>
using I-node routines: found 32000 nodes, limit used is 5<br>
Solution completed.<br>
Time elapsed 6.93336s<br>
Solution information...<br>
Error (L2) : 32.8359<br>
Error (Linf) : 1.93278<br>
************************************************************************************************************************<br>
*** WIDEN YOUR WINDOW TO 120 CHARACTERS. Use 'enscript -r -fCourier9' to print this document ***<br>
************************************************************************************************************************<br>
<br>
---------------------------------------------- PETSc Performance Summary: ----------------------------------------------<br>
<br>
bitpit_system_solver on a named xxx with 1 processor, by xxx Tue Jun 30 09:43:46 2020<br>
Using Petsc Release Version 3.10.3, unknown<br>
<br>
Max Max/Min Avg Total<br>
Time (sec): 9.718e+01 1.000 9.718e+01<br>
Objects: 5.300e+01 1.000 5.300e+01<br>
Flop: 1.107e+08 1.000 1.107e+08 1.107e+08<br>
Flop/sec: 1.139e+06 1.000 1.139e+06 1.139e+06<br>
MPI Messages: 0.000e+00 0.000 0.000e+00 0.000e+00<br>
MPI Message Lengths: 0.000e+00 0.000 0.000e+00 0.000e+00<br>
MPI Reductions: 0.000e+00 0.000<br>
<br>
Flop counting convention: 1 flop = 1 real number operation of type (multiply/divide/add/subtract)<br>
e.g., VecAXPY() for real vectors of length N --> 2N flop<br>
and VecAXPY() for complex vectors of length N --> 8N flop<br>
<br>
Summary of Stages: ----- Time ------ ----- Flop ------ --- Messages --- -- Message Lengths -- -- Reductions --<br>
Avg %Total Avg %Total Count %Total Avg %Total Count %Total<br>
0: Main Stage: 9.7178e+01 100.0% 1.1071e+08 100.0% 0.000e+00 0.0% 0.000e+00 0.0% 0.000e+00 0.0%<br>
<br>
------------------------------------------------------------------------------------------------------------------------<br>
See the 'Profiling' chapter of the users' manual for details on interpreting output.<br>
Phase summary info:<br>
Count: number of times phase was executed<br>
Time and Flop: Max - maximum over all processors<br>
Ratio - ratio of maximum to minimum over all processors<br>
Mess: number of messages sent<br>
AvgLen: average message length (bytes)<br>
Reduct: number of global reductions<br>
Global: entire computation<br>
Stage: stages of a computation. Set stages with PetscLogStagePush() and PetscLogStagePop().<br>
%T - percent time in this phase %F - percent flop in this phase<br>
%M - percent messages in this phase %L - percent message lengths in this phase<br>
%R - percent reductions in this phase<br>
Total Mflop/s: 10e-6 * (sum of flop over all processors)/(max time over all processors)<br>
------------------------------------------------------------------------------------------------------------------------<br>
Event Count Time (sec) Flop --- Global --- --- Stage ---- Total<br>
Max Ratio Max Ratio Max Ratio Mess AvgLen Reduct %T %F %M %L %R %T %F %M %L %R Mflop/s<br>
------------------------------------------------------------------------------------------------------------------------<br>
<br>
--- Event Stage 0: Main Stage<br>
<br>
BuildTwoSidedF 2 1.0 1.8471e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
MatMult 3 1.0 6.8688e-02 1.0 1.09e+08 1.0 0.0e+00 0.0e+00 0.0e+00 0 98 0 0 0 0 98 0 0 0 1587<br>
MatConvert 2 1.0 3.8534e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
MatAssemblyBegin 3 1.0 2.8112e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
MatAssemblyEnd 3 1.0 7.8563e-02 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
MatGetRowIJ 2 1.0 3.6100e-06 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
MatView 2 1.0 5.4618e+01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 56 0 0 0 0 56 0 0 0 0 0<br>
VecView 2 1.0 7.6981e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 1 0 0 0 0 1 0 0 0 0 0<br>
VecMDot 1 1.0 1.7635e-04 1.0 3.07e+05 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 1742<br>
VecNorm 3 1.0 5.4832e-04 1.0 9.22e+05 1.0 0.0e+00 0.0e+00 0.0e+00 0 1 0 0 0 0 1 0 0 0 1681<br>
VecScale 1 1.0 1.5216e-04 1.0 1.54e+05 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 1009<br>
VecCopy 1 1.0 1.5406e-04 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
VecSet 21 1.0 7.1106e-03 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
VecAYPX 1 1.0 1.9940e-04 1.0 1.54e+05 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 770<br>
VecWAXPY 1 1.0 7.8802e-04 1.0 1.54e+05 1.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 195<br>
KSPSetUp 2 1.0 6.8995e-03 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
PCSetUp 2 1.0 1.3190e+01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 14 0 0 0 0 14 0 0 0 0 0<br>
PCApply 1 1.0 2.2728e-01 1.0 0.00e+00 0.0 0.0e+00 0.0e+00 0.0e+00 0 0 0 0 0 0 0 0 0 0 0<br>
------------------------------------------------------------------------------------------------------------------------<br>
<br>
Memory usage is given in bytes:<br>
<br>
Object Type Creations Destructions Memory Descendants' Mem.<br>
Reports information only for process 0.<br>
<br>
--- Event Stage 0: Main Stage<br>
<br>
Matrix 3 1 2872 0.<br>
Vector 32 20 17234800 0.<br>
Index Set 4 4 3200 0.<br>
IS L to G Mapping 2 0 0 0.<br>
Vec Scatter 2 0 0 0.<br>
Viewer 6 4 3392 0.<br>
Krylov Solver 2 1 61676 0.<br>
Preconditioner 2 1 1432 0.<br>
========================================================================================================================<br>
Average time to get PetscTime(): 3.36e-08<br>
#PETSc Option Table entries:<br>
-ksp_converged_reason<br>
-ksp_error_if_not_converged<br>
-ksp_monitor_singular_value<br>
-ksp_monitor_true_residual<br>
-log_view<br>
-pc_hypre_boomeramg_agg_nl 4<br>
-pc_hypre_boomeramg_agg_num_paths 5<br>
-pc_hypre_boomeramg_coarsen_type HMIS<br>
-pc_hypre_boomeramg_eu_bj true<br>
-pc_hypre_boomeramg_interp_type ext+i<br>
-pc_hypre_boomeramg_P_max 2<br>
-pc_hypre_boomeramg_relax_type_all sequential-Gauss-Seidel<br>
-pc_hypre_boomeramg_smooth_type Euclid<br>
-pc_hypre_boomeramg_strong_threshold 0.7<br>
-pc_hypre_boomeramg_truncfactor 0.3<br>
#End of PETSc Option Table entries<br>
Compiled without FORTRAN kernels<br>
Compiled with full precision matrices (default)<br>
sizeof(short) 2 sizeof(int) 4 sizeof(long) 8 sizeof(void*) 8 sizeof(PetscScalar) 8 sizeof(PetscInt) 4<br>
Configure options: PETSC_ARCH=arch-linux2-c-opt-gcc7-hypre --with-blaslapack-dir=/opt/lapack/3.8.0-gcc.7.4.0/lib64 --with-debugging=0 COPTFLAGS=-O3 CXXOPTFLAGS=-O3 FOPTFLAGS=-O3 --with-valgrind=1 --with-valgrind-dir=/opt/valgrind/3.14.0/ --prefix=/opt/petsc/3.10.3_gcc-7.4.0
--with-mpi=1 --download-hypre<br>
-----------------------------------------<br>
Libraries compiled on 2020-06-26 12:35:46 on xxx<br>
Machine characteristics: Linux-3.10.0-1127.8.2.el7.x86_64-x86_64-with-centos-7.6.1810-Core<br>
Using PETSc directory: /opt/petsc/3.10.3_gcc-7.4.0<br>
Using PETSc arch:<br>
-----------------------------------------<br>
<br>
Using C compiler: mpicc -fPIC -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -fstack-protector -fvisibility=hidden -O3<br>
Using Fortran compiler: mpif90 -fPIC -Wall -ffree-line-length-0 -Wno-unused-dummy-argument -O3<br>
-----------------------------------------<br>
<br>
Using include paths: -I/opt/petsc/3.10.3_gcc-7.4.0/include -I/opt/valgrind/3.14.0/include<br>
-----------------------------------------<br>
<br>
Using C linker: mpicc<br>
Using Fortran linker: mpif90<br>
Using libraries: -Wl,-rpath,/opt/petsc/3.10.3_gcc-7.4.0/lib -L/opt/petsc/3.10.3_gcc-7.4.0/lib -lpetsc -Wl,-rpath,/opt/petsc/3.10.3_gcc-7.4.0/lib -L/opt/petsc/3.10.3_gcc-7.4.0/lib -Wl,-rpath,/opt/lapack/3.8.0-gcc.7.4.0/lib64 -L/opt/lapack/3.8.0-gcc.7.4.0/lib64
-Wl,-rpath,/opt/openmpi4.0.0-gcc7.4.0_slurm/lib -L/opt/openmpi4.0.0-gcc7.4.0_slurm/lib -Wl,-rpath,/opt/gnu/7.4/lib/gcc/x86_64-pc-linux-gnu/7.4.0 -L/opt/gnu/7.4/lib/gcc/x86_64-pc-linux-gnu/7.4.0 -Wl,-rpath,/opt/gnu/7.4/lib/gcc -L/opt/gnu/7.4/lib/gcc -Wl,-rpath,/opt/gnu/7.4/lib64
-L/opt/gnu/7.4/lib64 -Wl,-rpath,/opt/gnu/7.4/lib -L/opt/gnu/7.4/lib -lHYPRE -llapack -lblas -lm -lX11 -lstdc++ -ldl -lmpi_usempif08 -lmpi_usempi_ignore_tkr -lmpi_mpifh -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lpthread -lstdc++ -ldl<br>
-----------------------------------------</span></font><br>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>