How to model parallelism with Intel® Parallel Advisor Lite

Did you know that Intel® Parallel Advisor Lite offers you the ability to prototype (model) parallelism in your serial application? It lets you scope the effort of parallelizing your application while continuing to use your existing test system and debugging tools as you make source modifications to avoid data sharing issues.

To model potential parallelism, you insert Parallel Advisor Lite annotations into your source code to mark your tentative decisions about your program's parallel task structure. Annotations are textual hints that will not cause compilation or link-time errors when you are not building for Parallel Advisor Lite or when the Parallel Advisor Lite libraries are not found on your system. By using annotations, you avoid having dependencies on particular compilers or parallel constructs.

How to proceed…

    1. Start by identifying likely locations to add parallelism with the use of a profiling tool.
      Using a Release configuration built with debug information, launch the Parallel Advisor Lite profile tool:

    1. Create a new header file that is initialized with the Parallel Advisor Lite Annotation definitions and include it
      Intel® Parallel Advisor Lite annotate header file template

    1. Insert task annotations around a block of code that will execute as a task (red arrows below), then insert the site annotations around the task(s) that you want to execute in parallel with one another (blue arrows below). For example:
      Intel® Parallel Advisor Lite Annotations

  1. Build your project configurations as before (release configuration with debug information)
  2. Confirm that the annotated sites and tasks have potential performance gains. This requires some manual effort since Parallel Advisor Lite does not provide a tool for this step.
    The process of how to evaluate the performance impact can be found in our help documentation.
  3. Using a Debug configuration (with debug information) and a small representative data set, run the Parallel Advisor Lite Correctness Modeling tool to evaluate data accesses that occur within the annotated regions. Depending on the data observations reported, you may be required to insert annotations to model locking of a data access or model a “critical region” or consider larger changes to your source pool...

Once you achieve a clean Correctness Modeling run, you have the choice of replacing annotations with the parallel constructs (creating a parallel program) or looking for another region to prototype. You will be able to exploit the full potential of the Intel® Parallel Studio tools now that you have parallelized your application, such as using Intel® Parallel Amplifier to improve concurrency or Intel® Parallel Inspector to check for threading errors.

For more information about where and when to insert annotations can be found in our Parallel Advisor Lite help Task Organization and Annotations and in our Annotation Reference sections.

Note: Our annotate.h includes windows.h. This is due to combining what would typically be found in an annotate.h/.cpp file pair into a single file. Unfortunately, this inclusion can result in unexpected compilation errors when your application already includes windows.h. You can sidestep this issue by defining “WIN32_LEAN_AND_MEAN” as shown below

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.