Intel® Advisor User Guide

ID 766448
Date 7/13/2023

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


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


    Environment Variable






    The path to the Flow Graph Collector installation



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

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


    Environment Variable






    OMPT tool support enabler.



    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


    fgt2xml.exe --omp_experimental <desired_name>


    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.