Use ANNOTATE_LOCK_ACQUIRE and ANNOTATE_LOCK_RELEASE to specify explicit locking. These annotations are simple executable statements you can put wherever is most convenient. For example:
With Intel Advisor samples, to build the Intel TBB project (_tbb), you need to define the TBBROOT environment variable.
To define this environment variable:
With Intel Cilk Plus, if the only data races in a site come from updates to an accumulator variable, then you may be able to fix them without locks using a reducer. A reducer works with the Intel Cilk Plus runtime system to create a private accumulator variable for each task, and to combine the task-private accumulator variable results in the correct order as the tasks finish. Reducers can be very efficient, because they do not need locks.
When tasks are loop iterations, and the iterations are over a range of values that are known before the loop starts, the loop is easily expressed in OpenMP.
Consider the following annotated serial C/C++ loop:
You need to specify the directory containing the Intel Advisor definition file as an additional include directory when you compile your program. Intel Advisor installs its annotation definition files into a default directory on your system. For example:
Depending on your particular environment, you may want to control the expansion of C/C++ macros in advisor-annotate.h at the inclusion site.
Access key capabilities related to:
Sources in the Survey Source or Suitability Source windows.
Problems, messages, and code locations displayed in the Dependencies Source window.
Occurs when two or more locks are acquired in a different order in two task executions, potentially leading to a deadlock when the program's tasks execute in parallel.