Using Intel Inspector to Monitor Programs

Using Intel Inspector to Monitor Programs


Intel Inspector DOC


Intel Inspector is a powerful memory and thread debugger that helps identify memory errors, threading issues, and other bugs in your applications. Here’s how to use it:

Installation and Setup

  1. Install Intel Inspector as part of the Intel® oneAPI Base Toolkit or HPC Toolkit
  2. Configure your environment by running the appropriate vars script:
    • On Windows: C:\Program Files (x86)\Intel\oneAPI\inspector\latest\env\vars.bat
    • On Linux: source /opt/intel/oneapi/inspector/latest/env/vars.sh

Basic Usage

1. Starting Analysis

For a new analysis:

  • Launch Intel Inspector GUI
  • Click “New Project”
  • Specify:
    • Application executable
    • Working directory
    • Command line arguments

Command line alternative:

inspxe-cl -collect <analysis_type> -r <result_dir> -- <your_program> [args]

2. Choosing Analysis Type

Intel Inspector offers several analysis types:

  • Memory Errors: Detect memory leaks, corruption, etc.
  • Threading Errors: Find race conditions, deadlocks, etc.
  • Combo Analysis: Both memory and threading

3. Running the Analysis

  1. Select your desired analysis type
  2. Click “Start” to run your program under inspection
  3. The tool will instrument and monitor your application

Interpreting Results

After analysis completes:

  • Problems are categorized by severity (Error, Warning, Remark)
  • Click on issues to see:
    • Detailed description
    • Source code location (if debug info available)
    • Call stack leading to the issue

Advanced Features

  1. Suppressions: Create filters to ignore known issues
  2. Baselines: Compare results between different runs
  3. Custom Analysis: Configure specific memory or threading checks
  4. Integration: Use with IDEs like Visual Studio or Eclipse

Command Line Reference

Common commands:

# Memory error analysis
inspxe-cl -collect mi1 -r ./result_dir -- ./myapp

# Threading error analysis
inspxe-cl -collect ti1 -r ./result_dir -- ./myapp

# View results
inspxe-cl -report problems -r ./result_dir

Tips for Effective Use

  1. Build your application with debug symbols (-g on Linux, /Zi on Windows)
  2. Reduce optimization levels for clearer analysis
  3. Start with small test cases before analyzing large applications
  4. Use the “Pause” feature for long-running applications
  5. Consider incremental analysis for large codebases

Intel Inspector provides detailed documentation with examples for specific programming languages and scenarios. Would you like more specific information about any particular aspect of using Intel Inspector?

你可能感兴趣的:(HPC/MPI,数值计算/数值优化,Fortran,HPC)