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

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

TotalView. Debugging Tool Presentation. Josip Jakić

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

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

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

Debugging with TotalView

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

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

Debugging with TotalView

TotalView. Users Guide. August 2001 Version 5.0

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

Parallel Debugging with TotalView BSC-CNS

Debugging with GDB and DDT

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

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

SGI Altix Getting Correct Code Reiner Vogelsang SGI GmbH

Compiling applications for the Cray XC

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

Debugging Intel Xeon Phi KNC Tutorial

TotalView. User Guide. June 2004 Version 6.5

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

Debugging OpenMP Programs

Implementation of Parallelization

Introduction to OpenMP. Lecture 2: OpenMP fundamentals

Amdahl s Law. AMath 483/583 Lecture 13 April 25, Amdahl s Law. Amdahl s Law. Today: Amdahl s law Speed up, strong and weak scaling OpenMP

EE/CSCI 451 Introduction to Parallel and Distributed Computation. Discussion #4 2/3/2017 University of Southern California

Introduction to OpenMP

Hybrid MPI/OpenMP parallelization. Recall: MPI uses processes for parallelism. Each process has its own, separate address space.

DDT: A visual, parallel debugger on Ra

Debugging with GDB and DDT

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

High Performance Beowulf Cluster Environment User Manual

TotalView. User Guide. September 2003 Version 6.3

Introduction to GALILEO

Guillimin HPC Users Meeting July 14, 2016

PROGRAMMING MODEL EXAMPLES

Cray RS Programming Environment

Parallel Processing Top manufacturer of multiprocessing video & imaging solutions.

HPC on Windows. Visual Studio 2010 and ISV Software

Parallel Computing: Overview

TotalView Users Guide. version 8.8

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

TotalView. Graphic User Interface Commands Guide. version 8.0

Eliminate Threading Errors to Improve Program Stability

Why Combine OpenMP and MPI

Module 4: Working with MPI

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

Introduction to PICO Parallel & Production Enviroment

PRACE Autumn School Basic Programming Models

Debugging. John Lockman Texas Advanced Computing Center

Orna Agmon Ben-Yehuda. OpenMP Usage. March 15, 2009 OpenMP Usage Slide 1

OpenMP Programming. Prof. Thomas Sterling. High Performance Computing: Concepts, Methods & Means

The Distributed Debugging Tool

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

Shared memory programming model OpenMP TMA4280 Introduction to Supercomputing

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

Introduction to GALILEO

Combining OpenMP and MPI

Lecture 4: OpenMP Open Multi-Processing

Introduction to Parallel Programming

OpenMP - Introduction

Table of Contents. Table of Contents Job Manager for remote execution of QuantumATK scripts. A single remote machine

Multithreading in C with OpenMP

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

Getting Started with TotalView on Beacon

Effective Use of CCV Resources

Scientific Computing

Tech Computer Center Documentation

Introduction to OpenMP

Eliminate Memory Errors to Improve Program Stability

Data and File Structures Laboratory

Shared Memory Programming Model

Debugging Programs Accelerated with Intel Xeon Phi Coprocessors

Eliminate Threading Errors to Improve Program Stability

Introduction to HPC Numerical libraries on FERMI and PLX

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

Parallelising Scientific Codes Using OpenMP. Wadud Miah Research Computing Group

Introduction to OpenMP. OpenMP basics OpenMP directives, clauses, and library routines

GPU Debugging Made Easy. David Lecomber CTO, Allinea Software

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

Parallel Debugging. Matthias Müller, Pavel Neytchev, Rainer Keller, Bettina Krammer

TotalView Release Notes

Introduction to CINECA HPC Environment

CMSC 714 Lecture 4 OpenMP and UPC. Chau-Wen Tseng (from A. Sussman)

CS 261 Fall Mike Lam, Professor. Threads

Concurrency, Thread. Dongkun Shin, SKKU

Combining OpenMP and MPI. Timothy H. Kaiser,Ph.D..

Programming Environment 4/11/2015

COMP4510 Introduction to Parallel Computation. Shared Memory and OpenMP. Outline (cont d) Shared Memory and OpenMP

Chapter 4: Threads. Operating System Concepts 9 th Edit9on

Our new HPC-Cluster An overview

Practical Introduction to

GDB-UPC for GCC-UPC SMP runtime. GDB-UPC features. GDB features. Multiprocessing support in GDB. GDB UPC for SMP runtime Intrepid Technology, Inc.

Introductory OpenMP June 2008

The Eclipse Parallel Tools Platform

!OMP #pragma opm _OPENMP

DDT Debugging Techniques

OpenMP Introduction. CS 590: High Performance Computing. OpenMP. A standard for shared-memory parallel programming. MP = multiprocessing

Debugging and Optimizing Programs Accelerated with Intel Xeon Phi Coprocessors

Shared Memory programming paradigm: openmp

Transcription:

Debugging with Totalview Martin Čuma Center for High Performance Computing University of Utah mcuma@chpc.utah.edu

Overview Totalview introduction. Basic operation. Serial debugging. Parallel debugging. OpenMP MPI Memory debugging. Some other useful information 3/13/2009 http://www.chpc.utah.edu Slide 2

Totalview in a nutshell source and machine level debugger command line and graphic interface serial and parallel debugging support supports remote debugging runs on variety of platforms 3/13/2009 http://www.chpc.utah.edu Slide 3

Totalview windows 3/13/2009 http://www.chpc.utah.edu Slide 4

Totalview 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 3/13/2009 http://www.chpc.utah.edu Slide 5

Multiprocess debugging Automatic attachment of child processes Create process groups Share breakpoints among processes Process barrier breakpoints Process group single-stepping Laminate variables Display MPI message queue state 3/13/2009 http://www.chpc.utah.edu Slide 6

How to use Totalview 1. Compile binary with debugging information flag -g g77 g test.f o test if use fork() or execve(), link g77 g L/ /totalview/linux-x86-64/lib ldbfork test.f o test 2. Run Totalview TV + executable totalview executable TV + core file totalview executable core_file 3/13/2009 http://www.chpc.utah.edu Slide 7

How to use Totalview run TV and attach the executable -start TV - menu New Program Window - fill in executable file name run TV and attach running program -start TV - menu New Program Window - pullout Attach to an Existing Process - choose process ID and fill in executable file name 3. Totalview operation left mouse button - select right mouse button - menu left mouse button double click - dive 3/13/2009 http://www.chpc.utah.edu Slide 8

Example 1 Serial code CUSP DFT plane wave atomic simulation atomic nuclei interact classically electrons described by wavefunctions - plane waves interaction between w.f.'s and nuclei define the system potential and kinetic energy iterate electronic and nuclear energy to self consistency to achieve ground state Implementation 10+ Fortran source code files simple Makefile w/ flags -g -byteswapio 3/13/2009 http://www.chpc.utah.edu Slide 9

Process view window Stack trace procedure hierarchy Stack frame variables display Source code code + process navigation Threads list in case of multithreaded application Action points list of breakpoints, barriers, 3/13/2009 http://www.chpc.utah.edu Slide 10

Running the debugger Menu Go/Halt/Next/Step/Hold or shortcuts Possible actions (thread,process/group): go (g/g) halt (h/h) step (source line) (s/s) step (instruction) (i/i) next (source line) (n/n) next (instruction) (x/x) run (to selection) (r/r) return (out of function) (o/o) 3/13/2009 http://www.chpc.utah.edu Slide 11

Action points Breakpoints and barriers toggle location with left mouse (shift for barrier) right-click Properties for options Evaluation points set conditional breakpoints conditionally patch out code Watchpoints watch for change in a memory location 3/13/2009 http://www.chpc.utah.edu Slide 12

Data examination Variable view dive (right mouse) on any variable change data type select an array slice, e.g. (3:3,:) filter array values, e.g..ne. 0 Variable visualization menu Visualize only up to 2D arrays 3/13/2009 http://www.chpc.utah.edu Slide 13

Example 2 OpenMP code Compilation Arches: pathf90 openmp test.f -g o test.exe pgf90 mp test.f -g o test.exe ifort openmp test.f -g o test.exe gcc4 fopenmp test.c -g o test.exe Running set OMP_NUM_THREADS Example saxpy routine simple vector-scalar product 3/13/2009 http://www.chpc.utah.edu Slide 14

OpenMP specific debugging TV automatically attaches all threads put breakpoint to OpenMP parallel section to debug threads variable lamination - show values from all threads in one window does not always work barrier points shift-left click ambiguous action points select all 3/13/2009 http://www.chpc.utah.edu Slide 15

Job submitter code Example 3 MPI/OpenMP code one MPI process master distributes work other MPI processes slaves do the work Implementation master reads job database and sends work information to slaves master runs two threads via OpenMP, one distributes the work, the other runs the work slave processes the information and runs the work (serially via fork() and execve() functions) 3/13/2009 http://www.chpc.utah.edu Slide 16

Example 3 scheme Proces 0 - worker Proces 1 - master Thread 0 - master Thread 1 - worker Ask for work Do work via fork()/execv() Distribute work Ask for work Do work via fork()/execv() Master reads database with available jobs, and sends work requests to available workers 3/13/2009 http://www.chpc.utah.edu Slide 17

MPICH2 on interactive nodes good enough for most parallel problems source /uufs/arches/sys/pkg/mpich2/std_pgi/etc/mpich2.csh mpicc submit.o g -o submit Running Start MPD daemon on the interactive node mpdboot n 1 if have problems, create ~/.mpd.conf file Run: open Totalview (totalview), then in New Program Window enter: program name MPICH2 for parallel sysem number of processors Example 3 MPI code Arches 3/13/2009 http://www.chpc.utah.edu Slide 18

Example 3 MPI code Arches Running on compute nodes use larger number of processors or other MPI than MPICH2 is needed pgcc -g -mp -I/uufs/arches/sys/pkg/mpich/std/include submit.c pgcc submit.o -L/uufs/arches/sys/pkg/mpich/std/lib lmpich -o submit Running on compute nodes (large # of processors) contact CHPC to get ssh access to the nodes interactive PBS: qsub -I l nodes=2,walltime=2:00:00 hostname -i ssh to node name obtained above 3/13/2009 http://www.chpc.utah.edu Slide 19

Example 3 MPI code Arches Running on interactive nodes run: /uufs/arches/sys/pkg/mpich/std/bin/mpirun tv np 2 machinefile $PBS_NODEFILE./submit modify path for the tdsvr Totalview server: Menu File Properties Launch strings /uufs/arches/sys/pkg/totalview/std/bin/tdvsvr Set a breakpoint after MPI_Init and select Go Select No or Yes at the next dialog, does not matter since we already have a breakpoint set Debug and enjoy 3/13/2009 http://www.chpc.utah.edu Slide 20

MPI specific debugging Process synchronization program groups Barrier points Message queue state graph and display 3/13/2009 http://www.chpc.utah.edu Slide 21

Memory debugging display memory status paint allocated and deallocated blocks find memory leaks identify dangling pointers enable with Tools > Memory Debugger > Enable memory debugging checkbox 3/13/2009 http://www.chpc.utah.edu Slide 22

Some useful resources TotalviewTech webpage http://www.totalviewtech.com Location of Totalview Arches:/uufs/arches/sys/pkg/totalview/std Some group desktops: inquire at CHPC Documentation http://www.totalviewtech.com/support/docs/index.html http://www.chpc.utah.edu/software/docs/par_devel.html http://www.chpc.utah.edu/software/docs/totalview.html http://www.chpc.utah.edu/short_courses/totalview 3/13/2009 http://www.chpc.utah.edu Slide 23

Totalview Student Edition Free for students Limited to one computer, 4 processes To sign up, e-mail mcuma@chpc.utah.edu: name e-mail university ID anticipated year of graduation More details http://www.totalviewtech.com/academia/totalview_express.html 3/13/2009 http://www.chpc.utah.edu Slide 24

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 3/13/2009 http://www.chpc.utah.edu Slide 25

Thread checking Good for finding OpenMP errors race conditions privatization Intel thread checker (ITC) OpenMP pthreads 3/13/2009 http://www.chpc.utah.edu Slide 26

Using ITC Source ITC environment source /uufs/arches/sys/pkg/itc/std/tcheck/bin/32e/tcheckvars.csh Compile with tcheck -g ifort -openmp -tcheck -g trap.f Run tcheck tcheck_cl./a.out More info http://www.intel.com/support/performancetools /threadchecker/linux/ 3/13/2009 http://www.chpc.utah.edu Slide 27

Future Presentations Mathematical libraries at the CHPC Chemistry packages (Anita Orendt) Using Gaussian (Anita Orendt) Performance analysis with TAU/Vampir Introduction to OpenMP MPI-IO Mixed MPI/OpenMP programming Intermediate MPI??? 3/13/2009 http://www.chpc.utah.edu Slide 28