Compiler Settings for Threading Error Analysis in Intel® Parallel Inspector

Introduction :
Threading  error analysis in Intel® Parallel Inspector can analyze just about any native binary.  However, some settings make analysis easier.

For the purposes of this article - when I refer to Intel® Parallel Inspector - I am referring to the threading error analysis within Intel® Parallel Inspector.

Useful Settings for threading error analysis in Intel Parallel Inspector:

Switch

Purpose

/Zi, /ZI
(highly recommended)

Intel Parallel Inspector uses the symbols to associate addresses to source lines. 

For threading error analysis this setting will suppress some false positives.

/Od
(recommended for initial analysis)

Allows Intel Parallel Inspector to more easily associate errors to the correct source line.

Intel Parallel Inspector can also analyze optimized binaries, but it is difficult for Intel Parallel Inspector to pinpoint the source code location causing a problem in optimized assembly that does not have specific source lines.  Also, optimized builds tend to keep variables in registers - which may avoid a data race.

Note: While it is easier to do analysis of binaries built with /Od, it is also important to check for threading errors in your "released" (not /Od) version of your binaries.

/MD or /MDd

(recommended)

Using this setting will suppress some false positives.

  

Useful Settings for threading error analysis in Intel Parallel Inspector  on OpenMP* Applications compiled with the Intel Compiler:

Switch

Purpose

/Qopenmp

(highly recommended)

Without this switch Intel Parallel Inspector will not find any data races or deadlocks associated with the threading due to your OpenMP* pragmas.

/Qopenmp-link:dynamic

(recommended)

In Intel® Compiler 11.0 and Intel® Composer this setting chooses the dynamic version of the OpenMP* runtime libraries which has been instrumented for Intel Parallel Inspector.

This is the default when using Intel Compiler 11.0 or Intel Parallel Composer.

   

  

Useful Setting for threading error analysis in Intel Parallel Inspector for applications using Intel® Threading Building Blocks (TBB):

Switch

Purpose

/D "TBB_USE_THREADING_TOOLS" (highly recommended)

Without this switch Intel Parallel Inspector will identify false positives in Intel® TBB.  Note: If you compile at /Od - it will be automatically set

  

Settings not recommended for use with threading error analysis in Intel Parallel Inspector:

Switch

Purpose

/Qtcheck
(do not use)

This setting is an alternative method of instrumentation for Intel® Thread Checker.  Intel Parallel Inspector does not use this switch.

/Qopenmp-link:static

(do not use)

This setting places the static version of the Intel® OpenMP* libraries into your code.  This version does not contain the necessary instrumentation to avoid false positives.

/Qtprofile

(do not use)

This setting is an alternative method of instrumentation for Intel® Thread Profiler.  Intel Parallel Inspector does not use this switch.

/Qopenmp_stubs

(do not use)

This setting will prevent OpenMP* codes from actually being parallel.

/debug:parallel

(do not use)

This setting enables the Intel® Parallel Debugger Extension for the Intel Parallel Composer.  It is not used for the Intel Parallel Inspector

  

Settings which have no impact to threading error analysis in Intel Parallel Inspector:

Switch

Purpose

/FIXED:NO

This is not required for Intel Parallel Inspector.  It is a linker switch required by the code instrumentor used in Intel Thread Checker, Intel Thread Profiler, and in the call graph in Intel VTuneTM Performance Analyzer.

Note: Intel Parallel Inspector works better with the dynamic versions of the following libraries:

•·         OpenMP* Runtime Library (libiomp5.dll or libguide.dll)

•·         C Runtime Library (msvcr90.dll, msvcr80.dll, msvcr90d.dll, or msvcr80d.dll)

Intel Parallel Inspector will report false positives if you link to any of the following libraries:

•·         OpenMP* Runtime Library (libiomp5mt.lib, libguide.lib, vcomp.lib/vcomp.dll)

•·         C Runtime Library (libcmt.lib)

More Information:

This article addressed the most obvious switches that developers would have concerns over.  Most switches will work with Intel Parallel Inspector - but not every switch combination is tested.  If you have information regarding other switches, please add a comment to this article.  If you have question regarding a particular switch please submit an issue to the Intel® Parallel Studio Forum.

Version :
Intel® Parallel Inspector
Intel® Parallel Composer
Intel® C++ Compiler for Windows* 11.0
Intel® C++ Compiler for Windows* 10.1
Microsoft* Visual Studio 2005
Microsoft* Visual Studio 2008

如需更全面地了解编译器优化,请参阅优化注意事项