<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 16, 2014 at 1:55 PM, Dario Isola <span dir="ltr"><<a href="mailto:dario.isola@newmerical.com" target="_blank">dario.isola@newmerical.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was eventually able to make it run adopting a very small time-step (Courant number of about 1).<br></blockquote><div>
<br></div><div>AMG is intended for elliptic systems.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So either my problem is not well solved by AMG, as you said, or I am not using it very well.<br>
<br>
But I guess I should be able to take it from there.<br>
<br>
Thanks again for the support!<br>
<br>
Dario<br>
<br>
<br>
On 05/16/2014 01:56 PM, Barry Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Algebraic multigrid is not for everything.<br>
<br>
On May 16, 2014, at 11:49 AM, Dario Isola <<a href="mailto:dario.isola@newmerical.com" target="_blank">dario.isola@newmerical.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks a lot for your answers.<br>
<br>
I ran it with<br>
-ksp_type gmres -pc_type hypre -pc_hypre_type euclid<br>
and it worked very well. Thanks.<br>
<br>
I then tried to use boomeramg as a preconditioner coupled with Richardson but I was not successful, it failed to solve the system and returned nans.<br>
-ksp_type richardson -pc_type hypre -pc_hypre_type boomeramg -pc_hypre_boomeramg_relax_<u></u>type_all SOR/Jacobi -pc_hypre_boomeramg_print_<u></u>debug -ksp_view -ksp_monitor_true_residual<br>
and i got the following<br>
<br>
===== Proc = 0 Level = 0 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 18308 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 7 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 1 =====<br>
Proc = 0 Coarsen 1st pass = 0.010000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 8725 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 16 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 2 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 4721 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 13 nc_offd = 0<br>
Proc = 0 iter 3 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 4 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 3 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 2495 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 22 nc_offd = 0<br>
Proc = 0 iter 3 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 4 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 4 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 1337 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 13 nc_offd = 0<br>
Proc = 0 iter 3 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 2 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 5 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 695 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 3 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 6 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 343 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 21 nc_offd = 0<br>
Proc = 0 iter 3 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 2 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 7 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 174 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 15 nc_offd = 0<br>
Proc = 0 iter 3 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 2 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 8 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 81 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 13 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 9 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 37 nc_offd = 0<br>
Proc = 0 iter 2 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 6 nc_offd = 0<br>
<br>
===== Proc = 0 Level = 10 =====<br>
Proc = 0 Coarsen 1st pass = 0.000000<br>
Proc = 0 Coarsen 2nd pass = 0.000000<br>
Proc = 0 Initialize CLJP phase = 0.000000<br>
Proc = 0 iter 1 comm. and subgraph update = 0.000000<br>
Proc = 0 CLJP phase = 0.000000 graph_size = 11 nc_offd = 0<br>
<br>
<br>
0 KSP preconditioned resid norm 7.299769365830e+14 true resid norm 8.197927963033e-03 ||r(i)||/||b|| 1.000000000000e+00<br>
1 KSP preconditioned resid norm 2.319459389445e+28 true resid norm 6.152576199945e+12 ||r(i)||/||b|| 7.505038136086e+14<br>
KSP Object: 1 MPI processes<br>
type: richardson<br>
Richardson: damping factor=1<br>
maximum iterations=90, initial guess is zero<br>
tolerances: relative=0.1, absolute=1e-50, divergence=100000<br>
left preconditioning<br>
using PRECONDITIONED norm type for convergence test<br>
PC Object: 1 MPI processes<br>
type: hypre<br>
HYPRE BoomerAMG preconditioning<br>
HYPRE BoomerAMG: Cycle type V<br>
HYPRE BoomerAMG: Maximum number of levels 25<br>
HYPRE BoomerAMG: Maximum number of iterations PER hypre call 1<br>
HYPRE BoomerAMG: Convergence tolerance PER hypre call 0<br>
HYPRE BoomerAMG: Threshold for strong coupling 0.25<br>
HYPRE BoomerAMG: Interpolation truncation factor 0<br>
HYPRE BoomerAMG: Interpolation: max elements per row 0<br>
HYPRE BoomerAMG: Number of levels of aggressive coarsening 0<br>
HYPRE BoomerAMG: Number of paths for aggressive coarsening 1<br>
HYPRE BoomerAMG: Maximum row sums 0.9<br>
HYPRE BoomerAMG: Sweeps down 1<br>
HYPRE BoomerAMG: Sweeps up 1<br>
HYPRE BoomerAMG: Sweeps on coarse 1<br>
HYPRE BoomerAMG: Relax down SOR/Jacobi<br>
HYPRE BoomerAMG: Relax up SOR/Jacobi<br>
HYPRE BoomerAMG: Relax on coarse Gaussian-elimination<br>
HYPRE BoomerAMG: Relax weight (all) 1<br>
HYPRE BoomerAMG: Outer relax weight (all) 1<br>
HYPRE BoomerAMG: Using CF-relaxation<br>
HYPRE BoomerAMG: Measure type local<br>
HYPRE BoomerAMG: Coarsen type Falgout<br>
HYPRE BoomerAMG: Interpolation type classical<br>
linear system matrix = precond matrix:<br>
Matrix Object: 1 MPI processes<br>
type: seqbaij<br>
rows=22905, cols=22905, bs=5<br>
total: nonzeros=785525, allocated nonzeros=785525<br>
total number of mallocs used during MatSetValues calls =0<br>
block size is 5<br>
Do you guys have any suggestion? Is it possible that I am haven't initialized boomeramg properly? Or it is just my system equations that can not be solved by AMG?<br>
<br>
Sincerely,<br>
Dario<br>
<br>
<br>
<br>
<br>
On 05/16/2014 11:54 AM, Barry Smith wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On May 16, 2014, at 10:46 AM, Dario Isola <<a href="mailto:dario.isola@newmerical.com" target="_blank">dario.isola@newmerical.com</a>><br>
wrote:<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Dear all,<br>
<br>
I am investigating the use of hypre+petsc. I was able to successfully configure, install, compile petsc 3.3 with the external package for hypre.<br>
<br>
I tried to run it with the following options<br>
-pc_type hypre -pc_type_hypre pilut -ksp_type richardson<br>
and, although he did not complain, it does not solve the system either.<br>
<br>
</blockquote>
Do you meaning it did not converge? At first always run with -ksp_view (or -snes_view if using snes or -ts_view if using ts) and -ksp_monitor_true_residual to see what is going on.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-pc_type_hypre pilut<br>
<br>
</blockquote>
is wrong it is -pc_hypre_type pilut<br>
<br>
Note that pilut will generally not work with Richardson you need a “real” Krylov method like GMRES.<br>
<br>
Also the ilu type preconditioners don’t scale particularly well though occasionally they can be fine.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
To what extent is hypre supported by petsc? More specifically, what kind of matrices?<br>
<br>
</blockquote>
If it cannot handle the matrix type it would give an error message. Hypre uses a format like AIJ so you should use AIJ. Note that you can make the matrix type a runtime option so you don’t have to compile in that it is BAIJ.<br>
<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I am using a baij matrix.<br>
<br>
Thanks in advance,<br>
D<br>
<br>
</blockquote></blockquote></blockquote></blockquote>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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>