Intel® Advisor User Guide

ID 766448
Date 11/07/2023

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

Document Table of Contents

Examine the Task's Static and Dynamic Extent

Consider the example of incidental sharing from the help topic Incidental Sharing:

extern int x;
for (i = 0; i != n; ++i) {
    x = a[i];
    b[i] = x * b[i];

Examining the Static Extent of the Task

If you define a substitute variable inside the static extent, then each task will get its own private storage for it:

extern int x;
// ...
for (i = 0; i != n; ++i) {
    int x_sub;
    x_sub = a[i];
    b[i] = x_sub * b[i];

Examining the Dynamic Extent of the Task

In the simplest cases, like the example above, the task's dynamic extent is the same as its static extent - it does not contain any function calls. When it does contain function calls, all the functions that might be called while the task is executing are part of its dynamic extent, and you need to consider all reads and writes of the memory location in all of those functions.

So, you need to examine not only the static extent, but also the dynamic extent of a task.