Compiler settings for threading error analysis in Intel® Inspector XE

Introduction:
Threading error analysis in Intel® Inspector XE 2011 can analyze most native binaries. However, some settings make analysis easier.

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

Useful Settings for threading error analysis in Intel Inspector XE:

Linux Switch

Windows Switch

Purpose

-g

/Zi, /ZI

Highly recommended.

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

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

-O0

/Od

Recommended for initial analysis

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

Intel Inspector XE can also analyze optimized binaries, but it is difficult to pinpoint the source code location causing a problem in optimized assembly that does not have specific source lines.

Note: While it is easier to do analysis of  binaries without optimization, it is also important to check for memory errors in your "released/optimized" version of your binaries.

-shared-libgcc1

/MD or /MDd

Recommended.

Using this default setting will suppress some false positives.

 

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

Linux Switch

Windows
Switch

Purpose

-openmp

 

/Qopenmp

Highly recommended.

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

-openmp-link dynamic

 

/Qopenmp-link dynamic

Recommended.

In Intel® Compiler 11.x, 12.x and Intel® Composer this setting chooses the dynamic version of the OpenMP* runtime libraries which has been instrumented for Intel Inspector XE 2011.

This is the default when using Intel Compiler 11.x, 12.x or Intel Parallel Composer.

 

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

Linux Switch

Windows Switch

Purpose

-DTBB_USE_DEBUG
or
-DTBB_USE_THREADING_TOOLS

/DTBB_USE_DEBUG
or
/DTBB_USE_THREADING_TOOLS

Highly recommended.

Intel Inspector XE needs an instrumented version of TBB. The Macro TBB_USE_THREADING_TOOLS directs TBB to enable this instrumentation

The Macro TBB_USE_THREADING_TOOLS is set when you set TBB_USE_DEBUG.

Without TBB_USE_THREADING Intel Inspector XE will identify false positives in Intel® TBB.

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

Linux Switch

Windows Switch

Purpose

-static
-static-libgcc

/MT, /MTd

Not recommended.

Using these setting will prevent threading Error analysis in Intel Inspector XE from suppressing some false positives.1

-tprofile

/Qtprofile

Do not use.

This Intel Compiler setting is an alternative method of instrumentation for Intel® Thread Profiler. Intel® Inspector XE. The instrumentation added by -tprofile is not supported by Intel Inspector XE.

-tcheck

/Qtcheck

Do not use.

This Intel Compiler setting is an alternative method of instrumentation for Intel® Thread Checker. Intel® Inspector XE. The instrumentation added by -tcheck is not supported by Intel Inspector XE.

-msse4a,
-m3dnow

n/a

Do not use.

Binaries which use instructions not supported by Intel® Processors may cause unknown behaviors in Intel Inspector XE.

-debug [keyword]

/debug [keyword]

Not recommended.

Intel Inspector XE works best with full (the default). Other options including parallel, extended, emit-column, expr-source-pos, inline-debug-info, semantic-stepping, & variable-locations are not supported by Intel Inspector XE.

-coarray

/Qcoarray

Do no use.

Threading error analysis in Inspector XE 2011 does not support coarray Fortran

 

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

Linux Switch

Windows Switch

Purpose

n/a

/FIXED:NO

This is not required for Intel Inspector XE. 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 VTune Performance Analyzer. 

 

More Information:

1) Threading Error Analysis in Intel Inspector XE works better with dynamic versions of the following libraries:

  • OpenMP* Runtime Library as supplied by an Intel Compiler3
    Linux: libiomp5.so or libguide40.so,
    Windows:libiomp5.dll or libguide.dll
  • Posix Thread library
    libthread.so
  • C Runtime Library
    Linux: libc.so,
    Windows: msvcr90.dll, msvcr80.dll, msvcr90d.dll, or msvcr80d.dll

Threading Error Analysis in Intel Inspector XE does not work as well with the static version of the following libraries:

  • OpenMP* Runtime Library as supplied by an Intel Compiler
    Linux: libiomp5.a or libguide4.a
    Windows: libiomp5mt.lib, libguide.lib
  • Posix Thread library
    Linux: libpthread.a
  • C Runtime Library
    Linux: libc.a
    Windows: libcmt.lib

2) Threading Error Analysis in Intel Inspector XE does not support OpenMP libraries based on the GNU Compiler (libgomp.so),  or Microsoft Compiler (vcomp90.dll, vcomp90d.dll). Those libraries are not instrumented to support threading error analysis in Intel Inspector XE – therefore you are likely to get false positives and false negatives if you use those libraries.

This article addressed the most obvious switches that developers would have concerns over. Most switches will work with Intel® Inspector XE - 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 Inspector XE Forum

Version :
Intel® Inspector XE 2011
Intel® C++ Compiler 11.X, 12.X
GCC Compiler 3.4.6 and above
Microsoft Visual Studio 2005, 2008, 2010

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