Debugging Serial and Parallel Codes
Faculty and Staff
No matter how experienced you may be at debugging code, it can be a frustrating task especially if all you have at your disposal is the ability to insert print statements at strategic locations with the hope of finding where the problem lies. This tutorial introduces you to a better method for debugging your code -- using debugger software. We start by giving an overview of debugger software capabilities and then describe several different types of errors that can be made and how to debug them. The lessons are divided into debugging serial and parallel codes since the methods for debugging them are slightly different, as are the types of bugs you encounter. To help you understand each lesson's concepts, a sample program is given that has a particular bug, and the process for debugging it is described. To further your understanding, exercises are provided so that you can debug a program on your own.
This course's unique feature is the explanation of why a certain debugger command is used during a debugging session. There are many step-by-step manuals for debuggers that list what-to-type-when. However, these manuals do not explain why you should type it. In each debugging session shown in this course, we explain how the debugger is being used and emphasize the overall debugging strategy.
Prerequisites: General programming knowledge. Course examples use Fortran and C/C++.
Note: This course was previously offered on CI-Tutor.
There is no cost associated with this resource.