Dr. Fabrizio Gala Dipartimento di Scienze di Base e Applicate Per l’Ingegneria – Sezione di Fisica Via Scarpa 14-16 00141 Rome, Italy 1.

Slides:



Advertisements
Similar presentations
Part IV: Memory Management
Advertisements

R4 Dynamically loading processes. Overview R4 is closely related to R3, much of what you have written for R3 applies to R4 In R3, we executed procedures.
Professional Toolkit V2.0 C:\Presentations - SmartCafe_Prof_V2.0 - bsc page 1 Professional Toolkit 2.0.
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Prof. Necula CS 164 Lecture 141 Run-time Environments Lecture 8.
Matt Wolfe LC Development Environment Group Lawrence Livermore National Laboratory Lawrence Livermore National Laboratory, P. O. Box 808, Livermore, CA.
Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
Lecture Roger Sutton CO331 Visual programming 15: Debugging 1.
Memory Allocation. Three kinds of memory Fixed memory Stack memory Heap memory.
CS 536 Spring Run-time organization Lecture 19.
The IDE (Integrated Development Environment) provides a DEBUGGER for locating and correcting errors in program logic (logic errors not syntax errors) The.
Run-Time Storage Organization
V0.01 © 2009 Research In Motion Limited Introduction to Java Application Development for the BlackBerry Smartphone Trainer name Date.
Chapter 11 Operating Systems
©Brooks/Cole, 2003 Chapter 7 Operating Systems Dr. Barnawi.
Chapter 4 H1 Assembly Language: Part 2. Direct instruction Contains the absolute address of the memory location it accesses. ld instruction:
Run-time Environment and Program Organization
Debugging Logic Errors CPS120 Introduction to Computer Science Lecture 6.
Gdb is the GNU debugger on our CS machines. gdb is most effective when it is debugging a program that has debugging symbols linked in to it. With gcc and.
Computer Programming and Basic Software Engineering 4. Basic Software Engineering 1 Writing a Good Program 4. Basic Software Engineering.
Debugging Cluster Programs using symbolic debuggers.
DEBUGGING CHAPTER Topics  Getting Started with Debugging  Types of Bugs –Compile-Time Bugs –Bugs Attaching Scripts –Runtime Errors  Stepping.
Debugging Projects Using C++.NET Click with the mouse button to control the flow of the presentation.
Variables and Objects, pointers and addresses: Chapter 3, Slide 1 variables and data objects are data containers with names the value of the variable is.
TotalView Debugging Tool Presentation Josip Jakić
DDT Debugging Techniques Carlos Rosales Scaling to Petascale 2010 July 7, 2010.
Playing Back Scripts In HP LoadRunner >>>>>>>>>>>>>>>>>>>>>>
Debugging. 2 © 2003, Espirity Inc. Module Road Map 1.Eclipse Debugging  Debug Perspective  Debug Session  Breakpoint  Debug Views  Breakpoint Types.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Debugging in Java. Common Bugs Compilation or syntactical errors are the first that you will encounter and the easiest to debug They are usually the result.
Process by Dr. Amin Danial Asham. References Operating System Concepts ABRAHAM SILBERSCHATZ, PETER BAER GALVIN, and GREG GAGNE.
Profiling, Tracing, Debugging and Monitoring Frameworks Sathish Vadhiyar Courtesy: Dr. Shirley Moore (University of Tennessee)
SPL – Practical Session 2 Topics: – C++ Memory Management – Pointers.
® IBM Software Group © 2006 IBM Corporation PurifyPlus on Linux / Unix Vinay Kumar H S.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Debugging parallel programs. Breakpoint debugging Probably the most widely familiar method of debugging programs is breakpoint debugging. In this method,
Blackfin Array Handling Part 1 Making an array of Zeros void MakeZeroASM(int foo[ ], int N);
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
CSCI Rational Purify 1 Rational Purify Overview Michel Izygon - Jim Helm.
1 Program Planning and Design Important stages before actual program is written.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
Pointers in C Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Memory and Addresses Memory is just a sequence of byte-sized.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Process-Concept.
HPCC Mid-Morning Break Dirk Colbry, Ph.D. Research Specialist Institute for Cyber Enabled Discovery TotalView Parallel Debugger.
Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science The University of Arizona, Tucson
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
15 Copyright © 2004, Oracle. All rights reserved. Debugging Triggers.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Debugging Lab Antonio Gómez-Iglesias Texas Advanced Computing Center.
HP-SEE TotalView Debugger Josip Jakić Scientific Computing Laboratory Institute of Physics Belgrade The HP-SEE initiative.
Multiprogramming. Readings r Chapter 2.1 of the textbook.
Process Management Process Concept Why only the global variables?
Operating Systems (CS 340 D)
Chapter 2: System Structures
Computer Programming I
Checking Memory Management
gdb gdb is the GNU debugger on our CS machines.
Operating Systems (CS 340 D)
Tonga Institute of Higher Education
CSc 352 Debugging Tools Saumya Debray Dept. of Computer Science
Debugging Taken from notes by Dr. Neil Moore
Debugging Taken from notes by Dr. Neil Moore
ICT Gaming Lesson 2.
CS703 - Advanced Operating Systems
Chapter 15 Debugging.
Chapter 8 & 9 Main Memory and Virtual Memory
Presentation transcript:

Dr. Fabrizio Gala Dipartimento di Scienze di Base e Applicate Per l’Ingegneria – Sezione di Fisica Via Scarpa Rome, Italy 1

2

1) 1)mpicc –g –O0 –o myprogram.x myprogram.c 1)~/> module load totalview 1)bsub –n # procs -I –a tv –q # queue totalview # exe 3 1)Open a terminal through FARO 1)Compile the code to debug 1)Load the TotalView module 1)Submit the job MPI TASK NUMBER PARALLEL ENVIRONMENT

4 The Root Window contains a list of all the processes and threads you are currently debugging.  T = sTopped  B = Breakpoint  E = Error  W = Watchpoint  R = Running  M = Mixed STATUS INFO : ROOT WINDOW ACTION POINT ID NUMBER

5  Go : run the program  Halt : pause the execution  Kill : ends the process  Restart : equal to Kill plus Go  Next : executes all code on a line (i.e. a subroutine call)  Step : executes the line  Out : run up to return of a subroutine  Run to : runs to a selected line

66 To set an action point, click on the line number in the source panel and then choose what kind of action you need. The basic action points are:  Breakpoint : stops execution of the processes of threads that reach it,  Evaluation point : executes a code fragment when it is reached,  Process Barrier Point : hold each process when it reaches the barrier point until all process in the group have reached the barrir point SOURCE PANEL

77 After having set a breakpoint, it is possible to have a look inside a variable, by simply selecting the variable in the Stack Frame Panel and then diving by a double-click. This can be useful if one wants to explore a variable among different threads. STACK FRAME PANEL THREAD INDEX

88 To calculate the size of any object type, the compiler must take into account any address alignment that may be need to meet efficiency or achitectural constraints. The compiler accomplishes this task by inserting unused padding bytes between members as needed to satisfy the alignment requirements. There may also be padding at the end of a structure to ensure proper alignment in case the structure is ever used as an element of an array. Selecting View > Padding gives: CODE

99 Tools > Message Queue Graph displays a window that shows a graphic representation of the state of message queue information. This graph shows you the state of your program at a particular instant.  GREEN Pending Sends  BLUE Pending Receives  RED Unespected Msgs STATUS INFO : MPI MESSAGE TAG PROC ID PSEUDO CODE

10  Pending messages often indicate that a process can't keep up with the amount of work it is expected to perform.These messages indicate places where you may be able to improve your program's efficiency.  Unexpected messages can indicate that something is wrong with your program because the receiving process doesn't know how to process the message.  Loops in the graph may indicate deadlocks.( Cycles can be highlited by Options > Cycle Detection ) DEADLOCK EXAMPLE PSEUDO CODE

11 MemoryScape stops the program execution when one of the following events occurs:  Freeing memory that is already freed,  Freeing the wrong address  Freeeing an interior pointer,  Misaligning blocks Select the Debug > Enable Memory Debugging command before starting the program. When the program makes a memory request, MemoryScape records the stack frames that existed when the action occurred.

12 TEXT: The amount of memory used for storing the program's machine code instructions. DATA: The amount of memory used for storing uninitialized and initialized data. HEAP : The amount of memory currently being used for data created at runtime (i.e. allocated pointers). STACK : The amount of memory used by the currently executing routine and all the routines in its backtrace. Memory Usage Chart Report displays the memory occupied by each process:

13 Looking at how the program is using memory may help in understanding where parallelization can be improved. UNBALANCED MEMORY OCCUPANCY AMONG PROCESSES

14 When a Segmentation Fault occurs, MemoryScape keeps track of the event, you can have a look at it in Debug > Memory Event Details ) CODE

15 A memory leak occurs when the program incorrectly menages memory allocations. As a consequence, a memory leak can diminish the performance by reducing the amount of available memory. Eventually, in the worst case, too much of the available memory may become allocated and all or part of the system e stops working correctly, the application fails, or the system slows down unacceptably. PSEUDO CODE In Leak Detection Reports > Source Report MEMORYPOINTERS ALLOCATION The instruction here frees only A, not tmp MEMORY LEAK

16 In Leak Detection Reports > Source Report in fact tells us : sizeof (double)

17 TotalView documentation can be found here: