Introduction to debugging. Martin Čuma Center for High Performance Computing University of Utah

Similar documents
Debugging, benchmarking, tuning i.e. software development tools. Martin Čuma Center for High Performance Computing University of Utah

Debugging with Totalview. Martin Čuma Center for High Performance Computing University of Utah

Welcome. HRSK Practical on Debugging, Zellescher Weg 12 Willers-Bau A106 Tel

TotalView. Debugging Tool Presentation. Josip Jakić

Debugging with GDB and DDT

Debugging with GDB and DDT

GPU Debugging Made Easy. David Lecomber CTO, Allinea Software

Debugging with TotalView

SGI Altix Getting Correct Code Reiner Vogelsang SGI GmbH

Parallel Debugging with TotalView BSC-CNS

Eliminate Threading Errors to Improve Program Stability

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

GPU Technology Conference Three Ways to Debug Parallel CUDA Applications: Interactive, Batch, and Corefile

Eliminate Memory Errors to Improve Program Stability

Eliminate Threading Errors to Improve Program Stability

Debugging HPC Applications. David Lecomber CTO, Allinea Software

Jackson Marusarz Software Technical Consulting Engineer

Guillimin HPC Users Meeting July 14, 2016

Addressing the Increasing Challenges of Debugging on Accelerated HPC Systems. Ed Hinkel Senior Sales Engineer

Eliminate Memory Errors to Improve Program Stability

Memory & Thread Debugger

This guide will show you how to use Intel Inspector XE to identify and fix resource leak errors in your programs before they start causing problems.

Hands-on Workshop on How To Debug Codes at the Institute

Le Yan Louisiana Optical Network Initiative. 8/3/2009 Scaling to Petascale Virtual Summer School

Improving the Productivity of Scalable Application Development with TotalView May 18th, 2010

Debugging for the hybrid-multicore age (A HPC Perspective) David Lecomber CTO, Allinea Software

Using Intel VTune Amplifier XE for High Performance Computing

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

Developing, Debugging, and Optimizing GPU Codes for High Performance Computing with Allinea Forge

Debugging at Scale Lindon Locks

Intro to Segmentation Fault Handling in Linux. By Khanh Ngo-Duy

Debugging Your CUDA Applications With CUDA-GDB

DDT: A visual, parallel debugger on Ra

Debugging. John Lockman Texas Advanced Computing Center

ECMWF Workshop on High Performance Computing in Meteorology. 3 rd November Dean Stewart

Programming LRZ. Dr. Volker Weinberg, RRZE, 2018

Coding Tools. (Lectures on High-performance Computing for Economists VI) Jesús Fernández-Villaverde 1 and Pablo Guerrón 2 March 25, 2018

Debugging. Marcelo Ponce SciNet HPC Consortium University of Toronto. July 15, /41 Ontario HPC Summerschool 2016 Central Edition: Toronto

The Eclipse Parallel Tools Platform

HPCC - Hrothgar. Getting Started User Guide TotalView. High Performance Computing Center Texas Tech University

Intel Parallel Studio XE 2015

DDT Debugging Techniques

CS354 gdb Tutorial Written by Chris Feilbach

Tools and Methodology for Ensuring HPC Programs Correctness and Performance. Beau Paisley

TotalView Release Notes

Intro to MS Visual C++ Debugging

ECE/ME/EMA/CS 759 High Performance Computing for Engineering Applications

Welcomes PRACE/LinkSCEEM 2011 Winter School Jacques Philouze Vice President Sales & Marketing

Intel Parallel Studio XE 2017 Composer Edition BETA C++ - Debug Solutions Release Notes

TotalView Training. Developing parallel, data-intensive applications is hard. We make it easier. Copyright 2012 Rogue Wave Software, Inc.

ECE QNX Real-time Lab

Debugging. P.Dagna, M.Cremonesi. May 2015

Allinea Unified Environment

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

Getting Started Tutorial: Analyzing Threading Errors

IBM PSSC Montpellier Customer Center. Content

Getting Started Tutorial: Analyzing Memory Errors

Integrated Software Environment. Part 2

Debugging process. The debugging process can be divided into four main steps: 1. Start your program, specifying anything that might affect its

Debugging CUDA Applications with Allinea DDT. Ian Lumb Sr. Systems Engineer, Allinea Software Inc.

GDB Tutorial. A Walkthrough with Examples. CMSC Spring Last modified March 22, GDB Tutorial

Debugging with TotalView

Facing the challenges of. New Approaches To Debugging Complex Codes! Ed Hinkel, Sales Engineer Rogue Wave Software

For Distributed Performance

DEBUGGING ON FERMI PREPARING A DEBUGGABLE APPLICATION GDB. GDB on front-end nodes

STARTING THE DDT DEBUGGER ON MIO, AUN, & MC2. (Mouse over to the left to see thumbnails of all of the slides)

Understanding Dynamic Parallelism

Intel Parallel Inspector 2011 Getting Started Tutorials

Parallel Debugging. ª Objective. ª Contents. ª Learn the basics of debugging parallel programs

18-600: Recitation #3

ELP. Effektive Laufzeitunterstützung für zukünftige Programmierstandards. Speaker: Tim Cramer, RWTH Aachen University

CSE 374 Programming Concepts & Tools. Brandon Myers Winter 2015 Lecture 11 gdb and Debugging (Thanks to Hal Perkins)

Development tools to enable Multicore

Blue Gene/Q User Workshop. Debugging

Short Introduction to Debugging Tools on the Cray XC40

Debugging and Optimizing Programs Accelerated with Intel Xeon Phi Coprocessors

TotalView. Users Guide. August 2001 Version 5.0

Programming for the Intel Many Integrated Core Architecture By James Reinders. The Architecture for Discovery. PowerPoint Title

Intel MPI Cluster Edition on Graham A First Look! Doug Roberts

Debugging with gdb and valgrind

Introduction to Parallel Programming. Martin Čuma Center for High Performance Computing University of Utah

Eliminate Memory Errors and Improve Program Stability

What's New in CDT 7.0? dominique dot toupin at ericsson dot com

Debugging Programs Accelerated with Intel Xeon Phi Coprocessors

NightStar. NightView Source Level Debugger. Real-Time Linux Debugging and Analysis Tools BROCHURE

Debugging and Profiling

The Cray Programming Environment. An Introduction

Allinea DDT Debugger. Dan Mazur, McGill HPC March 5,

CS2141 Software Development using C/C++ Debugging

12. Debugging. Overview. COMP1917: Computing 1. Developing Programs. The Programming Cycle. Programming cycle. Do-it-yourself debugging

TotalView Release Notes

Debugging on Intel Platforms

Data and File Structures Laboratory

Parallel Programming and Debugging with CUDA C. Geoff Gerfin Sr. System Software Engineer

Exercise Session 6 Computer Architecture and Systems Programming

Getting Started Tutorial: Analyzing Threading Errors

Introduction to IntelliJ

Princeton University COS 217: Introduction to Programming Systems GDB Tutorial and Reference

Productive Performance on the Cray XK System Using OpenACC Compilers and Tools

Typical Bugs in parallel Programs

Transcription:

Introduction to debugging Martin Čuma Center for High Performance Computing University of Utah m.cuma@utah.edu

Overview Program errors Simple debugging Graphical debugging DDT and Totalview Intel tools Please fill survey https://www.surveymonkey.com/r/7b5fjrm 11/8/2018 http://www.chpc.utah.edu Slide 2

Program errors crashes segmentation faults (bad memory access) often writes core file snapshot of memory at the time of the crash wrong I/O (missing files) hardware failures incorrect results reasonable but incorrect results NaNs not a numbers division by 0, 11/8/2018 http://www.chpc.utah.edu Slide 3

write/printf write variables of interest into the stdout or file simplest but cumbersome need to recompile and rerun need to browse through potentially large output 11/8/2018 http://www.chpc.utah.edu Slide 4

Terminal debuggers text only, e.g. gdb, idb need to remember commands or their abbreviations need to know lines in the code (or have it opened in other window) useful for quick code checking on compute nodes and core dump analysis 11/8/2018 http://www.chpc.utah.edu Slide 5

GUI debuggers have graphical user interface freeware or commercial Eclipse CDT - free PGI s pdbg part of PGI compiler suite Intel development tools Rogue Wave Totalview - commercial Allinea DDT - commercial 11/8/2018 http://www.chpc.utah.edu Slide 6

Totalview and DDT The only real alternative for parallel or accelerator debugging Cost a lot of money (thousands of $), but, worth it We had Totalview license (for historical reasons), 32 tokens enough for our needs (renewal ~$1500/yr) In 2017 we switched to DDT which gave us competitive upgrade XSEDE systems have DDT 11/8/2018 http://www.chpc.utah.edu Slide 7

How to use Totalview/DDT 1. Compile binary with debugging information flag, -g gcc g test.f o test 2. Load module and run Totalview or DDT module load totalview ; module load ddt TV/DDT + executable totalview executable ; ddt executable TV/DDT + core file totalview executable core_file ; ddt executable corefile Run TV/DDT and choose what to debug in a startup dialog totalview ; ddt 11/8/2018 Slide 8 http://www.chpc.utah.edu

Totalview windows 11/8/2018 Slide 9 http://www.chpc.utah.edu

DDT screenshot 11/8/2018 Slide 10 http://www.chpc.utah.edu

Debugger basic operations Data examination view data in the variable windows change the values of variables modify display of the variables visualize data Action points breakpoints and barriers (static or conditional) watchpoints evaluation of expressions 11/8/2018 http://www.chpc.utah.edu Slide 11

Multiprocess debugging Automatic attachment to MPI tasks and threads Create process and thread groups Share breakpoints among processes/threads Process/thread barrier breakpoints Process/thread group single-stepping View variables across procs/threads Display MPI message queue state CUDA/OpenACC support 11/8/2018 http://www.chpc.utah.edu Slide 12

How to use DDT 1. Compile binary with debugging information flag -g gcc g test.f o test 2. Load module and run DDT module load ddt DDT + executable ddt./executable DDT + core file ddt executable core_file 11/8/2018 http://www.chpc.utah.edu Slide 13

How to use DDT run DDT and attach the executable - start DDT - fill in information in the Run dialog - click Run button to start the program run DDT and attach running program - start DDT - click Attach to an already running program - choose process and click Attach to button 3. DDT operation left mouse button - select right mouse button context sensitive menu 11/8/2018 http://www.chpc.utah.edu Slide 14

DDT windows Array viewer window Main window Cross-process comparison window Process window 11/8/2018 http://www.chpc.utah.edu Slide 15

DDT basic operations Data examination view data in the variable windows change the values of variables modify display of the variables visualize data Action points breakpoints and barriers (static or conditional) watchpoints and tracepoints evaluation of expressions 11/8/2018 http://www.chpc.utah.edu Slide 16

Multiprocess debugging Automatic attachment of child processes Create process groups Share breakpoints among processes Process barrier breakpoints Process group single-stepping View variables across procs/threads Display MPI message queue state 11/8/2018 http://www.chpc.utah.edu Slide 17

Basic operation example Load up an existing program DDT windows step through the code place breakpoints examine variables Load a core file examine the crash point 11/8/2018 http://www.chpc.utah.edu Slide 18

Process view window Stack trace procedure hierarchy - left Stack frame variables display - right Source code code + process navigation - center Threads list in case of multithreaded application - top Action points list of breakpoints, barriers, - bottom 11/8/2018 http://www.chpc.utah.edu Slide 19

Action points Breakpoints and barriers toggle location with left mouse (shift for barrier) right-click Properties for options option conditional breakpoints Watchpoints watch for change in a memory location Tracepoints write screen output whenever line is executed 11/8/2018 http://www.chpc.utah.edu Slide 20

Data examination Scalars in variable view on the right of the main window Arrays in Array viewer right click on a variable, choose Array viewer adjust array dimensions, hit evaluate filter array values, e.g. $value > 0 variable visualization, statistics, 11/8/2018 http://www.chpc.utah.edu Slide 21

Parallel debugging Process/thread groups Cross-process/thread data comparison Message queue state graph and display 11/8/2018 http://www.chpc.utah.edu Slide 22

Memory debugging Enable in the initial Run dialog Memory usage Memory leak detection Exceeding array bounds Dangling pointers 11/8/2018 http://www.chpc.utah.edu Slide 23

Accelerator debugging We license the GPU add-on to DDT Works well with CUDA With OpenACC, the debugger sees what the compiler generates so stepping through code may not correspond to actual source lines Use breakpoints and examine data at the breakpoints 11/8/2018 http://www.chpc.utah.edu Slide 24

DDT webpage Some useful resources https://www.allinea.com/products/ddt Setting up DDT Clusters: module load ddt Some group desktops: inquire at CHPC Documentation https://www.allinea.com/user-guide/forge/userguide.html https://www.allinea.com/debugger-videos 11/8/2018 http://www.chpc.utah.edu Slide 25

Code checkers compilers check for syntax errors some compiler flags help too (-C) memory checking tools - many errors are due to bad memory management valgrind easy to use purify harder to use 11/8/2018 http://www.chpc.utah.edu Slide 26

Intel software development products We have a 2 concurrent user license Tools for all stages of development Compilers and libraries Verification tools Profilers More info https://software.intel.com/en-us/intel-parallel-studioxe 11/8/2018 http://www.chpc.utah.edu Slide 27

Intel Inspector Thread checking Data races and deadlocks Memory checker Like leaks or corruption Good alternative to Totalview MemoryScape or DDT Standalone or GUI integration More info http://software.intel.com/en-us/intel-inspector-xe/ 11/8/2018 http://www.chpc.utah.edu Slide 28

Intel Inspector Source the environment module load inspectorxe Compile with tcheck -g ifort -openmp -tcheck -g trap.f Run tcheck inspxe-gui graphical user interface inspxe-cl command line Tutorial https://software.intel.com/en-us/articles/inspectorxetutorials 11/8/2018 http://www.chpc.utah.edu Slide 29

Intel Trace Analyzer and Collector MPI profiler and correctness checker Detects violations of MPI standard and errors in execution environment To use correctness checker module load intel impi itac setenv VT_CHECK_TRACING 0 mpirun check-mpi n 4./myApp ITAC documentation https://software.intel.com/en-us/intel-trace-analyzersupport/documentation 11/8/2018 http://www.chpc.utah.edu Slide 30

Interpreted languages debugging Matlab Debugger built in the editor Python R gdb like debugging built in (pdb module) Many different third party IDEs PyCharm is nice but beware of larger memory/cpu use if debugging big data gdb like debugging built in (traceback(), browse(), debug()) Rstudio allows debugging 11/8/2018 http://www.chpc.utah.edu Slide 31

Conclusions Terminal debuggers Compiler vendor debuggers Totalview for graphical debugging Code checkers and memory checkers InspectorXE for thread and memory debugging ITAC MPI checker Interpreted languages debugging Please fill survey: https://www.surveymonkey.com/r/7b5fjrm http://www.chpc.utah.edu Slide 32