Our website uses cookies to enhance your browsing experience.
Accept
to the top
close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam

Webinar: Evaluation - 05.12

>
>
Parallel notes N2 - toolkit for OpenMP

Parallel notes N2 - toolkit for OpenMP

Feb 24 2010
Author:

Before starting to study the technique of parallelizing programs with the help of OpenMP technology, let us discuss the toolkit we will need. And here is what we will need first of all - Visual Studio 2005/2008 and Intel Parallel Studio.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image1.png

The advantage of OpenMP technology is that you may take the code of a serial program and parallelize it without significantly modifying it. It is done with the help of special directives arranged throughout the program text. Of course, in practice you will not only have to add directives but also edit the application code but these changes will be much fewer than if using alternative technologies such as MPI.

All said above means that you may take a common C/C++ serial code and start parallelizing it gradually. To do it you just need to enable OpenMP support in the project. Go to the project properties in Visual Studio 2005/2008 environment and choose the tab C/C++ / Language as shown in Figure 1.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image2.png

Figure 1 - The tab of project settings in Visual Studio where you may enable OpenMP support

Do not forget also to choose the platforms and configurations you want to employ OpenMP in. As shown in Figure 2, we have chosen all the configurations (debug, release) and all the platforms (Win32, x64).

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image3.png

Figure 2 - Choosing configurations and platforms to set the properties for

OpenMP support is enabled by the option "OpenMP Support" as shown in Figure 3.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image4.png

Figure 3 - OpenMP support is enabled

The next step is to enable the header file "omp.h". It is often reasonable to put "#include <omp.h>" into "stdafx.h" to make it visible to the whole project.

These are all the preliminary steps you should make to start mastering OpenMP technology and parallelizing the program code. We will begin to study OpenMP in the next post. But now let us continue discussing the tools. You see, although Visual Studio 2005/2008 provides all the necessary functions to develop parallel OpenMP programs, it is too restricted. It is better to employ Intel® Parallel Studio to conveniently and efficiently work with OpenMP. I am not Intel employee and I am not paid for advertising its tools - I recommend it because it is really a convenient and very useful tool for developing parallel applications. I recommend it relying on my own experience.

Intel Parallel Studio distribution kit is about 460 Mbytes and you may download it from the Intel site. Parallel Studio functions remain unlimited during one trial month - this time is quite enough to understand the working principles and carry out some experiments with parallel code. Parallel Studio integrates into Visual Studio 2005/2008 and adds the corresponding menu and toolbar items (see Figure 4).

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image5.png

In the next parallel notes we will use the tool Intel Parallel Inspector from the Intel® Parallel Studio package to check the parallel code being created for parallel errors. We will also use Intel® Parallel Amplifier in optimization purposes. We do not necessarily need Intel Parallel Composer compiler but still we will use it to compile OpenMP applications. One of its advantages is that it supports OpenMP 3.0 standard while the Visual Studio 2005/2008 compiler provides support only for OpenMP 2.0. Also, Intel C++ provides some additional functions of static analysis of parallel code - you may read about them in the article.

To compile an application with Parallel Composer you should enable Intel C++. Click the button "Use Intel C++" on the toolbar to do that as shown in Figure 5.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image6.png

Now Intel C++ will be used to build applications. And one more thing - if you see a message like the one shown in Figure 6 on launching the application, do not get upset.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image7.png

Try just to relaunch Visual Studio to enable the changes introduced by Parallel Studio into the environment. If it does not help, set the environment manually by launching the corresponding command files. You may do this from the Start menu as shown in Figure 7.

0058_Parallel_notes_N2_-_toolkit_for_OpenMP/image8.png

Introduction into the tools is over at this point. Download and install Intel Parallel Studio and try to build some simple program of yours with Intel C++.

Popular related articles


Comments (0)

Next comments next comments
close comment form