Sign In
Scalability Notes
[Read -> Think -> Write]
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Options
Blog Home
Email Blog Author
Share this
RSS for posts
RSS for comments
Search
Advanced search options...
Search In:
Everything
Blogs
Forums
People
Groups
Places
Pages
Date range:
All Time
Last Year
Last 6 Months
Last 3 Months
Last Month
Last Week
Last Two Days
Tags
database
distributed system
engineering
hpc
network
parallel
scalability
search
Archive
Archives
December 2010
(1)
September 2010
(1)
August 2010
(1)
April 2010
(1)
February 2010
(2)
January 2010
(4)
December 2009
(1)
November 2009
(1)
October 2009
(1)
September 2009
(1)
August 2009
(4)
June 2009
(2)
May 2009
(1)
April 2009
(1)
March 2009
(2)
February 2009
(4)
January 2009
(1)
Parallel Programming - Using OpenMP
MSDN Blogs
>
Scalability Notes
>
Parallel Programming - Using OpenMP
Parallel Programming - Using OpenMP
changl
11 Jan 2010 1:53 AM
Comments
0
Parallel Programming - Using OpenMP
OpenMP
is a parallel programming model for
shared memory
parallel computers.
It's based on
Fork-Join
parallel execution pattern and is suitable for
Data Parallel
and
Task Parallel
applications.
Fork-Join Pattern
- OpenMP programs begin as a single thread - the
Master
thread, which executes sequentially until the first parallel region construct is encountered.
-
Fork
: the master thread then creates a team of concurrent threads, which will execute some user provided codes.
-
Join
: when the team threads complete, they are synchronized to wait each other(barrier) and then terminate, leaving only the master thread ahead
Fork/Join Pattern in OpenMP (from[1])
Work Sharing Constructs
The core functionality of OpenMP is to parallelly process data or execution tasks, I.E, sharing work load. It provides several constructs to support it:
-
For,
OpenMP will automatically divide these (independent) loop iterations and assign them to one of the team thread to execute.
-
Section,
programmer can define static code sections, each one will be (parallelly) assigned to one of the team thread to execute.
-
Task,
data and code can be (dynamically) packed as a task and the delivered to team thread to execute them.
Implementation
OpenMP is designed for Fortran and C/C++. Its functionalities often exist in the following form:
- New Construct as Language Directive
- APIs as runtime library
- Environment Variables
Currently, visual studio 2008 supports OpenMP 2.5,
OpenMP@MSDN
To use OpenMP in VS2008 c++ developing, you only need to include omp.h header and enable compiler flag /openmp (project property -> c/c++ -> language -> OpenMP Support)
More detailed tutorial can be found at [4][5].
I had written
some OpenMP sample applications
, it's compiled with vs2008 (except the
task
example).
[
Reference
]
[1]
http://en.wikipedia.org/wiki/OpenMP
[2]
http://openmp.org/wp/
[3]
Introduction to Parallel Programming
[4]
OpenMP tutorial at LLNL
[5]
OpenMP hands-on Tutorial at SC08
[6]
Parallel Programming with OpenMP and MPI
[7]
Blog on OpenMP programming
[8]
Intel on OpenMP traps
[9]
Parallel Programming Model Comparison
[10]
Microsoft on OpenMP version in Visual Studio
[11]
More OpenMP sample applications
0 Comments
parallel
Blog - Comment List MSDN TechNet
Comments
Loading...
Leave a Comment
Name
Comment
Please add 6 and 4 and type the answer here:
Post