Debugging and Profiling


What is debugging?

Debugging of a computer code or program is the methodical process of finding, fixing, reducing the number of bugs (errors) or discrepancies, thus making it behave as expected. To debug a program is to start with the problem, isolate the source of the problem, and then fix it. A user of a program that does not know how to fix it may learn how to avoid it until a more permanent solution is found. When someone says they have “debugged a program”, or “worked the bugs out” of a program, they imply that they fixed it so that the bugs no longer exist.

Debugging is a necessary process in almost all new software development process, whether it is a commercial product, or a large scientific modeling system, or a personal application program. For complex products, debugging is done as the result of the unit test for the smallest unit of a system, again at component test when parts are brought together, again at system test when the product is used with other existing products, and again during customer beta test, when users try the product out in a real world situation. Because most computer programs and many programmed hardware devices contain thousands of lines of code, almost any new product is likely to contain a few bugs. Invariably, the bugs in the functions that get most use are found and fixed first. An early version of a program that has lots of bugs is referred to as “buggy.”

A debugger or debugging tool is a computer program that is used to test and debug other programs (the “target” programs). Some programming language packages include a facility for checking the code for errors as it is being written, for example, checking syntax for a specific language and highlight the discrepancies.
Often the debugging program works with the target program being already compiled, and performing a controlled execution.Debuggers also offer more sophisticated functions such as running a program step by step (single-stepping or program animation), stopping (breaking) (pausing the program to examine the current state) at some event or specified instruction by means of a breakpoint, and tracking the values of variables. A number of debugging tools available in Pegasus environment.

Another way of debugging is to attempt to isolate the problem in the code before compiling it.


What is profiling?

Profiling of an applications or software is a form of dynamic program analysis that measures, for example, the space (memory) or time complexity of a program, the usage of particular instructions, or the frequency and duration of function calls. Most commonly, profiling information serves to aid program optimization.

Profiling is achieved by instrumenting either the program source code or its binary executable form using a tool called a profiler (or code profiler). Profilers may use a number of different techniques, such as event-based, statistical, instrumented, and simulation methods.




Follow the links below for directions on how to configure and use a particular debugging or profiling tool!

Debugging and Profiling with Allinea Tools

DDT – Distributed Debugging Tool

MAP – MPI Profiling

PerformanceReports – MPI profiling summary

DDT for a serial job (no MPI): configure and run

DDT for a multi-processor MPI application: configure and run

MAP: configure and run

User’s Guide  (DDT + MAP) AllineaTools Version.4.2.1-37994

User’s Guide (PerformanceReports) AllineaTools Version 4.2-PR

HPC Documentation

HPC Home