Download Sun Studio 12 Update 1 Performance Analyzer
Transcript
Annotated Source Code Note – The compiler commentary does not wrap onto two lines in the Source tab of the Analyzer. Parallelization If your code contains Sun, Cray, or OpenMP parallelization directives, it can be compiled for parallel execution on multiple processors. The compiler commentary indicates where parallelization has and has not been performed, and why. The following shows an example of parallelization computer commentary. 0. 6.324 0.010 0.010 9. c$omp parallel do shared(a,b,c,n) private(i,j,k) Loop below parallelized by explicit user directive Loop below interchanged with loop on line 12 [10] do i = 2, n-1 0.170 Loop below not parallelized because it was nested in a parallel loop Loop below interchanged with loop on line 12 11. do j = 2, i 0.170 For more details about parallel execution and compiler-generated body functions, refer to “Overview of OpenMP Software Execution” on page 160. Special Lines in the Annotated Source Several other annotations for special cases can be shown under the Source tab, either in the form of compiler commentary, or as special lines displayed in the same color as index lines. For details, refer to “Special Lines in the Source, Disassembly and PCs Tabs” on page 190. Source Line Metrics Source code metrics are displayed, for each line of executable code, in fixed-width columns. The metrics are the same as in the function list. You can change the defaults for an experiment using a .er.rc file; for details, see “Commands That Set Defaults” on page 136. You can also change the metrics displayed and highlighting thresholds in the Analyzer using the Set Data Presentation dialog box; for details, see “Setting Data Presentation Options” on page 96. Annotated source code shows the metrics of an application at the source-line level. It is produced by taking the PCs (program counts) that are recorded in the application’s call stack, and mapping each PC to a source line. To produce an annotated source file, the Analyzer first determines all of the functions that are generated in a particular object module (.o file) or load object, then scans the data for all PCs from each function. In order to produce annotated source, the Analyzer must be able to find and read the object module or load object to determine the mapping from PCs to source lines, and it must be able to read the source file to produce an annotated copy, which is displayed. The Analyzer searches for the source file, object file, and executable files in the following default locations in turn, and stops when it finds a file of the correct basename: 184 Sun Studio 12 Update 1: Performance Analyzer • October, 2009