[petsc-users] MSVC debug runs in a different branch.

Matthew Knepley knepley at gmail.com
Mon Jun 20 17:40:37 CDT 2011


On Mon, Jun 20, 2011 at 10:19 PM, Tian(ICT) <rongtian at ncic.ac.cn> wrote:

> **
> Thanks for quick answering.
> I looked into SNESSetFromOptions() in the debugger and MF was not chosen.
> Still the wired thing is the code never breaks at the point I set inside
> FormJacobian when running in the debug mode.
> I will leave this issue alone again and look at it later.
>
> Actually I am struggling with a SNES solve. The followings are some
> outputs.
> -snes_ratiomonitor shows that residual norm almost equals to one but the
> SNES converged,
> is this a good convergence?
>

No. Are you sure this system is consistent, meaning it has a solution? Have
you tried putting in an
exact solution for a simpler problem?

  Matt


>
> atol=1e-050, rtol=1e-008, stol=1e-008, maxit=50, maxf=10000
> function.................
> residual force.................
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 40000 <== initial value
> 0
> 0
> 40000
> 0
> 0
> 40000
> 0
> 0
> 40000
> 0
>   0 SNES Function norm 8.000000000000e+004
>   0 SNES Function norm 8.000000000000e+004
> ------------------->Jacobian
> function.................
> residual force.................
> -8.2245e+007
> -5.12049e+006
> 1.03104e+008
> 2.44985e+007
> -1.11118e+007
> -3.144e+007
> -2.37583e+007
> -535905
> 2.79206e+007
> 5.63514e+007
> -2.26332e+007
> -7.54711e+007
> -5.76723e+007
> 1.544e+007
> 7.56104e+007
> 2.34587e+007
> 9.57426e+006
> -2.56718e+007
> 2.7089e+007
> 3.32996e+007
> -3.09772e+007
> 3.2278e+007
> -1.87524e+007
> -4.30752e+007
> function.................
> residual force.................
> -8.2245e+007
> -5.12049e+006
> 1.03104e+008
> 2.44985e+007
> -1.11118e+007
> -3.144e+007
> -2.37583e+007
> -535905
> 2.79206e+007
> 5.63514e+007
> -2.26332e+007
> -7.54711e+007
> -5.76723e+007
> 1.544e+007
> 7.56104e+007
> 2.34587e+007
> 9.57426e+006
> -2.56718e+007
> 2.7089e+007
> 3.32996e+007
> -3.09772e+007
> 3.2278e+007
> -1.87524e+007
> -4.30752e+007
> function.................
> residual force.................
> -2.05272e+007
> 3.44926e+006
> 2.5202e+007
> -1.55108e+006
> -9.56839e+006
> 2.17527e+006
> 3.56516e+006
> 6.12324e+006
> -5.9437e+006
> 1.41997e+007
> -1.21796e+007
> -1.92224e+007
> -1.63165e+007
> 1.00523e+007
> 2.14974e+007
> -1.87655e+006
> -3.44175e+006
> 4.3047e+006
> 1.50918e+007
> 1.66532e+007
> -1.8379e+007
> 7.41472e+006
> -1.09283e+007
> -9.63423e+006
> function.................
> residual force.................
> -4.83477e+006
> 1.9056e+006
> 5.06631e+006
> -1.74833e+006
> -3.81725e+006
> 3.0505e+006
> 1.93196e+006
> 2.614e+006
> -3.9812e+006
> 3.71686e+006
> -4.00712e+006
> -4.46187e+006
> -4.24801e+006
> 3.70415e+006
> 5.07447e+006
> -1.59935e+006
> -2.18778e+006
> 3.63332e+006
> 3.74435e+006
> 5.0913e+006
> -5.46539e+006
> 3.03729e+006
> -3.14292e+006
> -2.91613e+006
> function.................
> residual force.................
> -1.62518e+006
> 635442
> 1.14687e+006
> -395026
> -1.35624e+006
> 1.30091e+006
> 258576
> 922003
> -1.54824e+006
> 1.34306e+006
> -1.18937e+006
> -1.19905e+006
> -1.44957e+006
> 1.18631e+006
> 1.32948e+006
> -233476
> -848651
> 1.52147e+006
> 630822
> 1.59179e+006
> -1.62993e+006
> 1.4708e+006
> -781281
> -921506
> function.................
> residual force.................
> -680584
> 150805
> 298173
> -4235.39
> -556100
> 495315
> -83367.9
> 401881
> -609708
> 583119
> -325632
> -382676
> -608984
> 356434
> 416726
> 79947.2
> -362413
> 611645
> 24823.1
> 640620
> -552863
> 689283
> -145594
> -276612
> function.................
> residual force.................
> -252778
> -43702.9
> 107996
> 39434.6
> -252471
> 108972
> -56021.1
> 202917
> -167131
> 237714
> -13235.2
> -160064
> -245478
> 46386.1
> 170214
> 53958.6
> -164661
> 167576
> -41053
> 309826
> -119435
> 264223
> 74941.4
> -108128
> function.................
> residual force.................
> -37722.5
> -30354.3
> 12055.9
> 19055.1
> -45688.3
> -1869.42
> -17961.6
> 41506
> -11175
> 39667.1
> 24371.9
> -24644.8
> -40629.2
> 12856
> 25503.9
> 17749.7
> -1976.73
> 10689.7
> -20792.3
> 89625.4
> 2237.53
> 40633.6
> 69659.9
> -12797.9
> function.................
> residual force.................
> -3191.46
> -3795.77
> 508.943
> 2612.15
> -4047.01
> -1039.77
> -2394.34
> 3957.38
> -341.114
> 3526.13
> 3531.34
> -1843.35
> -3574.59
> 36099.4
> 1775.2
> 2391.73
> 35967.4
> 179.561
> -2883.93
> 44445.2
> 1264.25
> 3514.31
> 43842.1
> -503.71
> function.................
> residual force.................
> -268.146
> -347.447
> 46.5142
> 257.768
> -335.67
> -97.6787
> -234.991
> 341.388
> -35.3256
> 299.924
> 338.987
> -161.929
> -306.308
> 39615
> 132.745
> 236.496
> 39642.5
> -7.34212
> -285.009
> 40378.6
> 141.125
> 300.268
> 40366.6
> -18.108
> function.................
> residual force.................
> -22.758
> -27.2585
> 11.605
> 23.791
> -26.2078
> -3.38911
> -21.3068
> 28.26
> -10.762
> 25.2783
> 28.3454
> -19.8467
> -27.0516
> 39963.9
> 11.1365
> 21.8233
> 39967.5
> -1.27698
> -26.2771
> 40032.7
> 13.3758
> 26.5009
> 40032.8
> -0.842484
>   1 SNES Function norm 7.999847670241e+004
>   1 SNES Function norm 7.999847670241e+004 0.999981
> ------------------->Jacobian
> function.................
> residual force.................
> -223.361
> -326.156
> 36.1377
> 229.267
> -321.922
> -82.1057
> -210.332
> 329.183
> -52.6793
> 249.815
> 322.469
> -153.907
> -255.672
> 39637.8
> 127.173
> 211.072
> 39655.1
> 12.6163
> -250.93
> 40359
> 119.951
> 250.141
> 40344.5
> -7.18602
> function.................
> residual force.................
> -69.9794
> -97.0147
> 18.7512
> 72.7704
> -94.1566
> -22.1285
> -66.1397
> 98.02
> -20.4693
> 78.3769
> 97.6066
> -52.1529
> -81.3498
> 39886.4
> 37.8587
> 66.7162
> 39894.4
> 0.222982
> -79.8688
> 40108.4
> 40.0624
> 79.4743
> 40106.3
> -2.14464
>   2 SNES Function norm 7.999823436070e+004
>   2 SNES Function norm 7.999823436070e+004 0.999997
> ------------------->Jacobian
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2 <== almost no change
> -1.91145
>   3 SNES Function norm 7.999822446658e+004
>   3 SNES Function norm 7.999822446658e+004 1
> ------------------->Jacobian
> function.................
> residual force.................
> -90.9631
> -130.918
> 20.7647
> 95.1669
> -128.284
> -30.1982
> -86.9654
> 132.973
> -26.9162
> 101.696
> 131.372
> -67.3645
> -105.178
> 39849.1
> 50.8645
> 87.519
> 39858
> 3.38427
> -104.154
> 40145.9
> 51.2208
> 102.878
> 40141.8
> -1.7555
> function.................
> residual force.................
> -87.4304
> -125.151
> 20.4826
> 91.387
> -122.451
> -28.8623
> -83.4344
> 127.006
> -25.7711
> 97.7856
> 125.63
> -64.8168
> -101.185
> 39855.4
> 48.6736
> 83.9928
> 39864.2
> 2.77216
> -100.06
> 40139.5
> 49.3875
> 98.944
> 40135.8
> -1.86551
> function.................
> residual force.................
> -86.3776
> -123.432
> 20.3972
> 90.2603
> -120.714
> -28.4634
> -82.3823
> 125.228
> -25.4307
> 96.6198
> 123.919
> -64.0564
> -99.9944
> 39857.3
> 48.0204
> 82.9421
> 39866.1
> 2.59144
> -98.8394
> 40137.6
> 48.8393
> 97.7713
> 40134
> -1.89774
> function.................
> residual force.................
> -86.0623
> -122.918
> 20.3714
> 89.923
> -120.194
> -28.3439
> -82.0673
> 124.696
> -25.3288
> 96.2708
> 123.407
> -63.8287
> -99.6379
> 39857.9
> 47.8248
> 82.6276
> 39866.6
> 2.53748
> -98.474
> 40137.1
> 48.675
> 97.4202
> 40133.5
> -1.90734
> function.................
> residual force.................
> -85.9678
> -122.764
> 20.3637
> 89.8218
> -120.038
> -28.3081
> -81.9729
> 124.536
> -25.2983
> 96.1661
> 123.253
> -63.7604
> -99.531
> 39858
> 47.7661
> 82.5333
> 39866.8
> 2.52132
> -98.3644
> 40136.9
> 48.6258
> 97.3149
> 40133.3
> -1.91022
> function.................
> residual force.................
> -85.9395
> -122.717
> 20.3614
> 89.7915
> -119.991
> -28.2973
> -81.9445
> 124.489
> -25.2891
> 96.1347
> 123.207
> -63.7399
> -99.4989
> 39858.1
> 47.7485
> 82.505
> 39866.9
> 2.51647
> -98.3316
> 40136.8
> 48.611
> 97.2833
> 40133.2
> -1.91108
> function.................
> residual force.................
> -85.931
> -122.704
> 20.3607
> 89.7824
> -119.977
> -28.2941
> -81.936
> 124.474
> -25.2863
> 96.1253
> 123.193
> -63.7337
> -99.4893
> 39858.1
> 47.7432
> 82.4965
> 39866.9
> 2.51502
> -98.3217
> 40136.8
> 48.6065
> 97.2738
> 40133.2
> -1.91134
> function.................
> residual force.................
> -85.9284
> -122.699
> 20.3605
> 89.7796
> -119.973
> -28.2931
> -81.9335
> 124.47
> -25.2855
> 96.1225
> 123.189
> -63.7319
> -99.4864
> 39858.1
> 47.7416
> 82.494
> 39866.9
> 2.51458
> -98.3187
> 40136.8
> 48.6052
> 97.271
> 40133.2
> -1.91142
> function.................
> residual force.................
> -85.9277
> -122.698
> 20.3604
> 89.7788
> -119.972
> -28.2928
> -81.9327
> 124.469
> -25.2853
> 96.1216
> 123.188
> -63.7313
> -99.4856
> 39858.1
> 47.7412
> 82.4932
> 39866.9
> 2.51445
> -98.3179
> 40136.8
> 48.6048
> 97.2702
> 40133.2
> -1.91144
> function.................
> residual force.................
> -85.9274
> -122.698
> 20.3604
> 89.7786
> -119.972
> -28.2927
> -81.9325
> 124.468
> -25.2852
> 96.1214
> 123.187
> -63.7312
> -99.4853
> 39858.1
> 47.741
> 82.493
> 39866.9
> 2.51441
> -98.3176
> 40136.8
> 48.6047
> 97.2699
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9274
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.5144
> -98.3175
> 40136.8
> 48.6047
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.5144
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.5144
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
> function.................
> residual force.................
> -85.9273
> -122.698
> 20.3604
> 89.7785
> -119.971
> -28.2927
> -81.9324
> 124.468
> -25.2852
> 96.1213
> 123.187
> -63.7311
> -99.4852
> 39858.1
> 47.741
> 82.4929
> 39866.9
> 2.51439
> -98.3175
> 40136.8
> 48.6046
> 97.2698
> 40133.2
> -1.91145
>   4 SNES Function norm 7.999822446658e+004
>   4 SNES Function norm 7.999822446658e+004 1
> SNES Object:
>   type: tr
>     mu=0.25, eta=0.75, sigma=0.0001
>     delta0=0.2, delta1=0.3, delta2=0.75, delta3=2
>   maximum iterations=50, maximum function evaluations=10000
>   tolerances: relative=1e-008, absolute=1e-050, solution=1e-008
>   total number of linear solver iterations=4
>   total number of function evaluations=36
>   KSP Object:
>     type: gmres
>       GMRES: restart=30, using Classical (unmodified) Gram-Schmidt
> Orthogonalization with no iterative refinement
>       GMRES: happy breakdown tolerance 1e-030
>     maximum iterations=10000, initial guess is zero
>     tolerances:  relative=1e-005, absolute=1e-050, divergence=10000
>     left preconditioning
>   PC Object:
>     type: ilu
>       ILU: 0 levels of fill
>       ILU: factor fill ratio allocated 1
>       ILU: tolerance for zero pivot 1e-012
>            out-of-place factorization
>            matrix ordering: natural
>       ILU: factor fill ratio needed 1
>            Factored matrix follows
>           Matrix Object:
>             type=seqaij, rows=24, cols=24
>             total: nonzeros=300, allocated nonzeros=840
>               using I-node routines: found 15 nodes, limit used is 5
>     linear system matrix = precond matrix:
>     Matrix Object:
>       type=seqaij, rows=24, cols=24
>       total: nonzeros=300, allocated nonzeros=1920
>         using I-node routines: found 15 nodes, limit used is 5
> Nonlinear solve converged due to CONVERGED_TR_DELTA
> STEP 0 (Newton iterations: 3)
>
> WARNING! There are options you set that were not used!
> WARNING! could be spelling mistake, etc!
> Option left: name:-options_dump no value
>
>
> ----- Original Message -----
> *From:* Matthew Knepley <knepley at gmail.com>
> *To:* PETSc users list <petsc-users at mcs.anl.gov>
> *Sent:* Tuesday, June 21, 2011 5:46 AM
> *Subject:* Re: [petsc-users] MSVC debug runs in a different branch.
>
> On Mon, Jun 20, 2011 at 9:40 PM, Tian(ICT) <rongtian at ncic.ac.cn> wrote:
>
>> Hi,
>> Good morning/evening!
>> I have this issue for quite a while. Using MSVC with Petsc, when debuging
>> the code, the FormJacobian was never called, instead calling
>> "MatMFFDComputeJacobian(SNES snes,Vec x,Mat *jac,Mat *B,MatStructure
>> *flag,void *dummy)", though I donot use matrix free option.
>>
>> However, when runing the same thing in command line (still a debug
>> compilation), I can see FormJacobian was called correctly.
>>
>> Any hint?
>>
>
> My guess is that you are getting the matrix-free option from somewhere
> (maybe a .petscrc file?). You can use -options_dump to see
> everything passed in. If not, look at SNESSetFromOptions() in the debugger,
> and see why it is choosing MF.
>
>    Matt
>
>
>> Rong
>>
>>
>
>
> --
> 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
>
>


-- 
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110620/a24e48e4/attachment-0001.htm>


More information about the petsc-users mailing list