Presentation is loading. Please wait.

Presentation is loading. Please wait.

SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Jonas M. Larsen Memory debugging Recipe profiling.

Similar presentations


Presentation on theme: "SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Jonas M. Larsen Memory debugging Recipe profiling."— Presentation transcript:

1 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Jonas M. Larsen Memory debugging Recipe profiling

2 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 2 Memory debugging valgrind > valgrind a.out

3 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 3 Memory debugging valgrind Memory errors sometimes make programs crash. Other times they don't! Use a memory debugger regularly (valgrind, gdb,...)

4 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 4 Profiling Reasons to optimize The pipeline must process at about the same speed as observations are performed Trade-off: Science quality vs. execution speed Reasons not to optimize “slow” can be “fast enough” Trade-off: CPU cycles vs. human brain cycles Trade-off: Design vs. speed Measure before you optimize!

5 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 5 Profiling profile_build > profile_build -qfitssrc=~/qfits-6.2.0 -cplsrc=~/cpl-3.1.0 - esorexsrc=~/esorex-3.6.1 -iiinstrumentsrc=~/xshp -builddir=~/BUILD - iiinstrumentlib=xsh xsh_mbias > ~/BUILD/bin/esorex xsh_mbias xsh_mbias.sof > gprof ~/BUILD/bin/esorex > gcov my_source_file.c

6 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 6 Profiling GCC gprof GCC gprof

7 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 7 Profiling GCC gcov Use profiling tools (gprof, gcov, Shark,...) GCC gcov

8 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 8 Profiling Asymptotic time complexity Example: Looping through a FITS header O(n^3) O(n^2) O(n)

9 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 9 Profiling Constant factor optimization Measure before you optimize!

10 SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 10 Profiling If n is large, be careful about... Reference: http://www.eso.org/~jmlarsen/pipeline


Download ppt "SDD/DFS Jonas M. Larsen VLT 2 nd Generation Instrumentation Pipelines, 19 Apr 2007 - 1 Jonas M. Larsen Memory debugging Recipe profiling."

Similar presentations


Ads by Google