Intel® Advisor Help

Data Communication

Occurs when a task writes a value that a different task reads.

Problem type: Data communication

ID

Code Location

Description

1

Allocation site

If present, represents the location and associated call stack when the memory block was allocated.

2

Parallel site

If present, represents the location and associated call stack of the parallel site containing the Data Communication problem.

3

Write

Represents the instruction and associated call stack where the memory was written.

4

Read

Represents the instruction and associated call stack where the memory was read in a different task execution.

Example

void problem()
{
    int* pointer = new int;               // Allocation site
    ANNOTATE_SITE_BEGIN(datacomm_site1);  // Begin parallel site
        ANNOTATE_TASK_BEGIN(task1);
            *pointer = 999;               // Write
        ANNOTATE_TASK_END();
        ANNOTATE_TASK_BEGIN(task2);
            assert(*pointer == 999);      // Read
        ANNOTATE_TASK_END();
    ANNOTATE_SITE_END();
}

In this example, the write to the heap variable in task1 might occur either before or after the read in task2.

void data_communication()
    {
       ANNOTATE_SITE_BEGIN(site);       // Parallel site
       for (int i = 0; i < 2; i++) {
           ANNOTATE_TASK_BEGIN(task);
           communication++;     /* data communication */  // Write and Read in different task execution
           ANNOTATE_TASK_END();
       }
       ANNOTATE_SITE_END();
   }

In this example, each task execution reads the variable communication, adds one to its value, and writes the result back to the variable. The write in each task execution might occur either before or after the read in the other task instance execution.

Possible Correction Strategies

For more information about interactions between tasks and how to fix them, see About Fixing Sharing Problems.

To prevent the Dependencies tool from reporting certain data sharing problems or to request additional analysis for a specific memory region, see the help topic Special-purpose Annotations.

See Also