
Before proceeding to the study of methods of parallelizing programs using OpenMP technology, consider the tools that we need. And we will need first of all Visual Studio 2005/2008 and Intel Parallel Studio.
The advantage of OpenMP technology is that by taking the code of a sequential program, you can parallelize it without significant modification. This is achieved by placing special directives. Of course, in practice it is necessary not only to insert directives, but also to edit the application code itself, but these changes will be much less than if using alternative technologies, such as MPI.
The above means that we can take ordinary sequential code in C / C ++ and begin to parallelize it gradually. For this we just need to include support for OpenMP in the project. In Visual Studio 2005/2008, go to the project properties and select the C / C ++ / Language tab, as shown in Figure 1.

Figure 1 - Visual Studio tab with project settings where you can enable OpenMP support
Don't forget to choose the platforms and configurations in which you plan to use OpenMP. As shown in Figure 2, we selected all configurations (debug, release) and all platforms (Win32, x64).

Figure 2 - The choice of configurations and platforms for which we set parameters
')
OpenMP support is enabled by the “OpenMP Support” option as shown in Figure 3.

Figure 3 - OpenMP support enabled
The next step is to connect the header file "omp.h". It is often reasonable to put "#include <omp.h>" in stdafx.h so that it is visible throughout the project.
That's all the preparatory steps that are needed to start exploring OpenMP technology and parallelizing the program code. We will begin our introduction to OpenMP with the following note. Now we will continue to get acquainted with the tools. The fact is that although the capabilities of Visual Studio 2005/2008 are enough to develop parallel OpenMP programs, this is too spartan conditions. For full-fledged work it is reasonable to use
Intel Parallel Studio . I am not an employee of Intel and nobody pays for advertising tools. Parallel Studio is really convenient and extremely useful tool for developing parallel applications. I recommend based on my own experience.
The Intel Parallel Studio distribution takes about 460 MB and is available for download from the
Intel site. At the same time, the full functionality of Parallel Studio will be available for one trial month, which is quite enough to get acquainted with the principles of operation and experiment with parallel code. Parallel Studio integrates into Visual Studio 2005/2008 by adding additional menu items and a toolbar (see Figure 4).

Figure 4 - Toolbars added by Intel Parallel Studio in Visual Studio
In the following parallel notes, we will use the IntelParallel Inspector tool from the Intel Parallel Studio suite to check the parallel code being created for parallel errors. And also Intel Parallel Amplifier for optimization. We do not need the Intel Parallel Composer compiler, but we will compile OpenMP applications with it. The advantages include support for Intel Parallel Composer version of the standard OpenMP 3.0, while the compiler from Visual Studio 2005/2008 only supports OpenMP 2.0. Intel C ++ also provides some additional features for the static analysis of parallel code, which can be found in the
article .
To compile an application using Parallel Composer, you should make it an active Intel C ++ compiler. This can be done using the “Use Intel C ++” button on the toolbar, as shown in Figure 5.

Figure 5 - Choosing an Intel C ++ Compiler
Now to build the application will use the compiler Intel C ++. Yes, if after compiling and running the application you see a message similar to that shown in Figure 6, then do not be discouraged.

Figure 6 - Error launching the test application after recompiling using Intel C ++
Try to just restart Visual Studio, so that the changes that Parallel Studio enters into the environment will come into effect. If this does not help, use the manual installation of the environment by running the appropriate command files. They are available from the start menu, as shown in Figure 7.

Figure 7 - Setting Environment Settings
For now, let's finish on this first introduction to the tools. Download and install Intel Parallel Studio. Try building some simple program using Intel C ++.