How to analyze a portion of your application

Sometimes, you only want to profile a portion of your application's run time.  For example, you may not want to profile the startup phase or the shutdown phase.  This article will describe how to use the Intel® Parallel Amplifer in such a situation.

As an example, we will demonstrate using the matrix example included with the Parallel Amplifier.  Let's assume we only want to profile algorithm_3() for Concurrency and not algorithm_1() or algorithm_2().  We know from the program's structure that these three routines are called sequentially, algorithm_1(), then algorithm_2(), then algorithm_3().  This is similar to an application where we don't care about the startup phase and only want to analyze the main purpose of the application, e.g., algorithm_3().

When the example was run on a dual core system, the following results were obtained:

matrix_timings.JPG

Based on the timing information, approximately 2 seconds is consumed by algorithm_1() and algorithm_2(), when added together (e.g., 0.58+1.55 seconds).

The Parallel Amplifier provides a configuration setting that allows you to delay data collection.  Access this setting in one of two ways:
  • From the Project menu, select Intel Parallel Amplifier Project properties (see Figure A), or
  • Right-click on the project in the Solution Explorer and select Intel Parallel Amplifier, and then Project Properties (see Figure B)
accessing_props_2.JPG

Then, under Collection, check the Start data collection paused and Resume collection after, sec., as below.

amplifier_settings-1.JPG

Now, if we run the Amplifer on our application, we see results similar to the following:

first_try-1.JPG

We still captured some time in algorithm_2() - almost a full second.  Obviously, the next step is to increase the resume time to 3 seconds and re-run the analysis.  The results follow:

second_try-1.JPG


Alternately, use the GUI to pause or resume data collection at any time after the application is launched.  You can control when data is collected using this method, at a coarse granularity.

Either check or uncheck the Start data collection paused option, depending on if you want to collect data at the start of your application or not.  Then, during execution of the application, press the Continue button to resume data collection...

tb_resume.JPG

And the Pause button to pause data collection.

tb_pause.JPG

 

Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.