Intel® Advisor User Guide

ID 766448
Date 12/16/2022
Public

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

Document Table of Contents

Annotation Types Summary

You can use different kinds of Intel® Advisor annotations to mark where you propose to have parallel sites, tasks, locks, or perform special actions. These annotations are:

  • Parallel site annotations

  • Parallel task annotations

  • Parallel lock annotations

  • Annotations that let you pause and resume data collection

  • Special-purpose annotations

To be useful, a parallel site must contain at least one task. Code within a parallel task can be executed by multiple threads independently of other instances of itself and also other parallel tasks. Many tasks are code within a loop, or they could be a single statement that does an iterative operation. After you use the Survey or similar profiling tool to locate where your program spends its time, you will see two general types of parallel code regions (parallel sites):

  • A simple loop that requires only a single task. For the common case where the Survey tool identifies a simple loop structure whose iterations consume much of an application's CPU time and the entire loop body should be a task, you may only need a single task within a parallel site. Unless your time-consuming code is not in a loop or has task(s) in a complex loop, start with this simple form. Add annotations to mark the beginning and end of the parallel site around the loop, and add one task-iteration annotation at the start of the loop body. This annotation form is the easiest to convert to parallel code.

  • Code whose characteristics require multiple tasks. Depending on the application code characteristics, you may need multiple tasks. For example, you may have statements that can each become separate tasks, or complex or nested loop structures where you need multiple tasks to meet scalability requirements. In this case, add site annotations to mark the beginning and end of the parallel site region and also task annotations that mark the beginning and end of each task.

The two task annotation types use the same parallel site annotations. The following table lists the annotations by category type, including the syntax for the C/C++, Fortran, and C# languages. Each has a link to its detailed description.

NOTE:
C# and .NET support is deprecated starting Intel® Advisor 2021.1.

Optional arguments are identified using square brackets, such as annotation([int expr]).

NOTE:

To help you add annotations, use the Intel Advisorannotation assistant in the Survey windows or the No Data message to copy and add code snippets or the Annotation Wizard if you use the Microsoft Visual Studio* code editor (see Inserting Annotations Using the Annotation Wizard). You also need to add the reference to the annotations definitions file.