[petsc-users] Solving Linear Systems with Scalar Real and Complex

Pierpaolo Minelli pierpaolo.minelli at cnr.it
Fri Aug 3 03:01:47 CDT 2018


In this simulation I'm solving two equations in a two-dimensional domain (z,r) at each time step. The first is an equation derived from the Maxwell equation. Taking advantage of the fact that the domain is axialsymmetric and applying a temporal harmonic approximation, the equation I am solving is the following:



The second equation is a Poisson’s  equation in cylindrical coordinates (z,r) in the field of real numbers.

This is the output obtained using these options (Note that at this moment of development I am only using a processor):

-pc_type gamg -pc_gamg_agg_nsmooths 1 -pc_gamg_reuse_interpolation true -pc_gamg_square_graph 1 -pc_gamg_threshold 0. -ksp_rtol 1.e-7 -ksp_max_it 30 -ksp_monitor_true_residual -info | grep GAMG

[0] PCSetUp_GAMG(): level 0) N=321201, n data rows=1, n data cols=1, nnz/row (ave)=5, np=1
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 4.97011 nnz ave. (N=321201)
[0] PCGAMGCoarsen_AGG(): Square Graph on level 1 of 1 to square
[0] PCGAMGProlongator_AGG(): New grid 45754 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.972526e+00 min=3.461411e-03 PC=jacobi
[0] PCSetUp_GAMG(): 1) N=45754, n data cols=1, nnz/row (ave)=10, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 10.7695 nnz ave. (N=45754)
[0] PCGAMGProlongator_AGG(): New grid 7893 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=5.686837e+00 min=5.062501e-01 PC=jacobi
[0] PCSetUp_GAMG(): 2) N=7893, n data cols=1, nnz/row (ave)=23, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 23.2179 nnz ave. (N=7893)
[0] PCGAMGProlongator_AGG(): New grid 752 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.504451e+01 min=2.124898e-02 PC=jacobi
[0] PCSetUp_GAMG(): 3) N=752, n data cols=1, nnz/row (ave)=30, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 30.7367 nnz ave. (N=752)
[0] PCGAMGProlongator_AGG(): New grid 56 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=7.781296e+00 min=2.212257e-02 PC=jacobi
[0] PCSetUp_GAMG(): 4) N=56, n data cols=1, nnz/row (ave)=22, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 22.9643 nnz ave. (N=56)
[0] PCGAMGProlongator_AGG(): New grid 6 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.525086e+00 min=1.375043e-01 PC=jacobi
[0] PCSetUp_GAMG(): 5) N=6, n data cols=1, nnz/row (ave)=6, 1 active pes
[0] PCSetUp_GAMG(): 6 levels, grid complexity = 1.43876
[0] PCSetUp_GAMG(): level 0) N=321201, n data rows=1, n data cols=1, nnz/row (ave)=5, np=1
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 4.97011 nnz ave. (N=321201)
[0] PCGAMGCoarsen_AGG(): Square Graph on level 1 of 1 to square
[0] PCGAMGProlongator_AGG(): New grid 45754 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.972526e+00 min=3.461411e-03 PC=jacobi
[0] PCSetUp_GAMG(): 1) N=45754, n data cols=1, nnz/row (ave)=10, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 10.7695 nnz ave. (N=45754)
[0] PCGAMGProlongator_AGG(): New grid 7893 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=5.686837e+00 min=5.062501e-01 PC=jacobi
[0] PCSetUp_GAMG(): 2) N=7893, n data cols=1, nnz/row (ave)=23, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 23.2179 nnz ave. (N=7893)
[0] PCGAMGProlongator_AGG(): New grid 752 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.504451e+01 min=2.124898e-02 PC=jacobi
[0] PCSetUp_GAMG(): 3) N=752, n data cols=1, nnz/row (ave)=30, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 30.7367 nnz ave. (N=752)
[0] PCGAMGProlongator_AGG(): New grid 56 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=7.781296e+00 min=2.212257e-02 PC=jacobi
[0] PCSetUp_GAMG(): 4) N=56, n data cols=1, nnz/row (ave)=22, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 22.9643 nnz ave. (N=56)
[0] PCGAMGProlongator_AGG(): New grid 6 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.525086e+00 min=1.375043e-01 PC=jacobi
[0] PCSetUp_GAMG(): 5) N=6, n data cols=1, nnz/row (ave)=6, 1 active pes
[0] PCSetUp_GAMG(): 6 levels, grid complexity = 1.43876
[0] PCSetUp_GAMG(): level 0) N=271201, n data rows=1, n data cols=1, nnz/row (ave)=5, np=1
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 4.97455 nnz ave. (N=271201)
[0] PCGAMGCoarsen_AGG(): Square Graph on level 1 of 1 to square
[0] PCGAMGProlongator_AGG(): New grid 38501 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.933798e+00 min=4.684075e-02 PC=jacobi
[0] PCSetUp_GAMG(): 1) N=38501, n data cols=1, nnz/row (ave)=10, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 10.7732 nnz ave. (N=38501)
[0] PCGAMGProlongator_AGG(): New grid 6664 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.623029e+00 min=1.250957e-02 PC=jacobi
[0] PCSetUp_GAMG(): 2) N=6664, n data cols=1, nnz/row (ave)=23, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 23.2098 nnz ave. (N=6664)
[0] PCGAMGProlongator_AGG(): New grid 620 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.763329e+00 min=1.611776e-02 PC=jacobi
[0] PCSetUp_GAMG(): 3) N=620, n data cols=1, nnz/row (ave)=29, 1 active pes
[0] PCGAMGFilterGraph(): 	 100.% nnz after filtering, with threshold 0., 29.6129 nnz ave. (N=620)
[0] PCGAMGProlongator_AGG(): New grid 46 nodes
[0] PCGAMGOptProlongator_AGG(): Smooth P0: max eigen=1.497611e+00 min=2.630403e-02 PC=jacobi
[0] PCSetUp_GAMG(): 4) N=46, n data cols=1, nnz/row (ave)=20, 1 active pes
[0] PCSetUp_GAMG(): 5 levels, grid complexity = 1.43639




> Il giorno 02 ago 2018, alle ore 17:39, Mark Adams <mfadams at lbl.gov> ha scritto:
> 
> It looks like ML and hypre are working well now. If you want to debug GAMG you can run with -info, which is very noisy, and grep on GAMG or send the whole output.
> 
> BTW, what equations are you solving?
> 
> On Thu, Aug 2, 2018 at 5:12 AM Pierpaolo Minelli <pierpaolo.minelli at cnr.it <mailto:pierpaolo.minelli at cnr.it>> wrote:
> Thank you very much for the correction.
> By rebalancing the matrix coefficients, making them dimensionless, in my complex problem i managed to obtain a better result with both ML and HYPRE. GAMG instead seems to be unable to converge and in fact I get unexpected results. I report the outputs of the three simulations again (i tried to use also -pc_gamg_square_graph 20 without any improvement).
> 
> Pierpaolo
> 
> -pc_type hypre -ksp_rtol 1.e-7 -ksp_monitor_true_residual
> 
>   0 KSP preconditioned resid norm 1.984853668904e-02 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 1.924446712661e-04 true resid norm 1.204260204811e-04 ||r(i)||/||b|| 4.041323752460e-02
>   2 KSP preconditioned resid norm 5.161509100765e-06 true resid norm 2.810809726926e-06 ||r(i)||/||b|| 9.432672496933e-04
>   3 KSP preconditioned resid norm 9.297326931238e-08 true resid norm 4.474617977876e-08 ||r(i)||/||b|| 1.501617328625e-05
>   4 KSP preconditioned resid norm 1.910271882670e-09 true resid norm 9.637470658283e-10 ||r(i)||/||b|| 3.234196308186e-07
>   0 KSP preconditioned resid norm 2.157687745805e+04 true resid norm 3.182001523188e+03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 1.949268476386e+02 true resid norm 1.243419788627e+02 ||r(i)||/||b|| 3.907665598415e-02
>   2 KSP preconditioned resid norm 5.078054475792e+00 true resid norm 2.745355604400e+00 ||r(i)||/||b|| 8.627763325675e-04
>   3 KSP preconditioned resid norm 8.663802743529e-02 true resid norm 4.254290979292e-02 ||r(i)||/||b|| 1.336985839979e-05
>   4 KSP preconditioned resid norm 1.795605563039e-03 true resid norm 9.040507428245e-04 ||r(i)||/||b|| 2.841138623714e-07
>   0 KSP preconditioned resid norm 6.728304961395e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 2.190497539532e+01 true resid norm 4.630095820203e+02 ||r(i)||/||b|| 2.463500802413e+00
>   2 KSP preconditioned resid norm 8.425561564252e-01 true resid norm 7.012565302251e+01 ||r(i)||/||b|| 3.731123700223e-01
>   3 KSP preconditioned resid norm 3.029848345705e-02 true resid norm 4.379018464663e+00 ||r(i)||/||b|| 2.329911932795e-02
>   4 KSP preconditioned resid norm 7.374025528575e-04 true resid norm 1.337183702137e-01 ||r(i)||/||b|| 7.114654320570e-04
>   5 KSP preconditioned resid norm 3.009400175162e-05 true resid norm 7.731135032616e-03 ||r(i)||/||b|| 4.113447776459e-05
> 
> -pc_type ml -ksp_rtol 1.e-7 -ksp_monitor_true_residual
> 
>   0 KSP preconditioned resid norm 1.825767020538e-02 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 6.495628259383e-04 true resid norm 3.739440526742e-04 ||r(i)||/||b|| 1.254902367550e-01
>   2 KSP preconditioned resid norm 4.971875712015e-05 true resid norm 2.118856024328e-05 ||r(i)||/||b|| 7.110575559127e-03
>   3 KSP preconditioned resid norm 3.726806462912e-06 true resid norm 1.370355844514e-06 ||r(i)||/||b|| 4.598716790303e-04
>   4 KSP preconditioned resid norm 2.496898447120e-07 true resid norm 9.494701893753e-08 ||r(i)||/||b|| 3.186285167645e-05
>   5 KSP preconditioned resid norm 1.541814409235e-08 true resid norm 6.216753346769e-09 ||r(i)||/||b|| 2.086252859898e-06
>   6 KSP preconditioned resid norm 1.153890845138e-09 true resid norm 5.290239857745e-10 ||r(i)||/||b|| 1.775328281039e-07
>   0 KSP preconditioned resid norm 1.961448048639e+04 true resid norm 3.182001523188e+03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 7.940694187370e+02 true resid norm 4.331011797078e+02 ||r(i)||/||b|| 1.361096707691e-01
>   2 KSP preconditioned resid norm 6.141876183555e+01 true resid norm 2.734346095946e+01 ||r(i)||/||b|| 8.593164007057e-03
>   3 KSP preconditioned resid norm 4.872887149917e+00 true resid norm 1.774255242955e+00 ||r(i)||/||b|| 5.575909470898e-04
>   4 KSP preconditioned resid norm 3.088357668927e-01 true resid norm 1.183728642343e-01 ||r(i)||/||b|| 3.720075662179e-05
>   5 KSP preconditioned resid norm 2.030016543073e-02 true resid norm 7.924623904393e-03 ||r(i)||/||b|| 2.490452580442e-06
>   6 KSP preconditioned resid norm 1.458276941086e-03 true resid norm 6.781128809522e-04 ||r(i)||/||b|| 2.131089114856e-07
>   0 KSP preconditioned resid norm 6.230592591466e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 3.825349376322e+01 true resid norm 7.755266613308e+02 ||r(i)||/||b|| 4.126287287931e+00
>   2 KSP preconditioned resid norm 4.321561767174e+00 true resid norm 2.170558998883e+02 ||r(i)||/||b|| 1.154873255992e+00
>   3 KSP preconditioned resid norm 2.806349660119e-01 true resid norm 2.931496742303e+01 ||r(i)||/||b|| 1.559739767247e-01
>   4 KSP preconditioned resid norm 1.707567397460e-02 true resid norm 2.684913551118e+00 ||r(i)||/||b|| 1.428542074383e-02
>   5 KSP preconditioned resid norm 1.741069717192e-03 true resid norm 2.914639372698e-01 ||r(i)||/||b|| 1.550770591410e-03
>   6 KSP preconditioned resid norm 1.460913620440e-04 true resid norm 3.460791330512e-02 ||r(i)||/||b|| 1.841357619965e-04
>   7 KSP preconditioned resid norm 1.741167177387e-05 true resid norm 3.396573365236e-03 ||r(i)||/||b|| 1.807189642642e-05
> 
> -pc_type gamg -pc_gamg_agg_nsmooths 1 -pc_gamg_reuse_interpolation true -pc_gamg_square_graph 1 -pc_gamg_threshold 0. -ksp_rtol 1.e-7 -ksp_max_it 30 -ksp_monitor_true_residual
> 
>   0 KSP preconditioned resid norm 1.244808265687e+15 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 3.064535247522e+14 true resid norm 2.984544079484e-03 ||r(i)||/||b|| 1.001569995463e+00
>   2 KSP preconditioned resid norm 5.618140421534e+12 true resid norm 2.985603691163e-03 ||r(i)||/||b|| 1.001925585876e+00
>   3 KSP preconditioned resid norm 1.553607230691e+12 true resid norm 2.986068066312e-03 ||r(i)||/||b|| 1.002081423486e+00
>   4 KSP preconditioned resid norm 2.754119595329e+11 true resid norm 2.986119711375e-03 ||r(i)||/||b|| 1.002098754825e+00
>   5 KSP preconditioned resid norm 2.443949058171e+11 true resid norm 2.986120048522e-03 ||r(i)||/||b|| 1.002098867967e+00
>   6 KSP preconditioned resid norm 5.097094561118e+10 true resid norm 2.986121310105e-03 ||r(i)||/||b|| 1.002099291336e+00
>   7 KSP preconditioned resid norm 5.917979151193e+09 true resid norm 2.986121369446e-03 ||r(i)||/||b|| 1.002099311250e+00
>   8 KSP preconditioned resid norm 5.917672183458e+09 true resid norm 2.986121369424e-03 ||r(i)||/||b|| 1.002099311243e+00
>   9 KSP preconditioned resid norm 4.641300731865e+08 true resid norm 2.986121370475e-03 ||r(i)||/||b|| 1.002099311595e+00
>  10 KSP preconditioned resid norm 4.634203577645e+08 true resid norm 2.986121382852e-03 ||r(i)||/||b|| 1.002099315749e+00
>  11 KSP preconditioned resid norm 4.587254969048e+08 true resid norm 2.986121419848e-03 ||r(i)||/||b|| 1.002099328164e+00
>  12 KSP preconditioned resid norm 4.586269695339e+08 true resid norm 2.986121536662e-03 ||r(i)||/||b|| 1.002099367365e+00
>  13 KSP preconditioned resid norm 4.581015928356e+08 true resid norm 2.986122475198e-03 ||r(i)||/||b|| 1.002099682325e+00
>  14 KSP preconditioned resid norm 4.571106094607e+08 true resid norm 2.986124378604e-03 ||r(i)||/||b|| 1.002100321080e+00
>  15 KSP preconditioned resid norm 4.536929046842e+08 true resid norm 2.986134395719e-03 ||r(i)||/||b|| 1.002103682680e+00
>  16 KSP preconditioned resid norm 4.535016059345e+08 true resid norm 2.986135027367e-03 ||r(i)||/||b|| 1.002103894652e+00
>  17 KSP preconditioned resid norm 4.534978476038e+08 true resid norm 2.986135001016e-03 ||r(i)||/||b|| 1.002103885808e+00
>  18 KSP preconditioned resid norm 4.467301680293e+08 true resid norm 2.986152055223e-03 ||r(i)||/||b|| 1.002109608955e+00
>  19 KSP preconditioned resid norm 4.310227073192e+08 true resid norm 2.986506137056e-03 ||r(i)||/||b|| 1.002228433717e+00
>  20 KSP preconditioned resid norm 3.520200847767e+08 true resid norm 2.989053346159e-03 ||r(i)||/||b|| 1.003083240395e+00
>  21 KSP preconditioned resid norm 3.273563895836e+08 true resid norm 2.990009521982e-03 ||r(i)||/||b|| 1.003404119226e+00
>  22 KSP preconditioned resid norm 1.692012480634e+08 true resid norm 2.999909265923e-03 ||r(i)||/||b|| 1.006726330669e+00
>  23 KSP preconditioned resid norm 1.616841528495e+08 true resid norm 3.002594301034e-03 ||r(i)||/||b|| 1.007627389770e+00
>  24 KSP preconditioned resid norm 1.588031462511e+08 true resid norm 3.003789395992e-03 ||r(i)||/||b|| 1.008028446420e+00
>  25 KSP preconditioned resid norm 1.585650863283e+08 true resid norm 3.003987247746e-03 ||r(i)||/||b|| 1.008094842618e+00
>  26 KSP preconditioned resid norm 1.482994894928e+08 true resid norm 3.004024810257e-03 ||r(i)||/||b|| 1.008107448056e+00
>  27 KSP preconditioned resid norm 1.293588493466e+08 true resid norm 3.005576275194e-03 ||r(i)||/||b|| 1.008628097337e+00
>  28 KSP preconditioned resid norm 1.082178475680e+08 true resid norm 3.010519288328e-03 ||r(i)||/||b|| 1.010286901332e+00
>   0 KSP preconditioned resid norm 4.688654651573e+20 true resid norm 3.182001523188e+03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 4.673814485341e+20 true resid norm 3.182057223735e+03 ||r(i)||/||b|| 1.000017504878e+00
>   2 KSP preconditioned resid norm 1.203925723825e+19 true resid norm 3.185040065807e+03 ||r(i)||/||b|| 1.000954915514e+00
>   3 KSP preconditioned resid norm 3.042270671882e+18 true resid norm 3.187076078024e+03 ||r(i)||/||b|| 1.001594768198e+00
>   4 KSP preconditioned resid norm 5.678481873896e+17 true resid norm 3.187261697361e+03 ||r(i)||/||b|| 1.001653102343e+00
>   5 KSP preconditioned resid norm 4.462228267454e+17 true resid norm 3.187264158420e+03 ||r(i)||/||b|| 1.001653875774e+00
>   6 KSP preconditioned resid norm 9.314909592131e+16 true resid norm 3.187268102332e+03 ||r(i)||/||b|| 1.001655115218e+00
>   7 KSP preconditioned resid norm 8.843621410196e+15 true resid norm 3.187268285359e+03 ||r(i)||/||b|| 1.001655172737e+00
>   8 KSP preconditioned resid norm 8.214565462317e+15 true resid norm 3.187268286281e+03 ||r(i)||/||b|| 1.001655173027e+00
>   9 KSP preconditioned resid norm 4.525549868436e+14 true resid norm 3.187268287235e+03 ||r(i)||/||b|| 1.001655173327e+00
>  10 KSP preconditioned resid norm 4.522301211733e+14 true resid norm 3.187268289937e+03 ||r(i)||/||b|| 1.001655174176e+00
>  11 KSP preconditioned resid norm 4.295952793336e+14 true resid norm 3.187268328860e+03 ||r(i)||/||b|| 1.001655186408e+00
>  12 KSP preconditioned resid norm 4.294637249487e+14 true resid norm 3.187268422725e+03 ||r(i)||/||b|| 1.001655215907e+00
>  13 KSP preconditioned resid norm 4.285778654372e+14 true resid norm 3.187269536466e+03 ||r(i)||/||b|| 1.001655565920e+00
>  14 KSP preconditioned resid norm 4.162983479677e+14 true resid norm 3.187285280554e+03 ||r(i)||/||b|| 1.001660513777e+00
>  15 KSP preconditioned resid norm 4.162978556133e+14 true resid norm 3.187285288668e+03 ||r(i)||/||b|| 1.001660516326e+00
>  16 KSP preconditioned resid norm 4.161875124570e+14 true resid norm 3.187285309889e+03 ||r(i)||/||b|| 1.001660522996e+00
>  17 KSP preconditioned resid norm 4.117671313790e+14 true resid norm 3.187289951588e+03 ||r(i)||/||b|| 1.001661981731e+00
>  18 KSP preconditioned resid norm 4.103112320458e+14 true resid norm 3.187292327095e+03 ||r(i)||/||b|| 1.001662728276e+00
>  19 KSP preconditioned resid norm 4.032611123108e+14 true resid norm 3.187463967167e+03 ||r(i)||/||b|| 1.001716669191e+00
>  20 KSP preconditioned resid norm 3.432105733172e+14 true resid norm 3.189686334937e+03 ||r(i)||/||b|| 1.002415087389e+00
>  21 KSP preconditioned resid norm 3.125440416815e+14 true resid norm 3.191137543657e+03 ||r(i)||/||b|| 1.002871155278e+00
>  22 KSP preconditioned resid norm 2.214281952780e+14 true resid norm 3.198766855775e+03 ||r(i)||/||b|| 1.005268800931e+00
>  23 KSP preconditioned resid norm 2.205574806871e+14 true resid norm 3.198012835064e+03 ||r(i)||/||b|| 1.005031836647e+00
>  24 KSP preconditioned resid norm 2.202202974538e+14 true resid norm 3.197792157500e+03 ||r(i)||/||b|| 1.004962484838e+00
>  25 KSP preconditioned resid norm 2.188941573096e+14 true resid norm 3.197631986560e+03 ||r(i)||/||b|| 1.004912148300e+00
>  26 KSP preconditioned resid norm 1.811445509155e+14 true resid norm 3.201511171410e+03 ||r(i)||/||b|| 1.006131250435e+00
>  27 KSP preconditioned resid norm 1.333006235872e+14 true resid norm 3.207865456494e+03 ||r(i)||/||b|| 1.008128196394e+00
>  28 KSP preconditioned resid norm 1.290269724722e+14 true resid norm 3.209026547700e+03 ||r(i)||/||b|| 1.008493089747e+00
>  29 KSP preconditioned resid norm 8.645848930695e+13 true resid norm 3.216715733004e+03 ||r(i)||/||b|| 1.010909551603e+00
>  30 KSP preconditioned resid norm 7.051095175336e+13 true resid norm 3.219405322929e+03 ||r(i)||/||b|| 1.011754802589e+00
>   0 KSP preconditioned resid norm 4.970534641714e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 9.825390294838e+01 true resid norm 6.304087699909e+03 ||r(i)||/||b|| 3.354169267824e+01
>   2 KSP preconditioned resid norm 1.317425630977e+01 true resid norm 1.659038483292e+03 ||r(i)||/||b|| 8.827123224947e+00
>   3 KSP preconditioned resid norm 1.267331175258e+00 true resid norm 3.723773819327e+02 ||r(i)||/||b|| 1.981280765700e+00
>   4 KSP preconditioned resid norm 1.451198865319e-01 true resid norm 6.113281457366e+01 ||r(i)||/||b|| 3.252648403059e-01
>   5 KSP preconditioned resid norm 2.428012832580e-02 true resid norm 9.525516489005e+00 ||r(i)||/||b|| 5.068171032587e-02
>   6 KSP preconditioned resid norm 3.273131599046e-03 true resid norm 1.693121214500e+00 ||r(i)||/||b|| 9.008464689439e-03
>   7 KSP preconditioned resid norm 3.629020564958e-04 true resid norm 1.937921370699e-01 ||r(i)||/||b|| 1.031095475584e-03
>   8 KSP preconditioned resid norm 4.303742583350e-05 true resid norm 2.733022203972e-02 ||r(i)||/||b|| 1.454138889117e-04
> 
> -pc_type gamg -pc_gamg_agg_nsmooths 1 -pc_gamg_reuse_interpolation true -pc_gamg_square_graph 20 -pc_gamg_threshold 0. -ksp_rtol 1.e-7 -ksp_max_it 30 -ksp_monitor_true_residual
> 
>   0 KSP preconditioned resid norm 3.031864566839e+14 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 1.212883161649e+14 true resid norm 2.982229202367e-03 ||r(i)||/||b|| 1.000793156052e+00
>   2 KSP preconditioned resid norm 5.312941731712e+12 true resid norm 2.985627671175e-03 ||r(i)||/||b|| 1.001933633223e+00
>   3 KSP preconditioned resid norm 3.602406845592e+12 true resid norm 2.985818915765e-03 ||r(i)||/||b|| 1.001997812152e+00
>   4 KSP preconditioned resid norm 6.891073564923e+10 true resid norm 2.986120881484e-03 ||r(i)||/||b|| 1.002099147497e+00
>   5 KSP preconditioned resid norm 1.267096776171e+09 true resid norm 2.986121018547e-03 ||r(i)||/||b|| 1.002099193494e+00
>   6 KSP preconditioned resid norm 5.130735430694e+08 true resid norm 2.986121020564e-03 ||r(i)||/||b|| 1.002099194170e+00
>   7 KSP preconditioned resid norm 5.122457469991e+08 true resid norm 2.986121025937e-03 ||r(i)||/||b|| 1.002099195974e+00
>   8 KSP preconditioned resid norm 5.115042446514e+08 true resid norm 2.986121044146e-03 ||r(i)||/||b|| 1.002099202084e+00
>   9 KSP preconditioned resid norm 5.103842476065e+08 true resid norm 2.986121084005e-03 ||r(i)||/||b|| 1.002099215460e+00
>  10 KSP preconditioned resid norm 5.103414725629e+08 true resid norm 2.986121151167e-03 ||r(i)||/||b|| 1.002099237999e+00
>  11 KSP preconditioned resid norm 5.103050707318e+08 true resid norm 2.986121488999e-03 ||r(i)||/||b|| 1.002099351370e+00
>  12 KSP preconditioned resid norm 5.101511376685e+08 true resid norm 2.986123179301e-03 ||r(i)||/||b|| 1.002099918611e+00
>  13 KSP preconditioned resid norm 5.101218154297e+08 true resid norm 2.986123839891e-03 ||r(i)||/||b|| 1.002100140296e+00
>  14 KSP preconditioned resid norm 5.095285470767e+08 true resid norm 2.986138347067e-03 ||r(i)||/||b|| 1.002105008695e+00
>  15 KSP preconditioned resid norm 5.082373114330e+08 true resid norm 2.986170368742e-03 ||r(i)||/||b|| 1.002115754708e+00
>  16 KSP preconditioned resid norm 5.079055966450e+08 true resid norm 2.986178765357e-03 ||r(i)||/||b|| 1.002118572491e+00
>  17 KSP preconditioned resid norm 4.278159855635e+08 true resid norm 2.989173921061e-03 ||r(i)||/||b|| 1.003123703595e+00
>  18 KSP preconditioned resid norm 3.704767561598e+08 true resid norm 2.991993992919e-03 ||r(i)||/||b|| 1.004070079082e+00
>  19 KSP preconditioned resid norm 3.690160215681e+08 true resid norm 2.992090282533e-03 ||r(i)||/||b|| 1.004102392489e+00
>  20 KSP preconditioned resid norm 3.135406273863e+08 true resid norm 2.996344554486e-03 ||r(i)||/||b|| 1.005530064867e+00
>  21 KSP preconditioned resid norm 1.938459923255e+08 true resid norm 3.005844334042e-03 ||r(i)||/||b|| 1.008718054025e+00
>  22 KSP preconditioned resid norm 1.827826394560e+08 true resid norm 3.007605246670e-03 ||r(i)||/||b|| 1.009308990933e+00
>  23 KSP preconditioned resid norm 1.108660460314e+08 true resid norm 3.020965814060e-03 ||r(i)||/||b|| 1.013792604867e+00
>  24 KSP preconditioned resid norm 1.051235646374e+08 true resid norm 3.021541389078e-03 ||r(i)||/||b|| 1.013985759551e+00
>  25 KSP preconditioned resid norm 7.173044522784e+07 true resid norm 3.024254088703e-03 ||r(i)||/||b|| 1.014896102464e+00
>  26 KSP preconditioned resid norm 6.350860057272e+07 true resid norm 3.023434854983e-03 ||r(i)||/||b|| 1.014621179430e+00
>  27 KSP preconditioned resid norm 5.267152287984e+07 true resid norm 3.022203752421e-03 ||r(i)||/||b|| 1.014208039146e+00
>  28 KSP preconditioned resid norm 4.650599761568e+07 true resid norm 3.022093139351e-03 ||r(i)||/||b|| 1.014170918994e+00
>  29 KSP preconditioned resid norm 3.141941642480e+07 true resid norm 3.023444082486e-03 ||r(i)||/||b|| 1.014624276047e+00
>  30 KSP preconditioned resid norm 2.065598123858e+07 true resid norm 3.024498453617e-03 ||r(i)||/||b|| 1.014978107808e+00
>   0 KSP preconditioned resid norm 4.257133849062e+20 true resid norm 3.182001523188e+03 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 2.793742274994e+19 true resid norm 3.184922256681e+03 ||r(i)||/||b|| 1.000917891922e+00
>   2 KSP preconditioned resid norm 1.137325629643e+19 true resid norm 3.185147137826e+03 ||r(i)||/||b|| 1.000988564781e+00
>   3 KSP preconditioned resid norm 7.164960007703e+18 true resid norm 3.186117509159e+03 ||r(i)||/||b|| 1.001293521056e+00
>   4 KSP preconditioned resid norm 1.109461464210e+17 true resid norm 3.187268097356e+03 ||r(i)||/||b|| 1.001655113654e+00
>   5 KSP preconditioned resid norm 1.984768045830e+15 true resid norm 3.187268427639e+03 ||r(i)||/||b|| 1.001655217451e+00
>   6 KSP preconditioned resid norm 7.354105789290e+14 true resid norm 3.187268429720e+03 ||r(i)||/||b|| 1.001655218105e+00
>   7 KSP preconditioned resid norm 6.662738391887e+14 true resid norm 3.187268442496e+03 ||r(i)||/||b|| 1.001655222120e+00
>   8 KSP preconditioned resid norm 5.358556594776e+14 true resid norm 3.187268479547e+03 ||r(i)||/||b|| 1.001655233764e+00
>   9 KSP preconditioned resid norm 5.055368509046e+14 true resid norm 3.187268491131e+03 ||r(i)||/||b|| 1.001655237405e+00
>  10 KSP preconditioned resid norm 5.050370080533e+14 true resid norm 3.187268557074e+03 ||r(i)||/||b|| 1.001655258129e+00
>  11 KSP preconditioned resid norm 5.049526065770e+14 true resid norm 3.187269209319e+03 ||r(i)||/||b|| 1.001655463108e+00
>  12 KSP preconditioned resid norm 5.048442087580e+14 true resid norm 3.187270145328e+03 ||r(i)||/||b|| 1.001655757265e+00
>  13 KSP preconditioned resid norm 5.048317293084e+14 true resid norm 3.187270420057e+03 ||r(i)||/||b|| 1.001655843604e+00
>  14 KSP preconditioned resid norm 5.046339848740e+14 true resid norm 3.187276012517e+03 ||r(i)||/||b|| 1.001657601133e+00
>  15 KSP preconditioned resid norm 5.036574780195e+14 true resid norm 3.187304228896e+03 ||r(i)||/||b|| 1.001666468627e+00
>  16 KSP preconditioned resid norm 5.033948448037e+14 true resid norm 3.187311929535e+03 ||r(i)||/||b|| 1.001668888688e+00
>  17 KSP preconditioned resid norm 4.374073117273e+14 true resid norm 3.190248474209e+03 ||r(i)||/||b|| 1.002591749552e+00
>  18 KSP preconditioned resid norm 3.454318321770e+14 true resid norm 3.195991944291e+03 ||r(i)||/||b|| 1.004396736143e+00
>  19 KSP preconditioned resid norm 3.438483821871e+14 true resid norm 3.196113376292e+03 ||r(i)||/||b|| 1.004434898287e+00
>  20 KSP preconditioned resid norm 3.090011643835e+14 true resid norm 3.199125186774e+03 ||r(i)||/||b|| 1.005381412756e+00
>  21 KSP preconditioned resid norm 1.976112359751e+14 true resid norm 3.209202875553e+03 ||r(i)||/||b|| 1.008548503879e+00
>  22 KSP preconditioned resid norm 1.874048396302e+14 true resid norm 3.210733816807e+03 ||r(i)||/||b|| 1.009029629122e+00
>  23 KSP preconditioned resid norm 1.086663247242e+14 true resid norm 3.224219602770e+03 ||r(i)||/||b|| 1.013267774787e+00
>  24 KSP preconditioned resid norm 1.036005882413e+14 true resid norm 3.224749127723e+03 ||r(i)||/||b|| 1.013434187326e+00
>  25 KSP preconditioned resid norm 6.943244220256e+13 true resid norm 3.227732423395e+03 ||r(i)||/||b|| 1.014371740514e+00
>  26 KSP preconditioned resid norm 6.064453821356e+13 true resid norm 3.227303114420e+03 ||r(i)||/||b|| 1.014236822611e+00
>  27 KSP preconditioned resid norm 5.237876331038e+13 true resid norm 3.226320811775e+03 ||r(i)||/||b|| 1.013928116710e+00
>  28 KSP preconditioned resid norm 4.407157490353e+13 true resid norm 3.226123552298e+03 ||r(i)||/||b|| 1.013866124447e+00
>  29 KSP preconditioned resid norm 3.691867703712e+13 true resid norm 3.226578266524e+03 ||r(i)||/||b|| 1.014009026398e+00
>   0 KSP preconditioned resid norm 4.105203293801e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>   1 KSP preconditioned resid norm 1.404700393158e+02 true resid norm 5.941722233814e+03 ||r(i)||/||b|| 3.161368157187e+01
>   2 KSP preconditioned resid norm 3.849004101235e+01 true resid norm 3.456178528017e+03 ||r(i)||/||b|| 1.838903320294e+01
>   3 KSP preconditioned resid norm 8.384263059954e+00 true resid norm 1.401839902990e+03 ||r(i)||/||b|| 7.458665781386e+00
>   4 KSP preconditioned resid norm 1.363029002549e+00 true resid norm 3.612540200618e+02 ||r(i)||/||b|| 1.922097517753e+00
>   5 KSP preconditioned resid norm 3.734525206097e-01 true resid norm 1.272038960182e+02 ||r(i)||/||b|| 6.768043515285e-01
>   6 KSP preconditioned resid norm 8.146021124788e-02 true resid norm 3.196642795661e+01 ||r(i)||/||b|| 1.700814064749e-01
>   7 KSP preconditioned resid norm 2.110568459516e-02 true resid norm 6.793208791728e+00 ||r(i)||/||b|| 3.614412305757e-02
>   8 KSP preconditioned resid norm 4.044708317961e-03 true resid norm 1.976363197299e+00 ||r(i)||/||b|| 1.051548933644e-02
>   9 KSP preconditioned resid norm 9.154675861687e-04 true resid norm 3.458820713849e-01 ||r(i)||/||b|| 1.840309128547e-03
>  10 KSP preconditioned resid norm 2.106487039520e-04 true resid norm 1.064965566696e-01 ||r(i)||/||b|| 5.666283442018e-04
>  11 KSP preconditioned resid norm 5.145654020522e-05 true resid norm 2.436255895394e-02 ||r(i)||/||b|| 1.296240636532e-04
>  12 KSP preconditioned resid norm 1.223910887488e-05 true resid norm 4.954689842368e-03 ||r(i)||/||b|| 2.636205140533e-05
> 
>> Il giorno 01 ago 2018, alle ore 15:41, Matthew Knepley <knepley at gmail.com <mailto:knepley at gmail.com>> ha scritto:
>> 
>> On Wed, Aug 1, 2018 at 9:02 AM Pierpaolo Minelli <pierpaolo.minelli at cnr.it <mailto:pierpaolo.minelli at cnr.it>> wrote:
>>> Il giorno 27 lug 2018, alle ore 18:32, Smith, Barry F. <bsmith at mcs.anl.gov <mailto:bsmith at mcs.anl.gov>> ha scritto:
>>> 
>>>> On Jul 27, 2018, at 3:26 AM, Pierpaolo Minelli <pierpaolo.minelli at cnr.it <mailto:pierpaolo.minelli at cnr.it>> wrote:
>>>> 
>>>> 
>>>> Finally, I have a question. In my simulation I solve the two systems at each step of the calculation, and it was my habit to use the following option after the first resolution and before solving the system in the second time step:
>>>> 
>>>> call KSPSetInitialGuessNonzero(ksp,PETSC_TRUE,ierr)
>>>> 
>>>> Since this option was incompatible with the use of MUMPS or SuperLU_Dist, I commented on it and noticed, to my surprise, that iterative methods were not affected by this comment, rather they were slightly faster. Is this normal? Or do I use this command incorrectly?
>>> 
>>>   Presuming this is a linear problem?
>>> 
>>>   You should run with -ksp_monitor_true_residual and compare the final residual norms (at linear system convergence). Since KSP uses a relative decrease in the residual norm to declare convergence what you have told us isn't enough to determine if one is converging "faster" to the solution then the other.
>>> 
>>>   Barry
>> 
>> Yes, there are two linear problems. The first in the field of complex numbers (which I divided into two problems in the field of real numbers as suggested by Matthew) and the second in the field of real numbers. 
>> 
>> These are the results obtained using the option -ksp_monitor_true_residual:
>> 
>> -pc_type gamg -pc_gamg_agg_nsmooths 1 -pc_gamg_reuse_interpolation true -pc_gamg_square_graph 1 -pc_gamg_threshold 0. -ksp_rtol 1.e-7 -ksp_monitor_true_residual
>> 
>>   0 KSP preconditioned resid norm 1.324344286254e-02 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 3.399266083153e-03 true resid norm 1.196951495628e+05 ||r(i)||/||b|| 4.016796777391e+07
>>   2 KSP preconditioned resid norm 6.287919852336e-04 true resid norm 4.429876706490e+04 ||r(i)||/||b|| 1.486602802524e+07
>>   3 KSP preconditioned resid norm 8.836547690039e-05 true resid norm 1.182383826632e+04 ||r(i)||/||b|| 3.967909778970e+06
>>   4 KSP preconditioned resid norm 1.291370058561e-05 true resid norm 2.801893692950e+03 ||r(i)||/||b|| 9.402751571421e+05
>>   5 KSP preconditioned resid norm 2.073922228951e-06 true resid norm 6.312112895919e+02 ||r(i)||/||b|| 2.118254150770e+05
>>   6 KSP preconditioned resid norm 3.283811876800e-07 true resid norm 8.777865833701e+01 ||r(i)||/||b|| 2.945725313178e+04
>>   7 KSP preconditioned resid norm 5.414680273500e-08 true resid norm 1.610127004050e+01 ||r(i)||/||b|| 5.403354258448e+03
>>   8 KSP preconditioned resid norm 9.645834363683e-09 true resid norm 3.006444251909e+00 ||r(i)||/||b|| 1.008919377818e+03
>>   9 KSP preconditioned resid norm 1.915420455785e-09 true resid norm 6.672996533262e-01 ||r(i)||/||b|| 2.239361500298e+02
>>  10 KSP preconditioned resid norm 3.334928638696e-10 true resid norm 1.185976397497e-01 ||r(i)||/||b|| 3.979965929219e+01
>> 
>> You can see from the "true resid norm" that your complex problem is not actually being solved. ML and Hypre have similar results.
>> I would guess that your coarse grid is near singular.
>> 
>> The real problem is being solved correctly, although you are still 100x off the true residual so the preconditioner is not great.
>> Have you tested with a manufactured solution?
>> 
>>   Thanks,
>> 
>>      Matt
> 
> 
> 
> 
> 
> 
> 
>>  
>>   0 KSP preconditioned resid norm 1.416256896904e+04 true resid norm 6.623626291881e+05 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 3.781264980774e+03 true resid norm 1.283809201228e+11 ||r(i)||/||b|| 1.938227104995e+05
>>   2 KSP preconditioned resid norm 7.392413714593e+02 true resid norm 4.990467508600e+10 ||r(i)||/||b|| 7.534343407504e+04
>>   3 KSP preconditioned resid norm 1.087641767696e+02 true resid norm 1.367263690390e+10 ||r(i)||/||b|| 2.064222270610e+04
>>   4 KSP preconditioned resid norm 1.627726591174e+01 true resid norm 3.451534923895e+09 ||r(i)||/||b|| 5.210944536719e+03
>>   5 KSP preconditioned resid norm 2.564636460142e+00 true resid norm 7.980525032990e+08 ||r(i)||/||b|| 1.204857381941e+03
>>   6 KSP preconditioned resid norm 4.252626820180e-01 true resid norm 1.151817528111e+08 ||r(i)||/||b|| 1.738953070953e+02
>>   7 KSP preconditioned resid norm 6.758292325957e-02 true resid norm 2.065701091779e+07 ||r(i)||/||b|| 3.118686050134e+01
>>   8 KSP preconditioned resid norm 1.099617201063e-02 true resid norm 3.470561062696e+06 ||r(i)||/||b|| 5.239669192917e+00
>>   9 KSP preconditioned resid norm 2.195352537111e-03 true resid norm 7.056823048483e+05 ||r(i)||/||b|| 1.065401750871e+00
>>  10 KSP preconditioned resid norm 4.380752631896e-04 true resid norm 1.440377395627e+05 ||r(i)||/||b|| 2.174605468598e-01
>> 
>>   0 KSP preconditioned resid norm 4.970534641714e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 9.825390294838e+01 true resid norm 6.304087699909e+03 ||r(i)||/||b|| 3.354169267824e+01
>>   2 KSP preconditioned resid norm 1.317425630977e+01 true resid norm 1.659038483292e+03 ||r(i)||/||b|| 8.827123224947e+00
>>   3 KSP preconditioned resid norm 1.267331175258e+00 true resid norm 3.723773819327e+02 ||r(i)||/||b|| 1.981280765700e+00
>>   4 KSP preconditioned resid norm 1.451198865319e-01 true resid norm 6.113281457366e+01 ||r(i)||/||b|| 3.252648403059e-01
>>   5 KSP preconditioned resid norm 2.428012832580e-02 true resid norm 9.525516489005e+00 ||r(i)||/||b|| 5.068171032587e-02
>>   6 KSP preconditioned resid norm 3.273131599046e-03 true resid norm 1.693121214500e+00 ||r(i)||/||b|| 9.008464689439e-03
>>   7 KSP preconditioned resid norm 3.629020564958e-04 true resid norm 1.937921370699e-01 ||r(i)||/||b|| 1.031095475584e-03
>>   8 KSP preconditioned resid norm 4.303742583350e-05 true resid norm 2.733022203972e-02 ||r(i)||/||b|| 1.454138889117e-04
>> 
>> -pc_type ml -ksp_rtol 1.e-7 -ksp_monitor_true_residual
>> 
>>   0 KSP preconditioned resid norm 1.825767020537e-02 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 6.495628259378e-04 true resid norm 1.373525306349e+04 ||r(i)||/||b|| 4.609353047603e+06
>>   2 KSP preconditioned resid norm 4.971875712010e-05 true resid norm 2.154150315236e+03 ||r(i)||/||b|| 7.229018114651e+05
>>   3 KSP preconditioned resid norm 3.726806462903e-06 true resid norm 3.000693510070e+02 ||r(i)||/||b|| 1.006989511706e+05
>>   4 KSP preconditioned resid norm 2.496898447113e-07 true resid norm 3.004338446358e+01 ||r(i)||/||b|| 1.008212699813e+04
>>   5 KSP preconditioned resid norm 1.541814409235e-08 true resid norm 2.256927674575e+00 ||r(i)||/||b|| 7.573924125705e+02
>>   6 KSP preconditioned resid norm 1.153890845088e-09 true resid norm 2.007294077611e-01 ||r(i)||/||b|| 6.736189738408e+01
>>   0 KSP preconditioned resid norm 1.961448048638e+04 true resid norm 6.623626291881e+05 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 7.940694187362e+02 true resid norm 1.483756468402e+10 ||r(i)||/||b|| 2.240096894085e+04
>>   2 KSP preconditioned resid norm 6.141876183549e+01 true resid norm 2.581042149104e+09 ||r(i)||/||b|| 3.896720671376e+03
>>   3 KSP preconditioned resid norm 4.872887149903e+00 true resid norm 3.544664743366e+08 ||r(i)||/||b|| 5.351547003355e+02
>>   4 KSP preconditioned resid norm 3.088357668912e-01 true resid norm 3.689655474675e+07 ||r(i)||/||b|| 5.570446326655e+01
>>   5 KSP preconditioned resid norm 2.030016543101e-02 true resid norm 2.847019997470e+06 ||r(i)||/||b|| 4.298279933093e+00
>>   6 KSP preconditioned resid norm 1.458276940703e-03 true resid norm 2.567051860886e+05 ||r(i)||/||b|| 3.875598875547e-01
>> 
>>   0 KSP preconditioned resid norm 6.230592591466e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 3.825349376322e+01 true resid norm 7.755266613308e+02 ||r(i)||/||b|| 4.126287287931e+00
>>   2 KSP preconditioned resid norm 4.321561767174e+00 true resid norm 2.170558998883e+02 ||r(i)||/||b|| 1.154873255992e+00
>>   3 KSP preconditioned resid norm 2.806349660119e-01 true resid norm 2.931496742303e+01 ||r(i)||/||b|| 1.559739767247e-01
>>   4 KSP preconditioned resid norm 1.707567397460e-02 true resid norm 2.684913551118e+00 ||r(i)||/||b|| 1.428542074383e-02
>>   5 KSP preconditioned resid norm 1.741069717192e-03 true resid norm 2.914639372698e-01 ||r(i)||/||b|| 1.550770591410e-03
>>   6 KSP preconditioned resid norm 1.460913620440e-04 true resid norm 3.460791330512e-02 ||r(i)||/||b|| 1.841357619965e-04
>>   7 KSP preconditioned resid norm 1.741167177387e-05 true resid norm 3.396573365236e-03 ||r(i)||/||b|| 1.807189642642e-05
>> 
>> -pc_type hypre -ksp_rtol 1.e-7 -ksp_monitor_true_residual
>> 
>> 0 KSP preconditioned resid norm 1.984853668903e-02 true resid norm 2.979865703850e-03 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 1.924446712660e-04 true resid norm 8.461145171168e+03 ||r(i)||/||b|| 2.839438421750e+06
>>   2 KSP preconditioned resid norm 5.161509100761e-06 true resid norm 4.501007519328e+02 ||r(i)||/||b|| 1.510473278548e+05
>>   3 KSP preconditioned resid norm 9.297326931235e-08 true resid norm 1.474595580807e+01 ||r(i)||/||b|| 4.948530327732e+03
>>   4 KSP preconditioned resid norm 1.910271882618e-09 true resid norm 3.603243780988e-01 ||r(i)||/||b|| 1.209196701829e+02
>>   0 KSP preconditioned resid norm 2.157687745804e+04 true resid norm 6.623626291881e+05 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 1.949268476385e+02 true resid norm 8.974916757495e+09 ||r(i)||/||b|| 1.354985375382e+04
>>   2 KSP preconditioned resid norm 5.078054475786e+00 true resid norm 4.502684440161e+08 ||r(i)||/||b|| 6.797914377626e+02
>>   3 KSP preconditioned resid norm 8.663802743525e-02 true resid norm 1.432117031381e+07 ||r(i)||/||b|| 2.162134408362e+01
>>   4 KSP preconditioned resid norm 1.795605563041e-03 true resid norm 3.389868548833e+05 ||r(i)||/||b|| 5.117843911255e-01
>> 
>>   0 KSP preconditioned resid norm 6.728304961395e+02 true resid norm 1.879478105170e+02 ||r(i)||/||b|| 1.000000000000e+00
>>   1 KSP preconditioned resid norm 2.190497539532e+01 true resid norm 4.630095820203e+02 ||r(i)||/||b|| 2.463500802413e+00
>>   2 KSP preconditioned resid norm 8.425561564252e-01 true resid norm 7.012565302251e+01 ||r(i)||/||b|| 3.731123700223e-01
>>   3 KSP preconditioned resid norm 3.029848345705e-02 true resid norm 4.379018464663e+00 ||r(i)||/||b|| 2.329911932795e-02
>>   4 KSP preconditioned resid norm 7.374025528575e-04 true resid norm 1.337183702137e-01 ||r(i)||/||b|| 7.114654320570e-04
>>   5 KSP preconditioned resid norm 3.009400175162e-05 true resid norm 7.731135032616e-03 ||r(i)||/||b|| 4.113447776459e-05
>> 
>> Thanks
>> 
>> Pierpaolo
>> 
>>>> 
>>>> Thanks
>>>> 
>>>> Pierpaolo
>>>> 
>>>>> Il giorno 23 lug 2018, alle ore 15:43, Mark Adams <mfadams at lbl.gov <mailto:mfadams at lbl.gov>> ha scritto:
>>>>> 
>>>>> Note, as Barry said, GAMG works with native complex numbers. You can start with your original complex build and use '-pc_type gamg'.
>>>>> Mark
>>>>> 
>>>>> On Mon, Jul 23, 2018 at 6:52 AM Pierpaolo Minelli <pierpaolo.minelli at cnr.it <mailto:pierpaolo.minelli at cnr.it>> wrote:
>>>>> 
>>>>> 
>>>>>> Il giorno 20 lug 2018, alle ore 19:58, Smith, Barry F. <bsmith at mcs.anl.gov <mailto:bsmith at mcs.anl.gov>> ha scritto:
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>>> On Jul 20, 2018, at 7:01 AM, Pierpaolo Minelli <pierpaolo.minelli at cnr.it <mailto:pierpaolo.minelli at cnr.it>> wrote:
>>>>>>> 
>>>>>>> Hi,
>>>>>>> 
>>>>>>> in my code I have to solve both a system in the field of real numbers and in the field of complex numbers.
>>>>>>> My approach has been as follows.
>>>>>>> First I configured PETSc with the --with-scalar-type=complex option.
>>>>>>> Using this option I have unfortunately lost the possibility to use the two preconditioners ML and Hypre.
>>>>>> 
>>>>>>   You should still be able to use the PETSc PCGAMG algebraic multigrid solver. Have you tried that? If there are issues let us know because we would like to continue to improve the performance of PCGAMG to get it to be closer to as good as ML and hypre.
>>>>>> 
>>>>>>  Barry
>>>>>> 
>>>>> 
>>>>> I will try to convert, as suggested by Matthew, my complex system in a system twice as large in real numbers. When i finish, i will try to use ML, Hypre and GAMG and i let you know if there are any performance differences.
>>>>> 
>>>>> Thanks
>>>>> 
>>>>> Pierpaolo
>>>>> 
>>>>> 
>>>>>>> I later created two subspaces of Krylov and tried to solve the two systems as I used to when solving the only equation in the real numbers field.
>>>>>>> In order to correctly solve the system in the field of real numbers I had to transform the coefficients from real to complex with an imaginary part equal to zero.
>>>>>>> 
>>>>>>> Is there a possibility to use a different and better approach to solve my problem?
>>>>>>> 
>>>>>>> Perhaps an approach where you can continue to use ML and Hypre for system solving in the real numbers field or where you don't need to use complex numbers when real numbers would actually suffice?
>>>>>>> 
>>>>>>> Thanks in advance
>>>>>>> 
>>>>>>> Pierpaolo
>>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
>> 
>> 
>> -- 
>> 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
>> 
>> https://www.cse.buffalo.edu/~knepley/ <http://www.caam.rice.edu/~mk51/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180803/c420096b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clip_image002.png
Type: image/png
Size: 2782 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180803/c420096b/attachment-0001.png>


More information about the petsc-users mailing list