Tutorial

  • 2021.1
  • 12/04/2020
  • Public Content

Intel® Advisor
Tutorial for Finding Where to Add Parallelism to C++ Code Using the
Threading Advisor
for
Linux*

This tutorial - and C++ application you can use to follow along - shows how to use the
Threading Advisor
on a
Linux*
platform to find where to add parallelism.
Intel® Advisor
provides tools to help ensure your Fortran, C and C++ native/managed applications realize full performance potential on modern processors:
  • Vectorization Advisor
    is a vectorization optimization tool that lets you identify high-impact, underoptimized loops, what is blocking vectorization, and where it is safe to force vectorization. It also provides code-specific how-can-I-fix-this-issue recommendations.
  • Roofline Analysis
    visualizes actual performance against hardware-imposed performance ceilings (rooflines). It provides insights into where the bottlenecks are, which loops are worth optimizing for performance, what are the likely causes of bottlenecks and what should be the next optimization steps.
  • Threading Advisor
    is a fast-track threading design and prototyping tool that lets you analyze, design, tune, and check threading design options without disrupting your normal development.
  • Offload Modeling
    is a modeling tool that lets you to identify high-impact opportunities to offload to GPU as well as the areas that are not advantageous to offload.
  • Flow Graph Analyzer
    is a visual prototyping tool that lets you represent and analyze performance for applications that use the
    Intel® oneAPI Threading Building Blocks
    flow graph interfaces.
This document was last updated for the
Intel® Advisor
2020 product release. If you are using this tutorial with a higher version of
Intel Advisor
, you may see differences in workflow and analysis type names and user interface design.
About This Tutorial
This tutorial demonstrates an end-to-end workflow you can ultimately apply to your own applications:
  1. Survey the target executable to locate the loops and functions where your application spends the most time.
  2. In the target sources, add
    Intel Advisor
    annotations to mark possible parallel tasks and their enclosing parallel sites.
  3. Check Suitability to predict the maximum parallel performance speedup of the target based on these annotations.
  4. Check Dependencies to predict parallel data sharing problems in the target based on these annotations.
  5. If the predicted maximum speedup benefit is worth the effort to fix the predicted parallel data sharing problems, fix the problems.
  6. Recheck Suitability to see how your fixes impact the predicted maximum speedup.
  7. If the predicted maximum speedup benefit is still worth the effort to add parallelism to the target, replace the annotations with parallel framework code that enables parallel execution.
Estimated Duration
20 minutes.
Learning Objectives
After you complete this tutorial, you should be able to:
  • Explain the recommended
    Threading Advisor
    workflow (usage scenario).
  • Identify compiler/linker options that produce the most accurate and complete
    Threading Advisor
    analysis results.
  • Run
    Threading Advisor
    analysis tools.
  • View, interpret, and manipulate data collected by
    Threading Advisor
    analysis tools.
More Resources
The concepts and procedures in this tutorial apply regardless of programming language; however, a similar tutorial using a sample application in another programming language may be available at Intel® Software Documentation Library.
These sites also offer tutorials for other Intel products.
In addition, you can find more resources in:

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.