User Guide

Contents

Fixing
Problems in Code Used by Multiple Parallel Sites

If the Dependencies tool reports a problem(s) in one or more common functions used by multiple parallel sites, you need to investigate and consider several options. In general, keep in mind that the performance impact for privatization is usually less than synchronization, and the performance impact for synchronization is usually less than not adding parallelism. Thus, the general approach is:
  • Evaluate whether it is possible to privatize the data causing the Dependencies problem for both sites. For example, you can often use privatization if the cause is incidental (accidental) sharing. Usually, providing each task with its own private copy of a variable provides the best performance.
  • If you cannot fix the problem by privatizing, consider using synchronization (such as using locks or mutexes). For example, synchronization is often needed if the Dependencies problem is caused by independent updates that have true dependence.
  • In some cases, it may not be feasible to add parallelism to a site. That is, after you to modify the annotations for the parallel site or its tasks and check the Suitability and Dependencies again, you might find a parallel site has negative or minimal performance gain and/or complex data sharing problems. In this case, you may need to remove the site and task annotations and add a comment that states that this code location could not be parallelized.
If you cannot eliminate a Dependencies problem for a common function called by multiple parallel sites by using the approach described above, consider adding a cloned function. That is, one of the parallel sites calls the cloned function and the other parallel site calls the original function. This allows you to implement different fixes to the Dependencies problem(s) for the original function and the cloned function. For example, this approach might allow you to privatize data in either the original function or the cloned function, which was not possible originally.
As with any program, after you modify the code within a parallel site or the annotations, you should run and analyze your program again using the Dependencies and Suitability tools.

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804