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:
- Set theFGT_ROOTvariable and update yourPATHenvironment variable as shown in the table below.OSEnvironment VariableValueDescriptionLinux*FGT_ROOT<advisor-install-dir>/fga<version>/fgtThe path to the Flow Graph Collector installationPATH${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 tofgtrun.sh,fgtrun.csh, andfgt2xml.exe.
- To enable tracing from OMPT, set the following variables:OSEnvironment VariableValueDescriptionLinux*OMP_TOOLEnabledOMPT tool support enabler.OMP_TOOL_LIBRARIES${FGT_ROOT}/linux/lib/intel64/cc4.8_libc2.19_kernel3.13.0/libfgt.soPath to OpenMP collector library.
- 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.0and_fgt.1, in an autogenerated folder in the format_fga_YYYYMMDD_HHMMSSaccording to its creation (for example,_fga_20191111_1111).
- Convert the trace files to GraphML* and TraceML* format.Convert the_fgtbinary files to the XML format understood by the Flow Graph Analyzer using thefgt2xml.execonverter in the directory containing the folder with the trace files:fgt2xml.exe <desired_name> --omp_experimentalorfgt2xml.exe --omp_experimental <desired_name>orfgt2xml.exe --omp_experimentalThis converter scans the current directory for all_fgtfiles within the most recent folder according to its name and generates two output files:<desired_name>.graphmland<desired_name>.traceml. If you do not provide a<desired_name>, the converter createsunknown.graphmlandunknown.traceml.Theomp_experimentalflag 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.