Debugging VisIt

Debugging VisIt can be a complex task, depending on the type of bug that you are trying to fix. This page lists some general tips for debugging VisIt as well as how to use various tools.

Tips for debugging VisIt

Be aware that information on many command-line options for starting VisIt with various debugging features turned on can be obtained by specifying the '-fullhelp' command-line option (e.g. 'visit -fullhelp'). This will print out a wealth of information on various debugging options only a few of which are described in detail below.

Tools

Tools are recommended for debugging VisIt since they make the detection of errors easier.

Debuggers

Debuggers allow you to step through the code as it executes so you can probe variable values and trace program execution. If you are not already familiar with a debugger, you'll need to get acquainted with one - and quickly!

VisIt can also be run in conjunction with other debuggers similarly to how gdb is used such as lldb and ddt. In addition, it is relatively straightforward to enhance VisIt's python launcher code to add new debuggers. For example, see how gdb debugger is implemented here. If you run the command...

visit -fullhelp

it will show a list of options with some explanations.

Call trace tools

Call trace tools sample the program periodically to build up a picture of the program's behavior. These tools can be useful when the code is hung due to MPI issues.

VisIt can also be run in conjunction with other tracking tools similarly to how STAT is used such as vtune, instruments, strace, apitrace, callgrind. In addition, it is relatively straightforward to enhance VisIt's python launcher code to add new tracing tools. For example, see how strace is implemented here. If you run the command...

visit -fullhelp

it will show a list of options with some explanations.

Memory tools

Memory tools allow you to detect memory errors such as buffer overruns, use of uninitialized variables, or memory leaks as your program runs. Elimination of memory errors is critical to becoming a good VisIt developer.

VisIt can also be run in conjunction with other memory tools similarly to how valgrind is used such as debug-malloc and cuda-memcheck. In addition, it is relatively straightforward to enhance VisIt's python launcher code to add new memory tools. For example, see how valgrind is implemented here. If you run the command...

visit -fullhelp

it will show a list of options with some explanations.