Quantcast
Viewing all articles
Browse latest Browse all 1853

5. Add Parallel Framework

After you fix problems, repeat steps 3 and 4. When acceptable, replace Intel Advisor annotations with parallel framework code.

This step assumes you have completed the prior steps, such as:

  • Identifying and marking the parallel sites and tasks in your application program with annotations.

  • Running the Intel Advisor Suitability and Correctness tools.

  • Checking the various parallel overhead items with the Suitability tool Image may be NSFW.
    Clik here to view.
    .

  • Fixing the sharing problems reported by the Correctness tool Image may be NSFW.
    Clik here to view.
    .

Choosing and Setting Up the Parallel Framework

First, you need to choose a high-level parallel framework Image may be NSFW.
Clik here to view.
, such as Intel® Cilk™ Plus, OpenMP*, or Intel® Threading Building Blocks (Intel® TBB), which are provided with most Intel® Parallel Studio XE editions. Once you choose the framework, make sure your build environment is set up to use it. If you have not decided which parallel framework to use, read the help topic Overview of Parallel Frameworks.

To set up the parallel framework software for one or more projects, see Adding the Parallel Framework to your Build Environment.

Viewing the Annotation Report Window

The Annotation Report window displays a high-level list of all annotations and their types in a table-like grid format. You can double-click or right-click and select View Source or Edit Source to view the annotated source code.

Replacing Annotations with Parallel Framework Code

Use the Annotation Report window to help you identify the annotations in your program that need to be replaced with parallel framework code.

Start by replacing lock annotations with parallel framework code that will provide synchronization. It is safe to add synchronizing locks to serial code, but not safe to have unsynchronized access without the locks in parallel code.

To enable parallelism, replace parallel site and task annotations with parallel framework code that creates the parallel tasks. See About Replacing Annotations with Intel® TBB Code, About Replacing Annotations with Intel® Cilk™ Plus Code, About Replacing Annotations with OpenMP Code, or About the Microsoft Task Parallel Library (TPL).

Next Steps

Do one or both of the following:

  • After you add parallel framework code to provide synchronization and create the parallel tasks, test your converted program by using other products in the Intel® Parallel Studio XE 2015 suite. These tools let you check and tune your parallel program, as described in Using Intel® Inspector and Intel® VTune™ Amplifier help topic.

  • After adding parallelism to a portion of your program, you can continue using Intel Advisor and consider adding a different parallel site. In some cases, you may select a different part of your program and examine it for parallelism. In this case, you start the workflow from the beginning, including running the Survey tool, and should read the topic Multiple Parallel Sites.

Inglese

Viewing all articles
Browse latest Browse all 1853

Trending Articles