User Guide


Add Parallelism to Your Program

Once you have completed the previous steps in the
perspective workflow and have tested and approved a serial version of your application program, you can add parallelism to a selected parallel site. Before you add parallel framework code, complete developer/architect design and code reviews about the proposed parallel changes.
To add parallelism to your program, perform the following steps:
  1. Choose one parallel programming framework (threading model) for your application, such as
    Intel® oneAPI Threading Building Blocks (oneTBB)
    , OpenMP*, Microsoft Task Parallel Library* (TPL) (on Windows* OS systems only), or some other parallel framework. To learn about the parallel framework(s) available for your application's language, see the help topic Parallel Frameworks.
  2. Add the parallel framework to your build environment.
  3. Add parallel framework code to synchronize access to the shared data resources, such as
    or OpenMP
  4. Add parallel framework code to create the parallel tasks.
In the last two steps, as you add the appropriate parallel code from the chosen parallel framework, you can keep, comment out, or replace the
Intel Advisor
You should add the synchronization code - such as
or OpenMP locks or mutexes - before adding the parallelism. Synchronized code without parallelism works correctly. In contrast, parallel code without synchronization works incorrectly.
With the synchronization in place, introduce the parallelism. This will cause the operations of multiple tasks to execute in parallel. If you have any remaining bugs caused by data sharing and synchronization problems, they will begin to appear and must be debugged.

Product and Performance Information


Performance varies by use, configuration and other factors. Learn more at