Compiler Settings for Threading Error Analysis in Intel® Inspector

ID 659199
Updated 12/13/2018
Version Latest
Public

author-image

By

Introduction

Threading error analysis in Intel® Inspector can analyze most native binaries. However, some settings make analysis easier. In this article, "Intel Inspector" refers to the threading error analysis feature in particular.

Useful settings for threading error analysis in Intel® Inspector
Switch Effect

Linux*:
-g

Windows*:
/Zi
/ZI

Highly recommended. Intel Inspector uses the symbols to associate addresses to source lines. For threading error analysis this setting will suppress some false positives.

Linux*:
-O0

Windows*:
/Od

Recommended for initial analysis Allows Intel Inspector to more easily associate errors to the correct source line. Intel Inspector 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.

Linux*:
-shared-libgcc[1]

Windows*:
/MD
/MDd

Recommended. Using this default setting will suppress some false positives.
Useful settings for threading error analysis in Intel® Inspector on OpenMP* applications compiled with the Intel Compiler[2]
Switch Effect

Linux*:
-openmp

Windows*:
/Qopenmp

Highly recommended.

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

Linux*:
-openmp-link dynamic

Windows*:
/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.

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 for applications using Intel® Threading Building Blocks (TBB)
Switch Effect

Linux*:
-DTBB_USE_DEBUG
-DTBB_USE_THREADING_TOOLS

Windows*:
/DTBB_USE_DEBUG
/DTBB_USE_THREADING_TOOLS

Highly recommended. Intel Inspector 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 will identify false positives in Intel® TBB.
Settings not recommended for use with threading error analysis in Intel® Inspector
Switch Effect

Linux*:
-static
-static-libgcc

Windows*:
/MT
/MTd

Not recommended.

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

Linux*:
-msse4a
-m3dnow

Windows*:
N/A

Do not use. Binaries which use instructions not supported by Intel processors may cause unknown behaviors in Intel Inspector.

Linux*:
-debug [keyword]

Windows*:
/debug [keyword]

Not recommended.

Intel Inspector 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.

Linux*:
-coarray

Windows*:
/Qcoarray

Do not use.

Threading error analysis in Inspector does not support coarray Fortran.
Settings which have no impact to threading error analysis in Intel® Inspector
Switch Effect

Linux*:
N/A

Windows*:
/FIXED:NO

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

Notes

[1] Threading Error Analysis in Intel Inspector 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
    Linux: libthread.so
  • C Runtime Library
    Linux: libc.so,
    Windows: msvcr90.dll, msvcr80.dll, msvcr90d.dll, or msvcr80d.dll

Threading Error Analysis in Intel Inspector 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 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  – therefore you are likely to get false positives and false negatives if you use those libraries.

More Information

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