[petsc-users] help needed for -snes_mf_operator

Barry Smith bsmith at mcs.anl.gov
Thu Apr 26 15:05:35 CDT 2012


On Apr 26, 2012, at 12:14 PM, Dominik Szczerba wrote:

> > Thanks for a useful hint. The smallest problem I was able to generate
> > has around 1000 unknowns

(1) 

> but it finally outputs something. I got some
> > matrix, with the biggest absolute entry order 0.1 the smallest
> > absolute entry order 1e-14, average values seem to be order 1e-8 or
> > so. End line of the output says: Norm of matrix ratio 0.579314
> > difference 10.9951 (constant state 1.0)
> >
> > Dominik
> 
> So do you think this is reasonable or you still think I evaluate the Jacobian incorrectly? Is there still something I can do to find out where the problem is? Unfortunately, there is no easy way I can run the code serially.

(2)
> 
> Dominik

  You set yourself up for a very painful life. It is simply insane to have a code that cannot run with tiny problems for debugging and understanding and similarly run sequentially. Parallel computing with MPI is HARD and the only way to make it at all manageable is to organize the code so that it is easy to debug and understand.  You may think it is silly to waste time making the code run on small problems sequentially since you want to run big problems but it is not silly, it is crucial. You would already have debugged and fixed this problem if you could run the code sequentially on tiny problems. The extra time in making the code debuggable is much much less than the extra time wasted futzing around trying to find a bug with no tools to debug.

    The -snes_type test option has another option -snes_test_display which will display the two Jacobians and the difference between them allowing one to see which entries in the Jacobian (if not all of them) are wrong.  If you could run on a small problem sequentially you would run with these options, see what Jacobian entries are wrong and look back at the code that generates those entries and likely see the bug.

   Barry



More information about the petsc-users mailing list