Chocolate Bar! luqili. Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques.

Slides:



Advertisements
Similar presentations
Dr. Ken Hoganson, © August 2014 Programming in R COURSE NOTES 2 Hoganson Language Translation.
Advertisements

Debugging What can debuggers do? Run programs Make the program stops on specified places or on specified conditions Give information about current variables’
Programming Types of Testing.
Hit or Miss ? !!!.  Cache RAM is high-speed memory (usually SRAM).  The Cache stores frequently requested data.  If the CPU needs data, it will check.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
1 Lecture 6 Performance Measurement and Improvement.
E.1 Eclipse. e.2 Installing Eclipse Download the eclipse.installation.exe from the course web site to your computer and execute it. Keep the destination.
Previous finals up on the web page use them as practice problems look at them early.
Chapter 7 Interupts DMA Channels Context Switching.
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
CS-3013 & CS-502, Summer 2006 Memory Management1 CS-3013 & CS-502 Summer 2006.
Chapter 1 and 2 Computer System and Operating System Overview
Performance Improvement
Introduction to a Programming Environment
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Spring 2014 SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to Embedded Systems Dr. Jerry Shiao, Silicon Valley University.
Debugging techniques in Linux Debugging Techniques in Linux Chetan Kumar S Wipro Technologies.
Operating Systems What do you have left on your computer after you strip away all of the games and application programs you bought and installed? Name.
CCS APPS CODE COVERAGE. CCS APPS Code Coverage Definition: –The amount of code within a program that is exercised Uses: –Important for discovering code.
Levels of Architecture & Language CHAPTER 1 © copyright Bobby Hoggard / material may not be redistributed without permission.
Functions Part I (Syntax). What is a function? A function is a set of statements which is split off into a separate entity that can be used like a “new.
JIT in webkit. What’s JIT See time_compilation for more info. time_compilation.
Lecture 8. Profiling - for Performance Analysis - Prof. Taeweon Suh Computer Science Education Korea University COM503 Parallel Computer Architecture &
Software Development Software Testing. Testing Definitions There are many tests going under various names. The following is a general list to get a feel.
Compiling & Debugging Quick tutorial. What is gcc? Gcc is the GNU Project C compiler A command-line program Gcc takes C source files as input Outputs.
CS533 Concepts of Operating Systems Jonathan Walpole.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Application Profiling Using gprof. What is profiling? Allows you to learn:  where your program is spending its time  what functions called what other.
CSE 303 Concepts and Tools for Software Development Richard C. Davis UW CSE – 12/6/2006 Lecture 24 – Profilers.
CSE 232: C++ Programming in Visual Studio Graphical Development Environments for C++ Eclipse –Widely available open-source debugging environment Available.
1 MONGODB: CH ADMIN CSSE 533 Week 4, Spring, 2015.
Debugging and Profiling With some help from Software Carpentry resources.
Moving Arrays -- 1 Completion of ideas needed for a general and complete program Final concepts needed for Final Review for Final – Loop efficiency.
Administration CI meetings resume next week, as usual Some TAs in labs, plus Dr. Betz –Go to your lab as usual –If your TA is not there, ask for help from.
SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr Jonas M. Larsen Memory debugging Recipe profiling.
Renesas Technology America Inc. 1 M16C Seminars Lab 3 Creating Projects Using HEW4 14 March 2005 M16C Seminars Lab 3 Creating Projects Using HEW4 Last.
C++ crash course Class 9 flight times program, using gdb.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 11 – gdb and Debugging.
Low-Level Virtual Machine support for Eclipse C/C++ Development Tooling Petri Tuononen - 17/5/2011.
HOW A COMPUTER PROCESSES DATA. What is hardware? Hardware is the electric, electronic and mechanical equipment that makes up a computer What is software?
Version Control and SVN ECE 297. Why Do We Need Version Control?
Administration: Upcoming Due Dates Milestone 1: due Monday, Feb. 1 at 5 pm Code Review on milestone 1: –Coming soon; due Monday, Feb. 8 WD1: graphics proposal.
Source Level Debugging of Parallel Programs Roland Wismüller LRR-TUM, TU München Germany.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Copyright 2014 – Noah Mendelsohn Performance Analysis Tools Noah Mendelsohn Tufts University Web:
1 G4UIRoot Isidro González ALICE ROOT /10/2002.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Debugging using By: Samuel Ashby. What is debugging?  A bug is an error in either a program or the hardware itself.  Debugging is first locating and.
Introduction To Software Development Environment.
July 10, 2016ISA's, Compilers, and Assembly1 CS232 roadmap In the first 3 quarters of the class, we have covered 1.Understanding the relationship between.
Smalltalk Implementation Harry Porter, October 2009 Smalltalk Implementation: Optimization Techniques Prof. Harry Porter Portland State University 1.
Measuring Where CPU Time Goes
Profiling for Performance in C++
COMP 2710 Software Construction Introduction to GDB
Computer Architecture “Bomb Lab Hints”
An Introduction to VEX IQ Programming with Modkit
Using a Debugger 1-Jan-19.
GNU DEBUGGER TOOL. What is the GDB ? GNU Debugger It Works for several languages – including C/C++ [Assembly, Fortran,Go,Objective-C,Pascal]
Getting serious about “going fast” on the TigerSHARC
Milestone 3: Finding Routes
Tonga Institute of Higher Education IT 141: Information Systems
Min Heap Update E.g. remove smallest item 1. Pop off top (smallest) 3
Tonga Institute of Higher Education IT 141: Information Systems
Module 3 Configuring a Router.
Debugging.
Presentation transcript:

Chocolate Bar! luqili

Milestone 3 Speed 11% of final mark 7%: path quality and speed –Some cleverness required for full marks –Implement some A* techniques to pass hardest speed tests –Read up online Milestone 4 (another 11% of mark) –Find a good path to connect M intersections Courier company –Will have a CPU time limit –Will benefit from fast path-finding algorithms A good milestone 3 implementation will help you!

Milestone 3 Quality & speed: 7% –Need some A* for full speed marks –But not all portions best solved with A* Think about when to use what algorithm And how to extend what you saw in class User Interface: 4% –Make it usable –What would you want in directions? –How would you want to type commands / locations? –Try it on a friend or family member! –Lots of ideas in m3 handout Don’t need to implement them all

Suggestion: Type commands in console Print directions to console And draw path in graphics Hit “Proceed” to return control to console –Can enter next command

Milestone 3 User Interface Sounds a bit clunky! –Yes, but easier –Late in course: will learn multi-threading Lets a program do 2 things at once E.g. read commands and re-draw Bonus only!

Profiling Code Measuring Where CPU Time Goes

My Code Is Too Slow – Why? Look at code  what O() is it? –Loading: O(N) usually unavoidable and OK O(N 2 )  not good if N can get big –Look-ups If you’ll do something N times, try to keep it O(1) or O(log N)

My Code is Complex! Can’t figure out O() Or O() looks OK, but still not fast enough Profile! –Measure where the time goes

1. Overall Time Measurement Use the linux time command Type time, then regular program and arguments > time mapper /cad2/ece297s/public/maps/toronto.bin > 17.4u 0.0s 0: u  user time  time CPU was busy on your code s  system time  operating system time due to your program last number  wall clock time  how long you waited Can rigorously measure the CPU impact of changes

2. Simple Profiling: Manual Random Sampling 1.Run the debugger 2.Stop it with Debug  Pause 3.Look at the subroutine and line where you paused 4.Examine the call stack to see how you got there 5.Continue execution with Debug  Continue More CPU time in a routine  higher probability of stopping there Repeat several times and find you’re in the same routine  you’ve found the problem

3. Detailed Profiling: gprof Tool gprof tool –Randomly samples the function your program is in ~ every 10 ms –Also records how it got there (call stack / call graph) –Then summarizes the output for you How is this random sampling done? –Program asks to be interrupted ~100x / second by operating system –Each time it is interrupted, it records function it is in

gprof Tool: How to Use 1.Compile your program with the right options –Add –pg option to compiler  instruments exe –Specify –g option  need symbol table to know which function is at what memory address –Optimization? –Yes: want to speed up release build: -O2 g++ -pg –g –O2 … -o myProg.exe NetBeans: can make a Profile Configuration by copying Release Config and adding –g –pg Sometimes turn off function inlining to make profiling output easier to understand

gprof Tool: How to Use 2.Run program normally –myProg.exe arg1 … –Collects statistics, stores in gmon.out –Program runs only a little slower (~30%) 3.Run gprof to summarize / interpret output –gprof myProg.exe > outfile.txt –Reads gmon.out, generates readable outfile.txt