23.10.2014 Views

PGPROF User's Guide - The Portland Group

PGPROF User's Guide - The Portland Group

PGPROF User's Guide - The Portland Group

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Getting Started<br />

‣ It supports multi-threaded programs.<br />

‣ It supports shared objects, DLLs, and dynamic libraries.<br />

To profile your application named myprog, you execute the following commands:<br />

$ pgcollect myprog<br />

$ pgprof -exe myprog<br />

<strong>The</strong> information available to you when you analyze your application's performance can be<br />

significantly enhanced if you compile and link your program using the –Minfo=ccff option.<br />

This option saves information about the compilation of your program, compiler feedback, for use<br />

by <strong>PGPROF</strong>. For more information on compiler feedback, refer to<br />

For a more complete analysis, our command execution might look similar to this:<br />

$ pgfortran -fast -Minfo=ccff -o myprog myprog.90<br />

$ pgcollect myprog<br />

$ pgprof -exe myprog<br />

1.2. Methods of Collecting Performance Data<br />

PGI provides a number of methods for collecting performance data in addition to the basic<br />

pgcollect method described in the previous section. Some of these have advantages or<br />

capabilities not found in the basic pgcollect method. We divide these methods into two<br />

categories: instrumentation-based profiling and sample-based profiling.<br />

1.2.1. Instrumentation-based Profiling<br />

Instrumentation-based profiling is one way to measure time spent executing the functions or<br />

source lines of your program. <strong>The</strong> compiler inserts timer calls at key points in your program and<br />

does the bookkeeping necessary to track the execution time and execution counts for routines and<br />

source lines. This method is available on all platforms on which PGI compilers are supported.<br />

Instrumentation-based profiling:<br />

‣ Provides exact call counts.<br />

‣ Provides exact line/block execution counts.<br />

‣ Reports time attributable to only the code in a routine.<br />

‣ Reports time attributable to the code in a routine and all the routines it called.<br />

This method requires that you recompile and relink your program using one of these compiler<br />

options:<br />

‣ Use -Mprof=func for routine-level profiling.<br />

Routine-level profiling can be useful in identifying which portions of code to analyze with<br />

line-level profiling.<br />

‣ Use -Mprof=lines for source line-level profiling.<br />

<strong>The</strong> overhead of using line-level profiling can be high, so it is more suited for fine-grained<br />

analysis of small pieces of code, rather than for analysis of large, long-running applications.<br />

PGI Profiler User <strong>Guide</strong> 2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!