Intel® Advisor User Guide

ID 766448
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Collecting Traces for OpenMP* Applications

NOTE:

OpenMP* trace collection is currently supported only on Linux* and macOS* operating systems.

To collect OpenMP traces for an application, you need an OMPT-enabled OpenMP* version 5.0 library, such as LLVM-OpenMP.

To build a sample code (for example, the omp_depend.cpp described in the Experimental Support for OpenMP* Applications) on a Linux OS with the Intel® C++ Compiler Classic, use the following command:

icpc -std=c++11 -qopenmp omp_depend.cpp -o example
NOTE:
Please use -g compiler flag to enable symbol resolution information.

To collect traces for OpenMP applications and create XML files, follow these steps:

  1. Set the FGT_ROOT variable and update your PATH environment variable as shown in the table below.

    OS

    Environment Variable

    Value

    Description

    Linux*

    FGT_ROOT

    <advisor-install-dir>/fga<version>/fgt

    The path to the Flow Graph Collector installation

    PATH

    ${FGT_ROOT}/linux/bin:${FGT_ROOT}/linux/bin/ia32/cc4.8_libc2.19_kernel3.13.0:${FGT_ROOT}/linux/bin/intel64/cc4.8_libc2.19_kernel3.13.0:${PATH}

    The path must include paths to fgtrun.sh, fgtrun.csh, and fgt2xml.exe.

  2. To enable tracing from OMPT, set the following variables:

    OS

    Environment Variable

    Value

    Description

    Linux*

    OMP_TOOL

    Enabled

    OMPT tool support enabler.

    OMP_TOOL_LIBRARIES

    ${FGT_ROOT}/linux/lib/intel64/cc4.8_libc2.19_kernel3.13.0/libfgt.so

    Path to OpenMP collector library.

  3. Run the application.

    If your paths are set up correctly, the application generates one or more files that start with _fgt. There is one file per thread that participates in executing the parallelism in the application. So, for example, if two threads participate in the execution of the flow graph, running the application generates two files, _fgt.0 and _fgt.1, in an autogenerated folder in the format _fga_YYYYMMDD_HHMMSS according to its creation (for example, _fga_20191111_1111 ).

  4. Convert the trace files to GraphML* and TraceML* format.

    Convert the _fgt binary files to the XML format understood by the Flow Graph Analyzer using the fgt2xml.exe converter in the directory containing the folder with the trace files:

    fgt2xml.exe <desired_name> --omp_experimental

    or

    fgt2xml.exe --omp_experimental <desired_name>

    or

    fgt2xml.exe --omp_experimental

    This converter scans the current directory for all _fgt files within the most recent folder according to its name and generates two output files: <desired_name>.graphml and <desired_name>.traceml. If you do not provide a <desired_name>, the converter creates unknown.graphml and unknown.traceml.

    The omp_experimental flag enables displaying a subgraph and tasks dependence graph. By default, display support is disabled and you see only information related to OpenMP constructs in the per-thread traces.