Here you can find some simple hints on debugging errors in Nbody6++.

1) Try different compiler, e.g. ifort. Is the error still there?

2) Use ddd (Graphical Debugger Frontend) on single-processor machine to find routine where the code hangs. For this you have to compile the code with the flag -g (which creates debugging information). Start the code with

ddd ./nbody6

The Debugger opens. In the bottom window type

(gdb) run < in1000.comment

This starts the debugger. You can try yourself to interrupt, continue, step through the execution and so on. Very useful is the command Status->Backtrace which shows you from the stop on the hierarchy of called routines.

3) Turn on all run-time / compile-time error checking you can: Array bounds checking (pgf: -C, ifort: -CB), Argument mismatch checking (pgf: -Mchkfpstk -Mchkstk), Checking for undefined variables? (pgf: -Mdclchk does not help unfortunately since most variables are implicitely defined!)

If you use ifort, use -check all which enables all check options. Use man ifort to see the other
-check options.

Note: Do not forget to remove the debugging compiler flags since they slow down the code considerably.

To be continued...


Page Information

  • 1 year ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts