Debugging and profiling: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
No edit summary
No edit summary
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<languages />
<translate>
<!--T:1-->
An important step in the software development process, particularly for compiled languages like Fortran and C/C++, concerns the use of a program called a debugger to detect and identify the origin of runtime errors (e.g. memory leaks, floating point exceptions and so forth) so that they can be eliminated. Once the program's correctness is assured, a further step is profiling the software. This involves the use of another software tool, a profiler, determine what percentage of the total execution time each section of the source code is responsible for when run with a representative test case. A profiler can give information like how many times a particular function is called, which other functions are calling it and how many milli-seconds of time each invocation of this function costs on average. 


= Debugging and profiling tools= <!--T:2-->


An important step in the software development process, particularly for compiled languages like Fortran and C/C++, concerns the use of a program called a debugger to detect and identify the origin of runtime errors (e.g. memory leaks, floating point exceptions and so forth) so that they can be eliminated. Once the program's correctness is assured, a further step is profiling the software. This involves the use of another software tool, a profiler, determine what percentage of the total execution time each section of the source code is responsible for when run with a representative test case. A profiler can give information like how many times a particular function is called, which other functions are calling it and how many milli-seconds of time each invocation of this function costs on average.  
<!--T:3-->
Our national clusters offer a variety of debugging and profiling tools, both command line and those with a graphical user interface, whose use requires an X11 connection. Note that debugging sessions should be conducted using an [[Running_jobs#Interactive_jobs | interactive job]] and not run on a login node.  


= Debugging and profiling tools=
== GNU debugger (gdb) == <!--T:4-->


The Compute Canada national clusters offer a variety of debugging and profiling tools, both command line and those with a graphical user interface, whose use requires an X11 connection. Note that debugging sessions should be conducted using an [[Running_jobs#Interactive_jobs | interactive job]] and not run on the login node.  
<!--T:5-->
Please see the [[GDB | GDB page]].


== GNU Debugger (gdb) ==
== PGI debugger (pgdb) == <!--T:6-->
Please see the [https://docs.alliancecan.ca/wiki/Pgdbg Pgdbg page].


Please see [[GDB | GDB page]]
== ARM debugger (ddt) == <!--T:7-->


== PGI Debugger (pgdb) ==
<!--T:8-->
See [[Pgdbg]]
Please see the [[ARM software | ARM software page]].


== ARM Debugger (ddt) ==
==GNU profiler (gprof) == <!--T:9-->


Please see the [[ARM software | ARM software page]].
<!--T:10-->
Please see the [[Gprof | Gprof  page]].
 
== Scalasca profiler (scalasca, scorep, cube) == <!--T:11-->


==GNU Profiler (gprof) ==
<!--T:19-->
Scalasca is an open source, GUI-driven parallel profiling tool set. It is currently available for <b>gcc 9.3.0</b> and <b>OpenMPI 4.0.3</b>, with AVX2 or AVX512 architecture. Its environment can be loaded with:


Please see [[Gprof | Gprof page]]
<!--T:20-->
<code>module load StdEnv/2020 gcc/9.3.0 openmpi/4.0.3 scalasca</code>


== PGI Profiler (pgprof) ==
<!--T:21-->
Please see [[PGPROF | Pgprof page]]
The current version is <b>2.5</b>. More information can be found in the 2.x user guide, which contains workflow examples [https://apps.fz-juelich.de/scalasca/releases/scalasca/2.5/docs/manual/ here].


== Nvidia command-line profiler (nvprof) ==
== PGI profiler (pgprof) == <!--T:12-->
Please see [[Nvprof | nvprof page]]
Please see the [[PGPROF | Pgprof page]].


== Nvidia Visual Profiler (nvvp) ==
== Nvidia command-line profiler (nvprof) == <!--T:13-->
Please see the [[Nvprof | nvprof page]].


==Valgrind==
==Valgrind== <!--T:15-->


Please see [[Valgrind | Valgrind page]]
<!--T:22-->
Please see the [[Valgrind | Valgrind page]].


= External references =
= External references = <!--T:16-->


<!--T:17-->
* [https://docs.scinet.utoronto.ca/index.php/Introduction_To_Performance Introduction to (Parallel) Performance] from SciNet
* [https://docs.scinet.utoronto.ca/index.php/Introduction_To_Performance Introduction to (Parallel) Performance] from SciNet
* [https://www.sharcnet.ca/help/index.php/Measuring_Parallel_Scaling_Performance Measuring Parallel Scaling Performance] from SHARCNET
* [https://www.youtube.com/watch?v=YsF5KMr9uEQ Code profiling on Graham], video, 54 minutes.
* [https://www.youtube.com/watch?v=YsF5KMr9uEQ "Code profiling on Graham"], video, 54 minutes.


<!--T:18-->
[[Category:Pages with video links]]
[[Category:Pages with video links]]
</translate>

Latest revision as of 17:40, 5 June 2023

Other languages:

An important step in the software development process, particularly for compiled languages like Fortran and C/C++, concerns the use of a program called a debugger to detect and identify the origin of runtime errors (e.g. memory leaks, floating point exceptions and so forth) so that they can be eliminated. Once the program's correctness is assured, a further step is profiling the software. This involves the use of another software tool, a profiler, determine what percentage of the total execution time each section of the source code is responsible for when run with a representative test case. A profiler can give information like how many times a particular function is called, which other functions are calling it and how many milli-seconds of time each invocation of this function costs on average.

Debugging and profiling tools

Our national clusters offer a variety of debugging and profiling tools, both command line and those with a graphical user interface, whose use requires an X11 connection. Note that debugging sessions should be conducted using an interactive job and not run on a login node.

GNU debugger (gdb)

Please see the GDB page.

PGI debugger (pgdb)

Please see the Pgdbg page.

ARM debugger (ddt)

Please see the ARM software page.

GNU profiler (gprof)

Please see the Gprof page.

Scalasca profiler (scalasca, scorep, cube)

Scalasca is an open source, GUI-driven parallel profiling tool set. It is currently available for gcc 9.3.0 and OpenMPI 4.0.3, with AVX2 or AVX512 architecture. Its environment can be loaded with:

module load StdEnv/2020 gcc/9.3.0 openmpi/4.0.3 scalasca

The current version is 2.5. More information can be found in the 2.x user guide, which contains workflow examples here.

PGI profiler (pgprof)

Please see the Pgprof page.

Nvidia command-line profiler (nvprof)

Please see the nvprof page.

Valgrind

Please see the Valgrind page.

External references