Going Parallel: Part 4 -- Enter Intel Parallel Studio
Previously I examined a Dhrystone app and identified hotspots. Since then Intel Parallel Studio has been released, so I thought I'd convert the project to use it. This time I concentrate on converting my project to Visual Studio, then use Parallel Studio begin implementing parallelism.Links to previous sections of blog
- Going Parallel: Part 1 -- Doing Two Things at Once. Impossible!
- Going Parallel: Part 2 -- So Who's Really Writing Parallel Applications?
- Going Parallel: Part 3 -- Let's Get started!
Steps to using Parallel Studio
First of all you must already have Visual Studio installed -- either 2005 or 2008. I'm using Visual; Studio 2005.
Parallel Studio can be downloaded from http://software.intel.com/en-us/intel-parallel-studio-home/ by pressing the Evaluate button.
After you have downloaded and installed the product, you might want to consider downloading the Intel Parallel Advisor Lite from http://software.intel.com/en-us/articles/intel-parallel-advisor-lite/. I'll use the Advisor Lite in a subsequent blog, but you might as well get it whilst you are in 'downloading mode'
Creating a Visual Studio Project
First Create new Win32 Console application from the File | New | Project menu
Once you've put a valid path in the Location field, the 'OK' button becomes live. Press OK!
Press the Next> button, and edit the settings as follows...
Finally press Finish.
In the new project, add the existing files from the previous blog (dhry_1.c, dhry_2.c, dhry.h)
After adding all three files, open the project properties and add the TIME to the Preprocessor Definitions
Build the project with the default settings and make sure the program runs.
Using the Intel C++ Compiler
From the solution context menu select 'Use Intel C++...'
First thing you should notice is a Composer icon appearing in the solution browser.
Adding the Parallelism using OpenMP
I like OpenMP. It's an easy way to add parallelism to code.In my code example, I added a single statement to the beginning of the main lop in the program
#pragma
omp parallel forfor (Run_Index = 1; Run_Index <= Number_Of_Runs; ++Run_Index)
To enable OpenMP, you need to modify the compiler options:
I suggest that you also add an extra command-line option to make the compiler spew out any remarks. We can then get better information about any OpenMP directives that the compiler handles.
I then built the code with the Intel compiler ...
The output window shows that the OpenMP code was parallelised
dhry_1.c(145): (col. 1) remark: OpenMP DEFINED LOOP WAS PARALLELIZED.
Error, Errors Errors!
On running the application I got an application error:
In the next blog I'll look at using Static and Dynamic analysis to help correct the errors I have just introduced.
This Week's Multicore Reading List
MATLAB and Google App Engine
Logging In C++ : Part 2
Improving log granularityA Conversation with BitMagic's Developer
Prefer Structured Lifetimes: Local, Nested, Bounded, Deterministic
- Intel Parallel Studio; Download the free eval today!
- Parallelism Breakthrough Video Series; Watch and learn more about Intel® Parallel Studio
- 2009 Intel Software Webinar Series; View On-Demand webinars
- Coding for Multi-core Processes; Intel® Compiler Pro eBook
- Performance Through Parallelism; Intel® Tuning for Vista eBook
- Intel® Software Network; Connect with developers and Intel engineers
-
November 17, 2009
Visual Effects for Animation - presented by DreamWorks Animation
Speaker: Ron Henderson (Bio)Ron Henderson manages the FX Tools group at DreamWorks Animation, where he is responsible for developing physical simulation and procedural modeling tools. These systems have been used for key visual effects in recent films such as Kung Fu Panda and Monsters vs. Aliens (March 2009).
Prior to joining DreamWorks in 2002 he was a senior scientist at Caltech with a joint appointment to the Applied Math and Aeronautics departments, where he worked on efficient techniques for the direct numerical simulation of fluid turbulence.Abstract:
In this webinar, Ron Henderson will show examples of visual effects, from hair and feathers to smoke and fire, from a variety of DreamWorks Animation feature films. He will discuss in general terms the kinds of techniques used to achieve particular visual effects. Finally, Henderson will show a detailed breakdown of the dam-breaking scene from Madagascar: Escape 2 Africa, demonstrating how different elements of key frame animation, simulation, and rendering are combined in a real production shot. -
December 1, 2009
A Quick and Easy Way to Parallelize a Legacy Codebase with Intel® Threading Building Blocks (TBBs)
Speaker: Bernard Laberge, Avid, Senior Principal Engineer (Bio)Bernard Laberge is a senior principal engineer in the video editors division at Avid. During his seven years with the company he has been actively involved in the replacement of the legacy video processing engines used by Avid editors with a common hardware-abstracted, component-based video processing engine currently running on the CPU with SIMD optimized code, GPU, and dedicated hardware.
Abstract:
Learn how to overcome the limitations of a thread-based scheduler, including dealing with the absence of recursive parallelism support and the inefficient handling of unbalanced processing load. Bernard Laberge addresses how Avid resolved the expensive refactoring of their thread-based scheduler into a task-based solution by choosing Intel® Threading Building Blocks (TBBs). He explores how Avid was able to easily integrate the Intel TBBs into their video editor applications and more than 5 million lines of code. -
December 15, 2009
How to Use Intel® Parallel Studio to Streamline Code Development in a Multicore Environment
Speaker: Matt Dunbar, Director for Performance Technology, SIMULIA (Bio)Matt Dunbar is the director for performance technology at SIMULIA. Since joining the company in 1993, he has worked on parallelization of the Abaqus suite of products, initially for shared memory architectures and more recently for distributed memory architectures. Dunbar has also been intimately involved in selecting both the hardware and software tools used in the development of the Abaqus product line.
Abstract:
Resolve elusive, costly multithreading errors quickly and efficiently with Intel® Parallel Studio. While many coding problems that lead to bugs in software applications are typically straightforward logic errors, errors in managing memory and in multithreading code can sometimes take weeks to months to diagnose and fix. Matt Dunbar explores how and why taking advantage of multicore processors through multithreaded code is critical for compute-intensive applications. While spotlighting his work on SIMULIA's Abaqus finite element solver, Dunbar addresses the need for multicore execution and shares his experiences using Intel Parallel Studio to streamline code development in a multicore environment.



