SlideShare a Scribd company logo
1 of 2
Download to read offline
OpenMP
Author: Andrey Karpov

Date: 20.11.2009


Abstract
The article briefly describes the OpenMP technology.


OpenMP
OpenMP (Open Multi-Processing) is a set of compiler directives, library procedures and environment
variables intended for programming multi-threaded applications on multi-processor systems with
shared memory (SMP-systems).

The first OpenMP standard was developed in 1997 as an API oriented on writing easy portable multi-
threaded applications. At first, it was based on Fortran language but then included C and C++ as well.

OpenMP interface became one of the most popular parallel programming technologies. OpenMP is
successfully exploited both in programming of supercomputer systems with many processors and in
desktop user systems or, for example, Xbox 360.

OpenMP specification is developed by several large computer and software vendors whose activity is
regulated by the non-profit organization "OpenMP Architecture Review Board" (ARB) [1].

OpenMP exploits the parallel execution model called "branching-merging". OpenMP program begins as
a single execution thread called the initial thread. When the thread meets a parallel construction, it
creates a new group of threads consisting of the initial thread itself and some other threads and
becomes the main thread in the group. All the members of the new group (including the main thread)
execute the code inside the parallel construction. At the end of the parallel construction, there is an
implicit barrier. After the parallel construction is processed, the further execution of the user code is
performed only by the main thread. A parallel area may include other parallel areas where each thread
of the initial area becomes the main thread of its thread group. The embedded areas may also include
areas of a deeper nesting level.

The number of threads in a group performed concurrently can be controlled by several methods. One of
them is using the environment variable OMP_NUM_THREADS. Another method is to call the procedure
omp_set_num_threads(). One more way is to use the expression num_threads together with parallel
directive.


OpenMP and other parallel programming technologies
At present, MPI interface (Message Passing Interface) is considered to be the most flexible, portable and
popular interface in parallel programming. But the Message Passing Interface:

    •   is not too efficient on SMP-systems;
    •   is relatively difficult to study because it demands thinking in "non-computing" terms.
POSIX-interface for threading (Pthreads) has a wide support (nearly on all UNIX-systems) but due to
many reasons it does not suite the practical parallel programming:

    •   Fortran is not supported;
    •   its level is too low;
    •   no support for data concurrency;
    •   the threading mechanism was originally developed not for the purposes of computing
        concurrency arrangement.

OpenMP can be viewed as a high-level superstructure over Pthreads (or other similar thread libraries).
Let us list the advantages OpenMP provides a developer with.

    1. Due to the idea of "incremental parallelization", OpenMP is ideal for the developers wishing to
       quickly parallelize their applications with large parallel loops. A developer does not create a new
       parallel program but simply adds OpenMP-directives into the text of a serial program.
    2. OpenMP is a very flexible mechanism providing the developer with great capabilities of
       controlling a parallel application's behavior.
    3. OpenMP-program is supposed to be used as a serial one on a single-processor platform, i.e. you
       do not need to support both the serial and parallel versions. OpenMP-directives are simply
       ignored by the serial compiler and to call the OpenMP-procedures you may place stubs whose
       texts are given in the specifications.
    4. One of OpenMP's advantages, as its developers point out, is support of the so called "orphan"
       directives, i.e. work synchronization and distribution directives do not necessarily need to be
       included directly into the lexical context of a parallel area.


OpenMP and toolkit
At present, OpenMP technology is supported by most C/C++ compilers. Yet, it is not so good with the
tools of testing parallel OpenMP programs. Although analysis tools and tools for testing and optimizing
parallel programs have existed for a long time, they were not too popular in the sphere of applied
software development until recently. That is why they are often less convenient than other
development tools.

The fullest support of parallel OpenMP-program development is provided by the package Intel Parallel
Studio. It includes a tool of preliminary code analysis for detecting code fragments that can be
potentially parallelized. There is a compiler with OpenMP support providing good optimization. There is
also a profiler and a dynamic analysis tool for detecting parallel errors.

Also, we should mention one more tool - VivaMP included into PVS-Studio. This is a static code analyzer
oriented on detecting errors in OpenMP programs at the stage of writing.


References
    1. OpenMP Architecture Review Board. http://www.openmp.org/
    2. Joel Yliluoma. Guide into OpenMP: Easy multithreading programming for C++.
       http://www.viva64.com/go.php?url=135
    3. Kang Su Gatlin and Pete Isensee. OpenMP and C++. http://www.viva64.com/go.php?url=113
    4. The collection of links referring to parallel programming and OpenMP technology.
       http://www.viva64.com/links/parallel-programming/

More Related Content

What's hot

CSO Laboratory Manual
CSO Laboratory ManualCSO Laboratory Manual
CSO Laboratory ManualDwight Sabio
 
Compiler interpreter and_bootstrapping
Compiler interpreter and_bootstrappingCompiler interpreter and_bootstrapping
Compiler interpreter and_bootstrappingsandeep manzhi
 
When to use python in FME
When to use python in FMEWhen to use python in FME
When to use python in FMEDaniela Perri
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compilerA. S. M. Shafi
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
rTest, a Testing Tool for FME Workspaces
rTest, a Testing Tool for FME WorkspacesrTest, a Testing Tool for FME Workspaces
rTest, a Testing Tool for FME WorkspacesSafe Software
 
Compiler.design.in.c.docs
Compiler.design.in.c.docsCompiler.design.in.c.docs
Compiler.design.in.c.docsAbid Syed
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system softwaregayathri ravi
 
Python vs MATLAB: Which one is the best language
Python vs MATLAB:  Which one is the best languagePython vs MATLAB:  Which one is the best language
Python vs MATLAB: Which one is the best languageStat Analytica
 
High Performance Erlang
High Performance ErlangHigh Performance Erlang
High Performance Erlangdidip
 
Compilation of c
Compilation of cCompilation of c
Compilation of cWay2itech
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design BasicsAkhil Kaushik
 
Language translator
Language translatorLanguage translator
Language translatorasmakh89
 
Py Con 2009 Pumping Iron Into Python
Py Con 2009   Pumping Iron Into PythonPy Con 2009   Pumping Iron Into Python
Py Con 2009 Pumping Iron Into PythonSarah Dutkiewicz
 

What's hot (20)

CSO Laboratory Manual
CSO Laboratory ManualCSO Laboratory Manual
CSO Laboratory Manual
 
Compilation v. interpretation
Compilation v. interpretationCompilation v. interpretation
Compilation v. interpretation
 
Language processor
Language processorLanguage processor
Language processor
 
Compiler interpreter and_bootstrapping
Compiler interpreter and_bootstrappingCompiler interpreter and_bootstrapping
Compiler interpreter and_bootstrapping
 
Compiler Design Quiz
Compiler Design QuizCompiler Design Quiz
Compiler Design Quiz
 
When to use python in FME
When to use python in FMEWhen to use python in FME
When to use python in FME
 
What is Compiler?
What is Compiler?What is Compiler?
What is Compiler?
 
Introduction to compiler
Introduction to compilerIntroduction to compiler
Introduction to compiler
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
rTest, a Testing Tool for FME Workspaces
rTest, a Testing Tool for FME WorkspacesrTest, a Testing Tool for FME Workspaces
rTest, a Testing Tool for FME Workspaces
 
Compiler.design.in.c.docs
Compiler.design.in.c.docsCompiler.design.in.c.docs
Compiler.design.in.c.docs
 
Debuggers in system software
Debuggers in system softwareDebuggers in system software
Debuggers in system software
 
Python vs MATLAB: Which one is the best language
Python vs MATLAB:  Which one is the best languagePython vs MATLAB:  Which one is the best language
Python vs MATLAB: Which one is the best language
 
High Performance Erlang
High Performance ErlangHigh Performance Erlang
High Performance Erlang
 
Compilation of c
Compilation of cCompilation of c
Compilation of c
 
Compiler design
Compiler designCompiler design
Compiler design
 
Compiler Design Basics
Compiler Design BasicsCompiler Design Basics
Compiler Design Basics
 
Language translator
Language translatorLanguage translator
Language translator
 
Py Con 2009 Pumping Iron Into Python
Py Con 2009   Pumping Iron Into PythonPy Con 2009   Pumping Iron Into Python
Py Con 2009 Pumping Iron Into Python
 
Ch1
Ch1Ch1
Ch1
 

Similar to OpenMP

Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mpranjit banshpal
 
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPAlgoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPPier Luca Lanzi
 
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP IJCSEIT Journal
 
Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2Marcirio Chaves
 
VivaMP - a tool for OpenMP
VivaMP - a tool for OpenMPVivaMP - a tool for OpenMP
VivaMP - a tool for OpenMPPVS-Studio
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptxSimRelokasi2
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operationmary_ramsay
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHBhavsingh Maloth
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxAliyahAli19
 
Python for MATLAB Programmers
Python for MATLAB ProgrammersPython for MATLAB Programmers
Python for MATLAB ProgrammersMichael Patterson
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptxAshenafiGirma5
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introductionmengistu23
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxZiyadMohammed17
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systemsdairsie
 
What is [Open] MPI?
What is [Open] MPI?What is [Open] MPI?
What is [Open] MPI?Jeff Squyres
 

Similar to OpenMP (20)

Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mp
 
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMPAlgoritmi e Calcolo Parallelo 2012/2013 - OpenMP
Algoritmi e Calcolo Parallelo 2012/2013 - OpenMP
 
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
Performance Analysis of Parallel Algorithms on Multi-core System using OpenMP
 
openmp
openmpopenmp
openmp
 
Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2Tutorial on Parallel Computing and Message Passing Model - C2
Tutorial on Parallel Computing and Message Passing Model - C2
 
VivaMP - a tool for OpenMP
VivaMP - a tool for OpenMPVivaMP - a tool for OpenMP
VivaMP - a tool for OpenMP
 
OpenMp
OpenMpOpenMp
OpenMp
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx
 
Programming language
Programming languageProgramming language
Programming language
 
The role of the cpu in the operation
The role of the cpu in the operationThe role of the cpu in the operation
The role of the cpu in the operation
 
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT V BY BHAVSINGH MALOTH
 
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptxPCSG_Computer_Science_Unit_1_Lecture_2.pptx
PCSG_Computer_Science_Unit_1_Lecture_2.pptx
 
Csharp tp
Csharp tpCsharp tp
Csharp tp
 
Parallel Lint
Parallel LintParallel Lint
Parallel Lint
 
Python for MATLAB Programmers
Python for MATLAB ProgrammersPython for MATLAB Programmers
Python for MATLAB Programmers
 
4_5802928814682016556.pptx
4_5802928814682016556.pptx4_5802928814682016556.pptx
4_5802928814682016556.pptx
 
Cd ch1 - introduction
Cd   ch1 - introductionCd   ch1 - introduction
Cd ch1 - introduction
 
CD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptxCD - CH1 - Introduction to compiler design.pptx
CD - CH1 - Introduction to compiler design.pptx
 
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated SystemsPetapath HP Cast 12 - Programming for High Performance Accelerated Systems
Petapath HP Cast 12 - Programming for High Performance Accelerated Systems
 
What is [Open] MPI?
What is [Open] MPI?What is [Open] MPI?
What is [Open] MPI?
 

Recently uploaded

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 

Recently uploaded (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

OpenMP

  • 1. OpenMP Author: Andrey Karpov Date: 20.11.2009 Abstract The article briefly describes the OpenMP technology. OpenMP OpenMP (Open Multi-Processing) is a set of compiler directives, library procedures and environment variables intended for programming multi-threaded applications on multi-processor systems with shared memory (SMP-systems). The first OpenMP standard was developed in 1997 as an API oriented on writing easy portable multi- threaded applications. At first, it was based on Fortran language but then included C and C++ as well. OpenMP interface became one of the most popular parallel programming technologies. OpenMP is successfully exploited both in programming of supercomputer systems with many processors and in desktop user systems or, for example, Xbox 360. OpenMP specification is developed by several large computer and software vendors whose activity is regulated by the non-profit organization "OpenMP Architecture Review Board" (ARB) [1]. OpenMP exploits the parallel execution model called "branching-merging". OpenMP program begins as a single execution thread called the initial thread. When the thread meets a parallel construction, it creates a new group of threads consisting of the initial thread itself and some other threads and becomes the main thread in the group. All the members of the new group (including the main thread) execute the code inside the parallel construction. At the end of the parallel construction, there is an implicit barrier. After the parallel construction is processed, the further execution of the user code is performed only by the main thread. A parallel area may include other parallel areas where each thread of the initial area becomes the main thread of its thread group. The embedded areas may also include areas of a deeper nesting level. The number of threads in a group performed concurrently can be controlled by several methods. One of them is using the environment variable OMP_NUM_THREADS. Another method is to call the procedure omp_set_num_threads(). One more way is to use the expression num_threads together with parallel directive. OpenMP and other parallel programming technologies At present, MPI interface (Message Passing Interface) is considered to be the most flexible, portable and popular interface in parallel programming. But the Message Passing Interface: • is not too efficient on SMP-systems; • is relatively difficult to study because it demands thinking in "non-computing" terms.
  • 2. POSIX-interface for threading (Pthreads) has a wide support (nearly on all UNIX-systems) but due to many reasons it does not suite the practical parallel programming: • Fortran is not supported; • its level is too low; • no support for data concurrency; • the threading mechanism was originally developed not for the purposes of computing concurrency arrangement. OpenMP can be viewed as a high-level superstructure over Pthreads (or other similar thread libraries). Let us list the advantages OpenMP provides a developer with. 1. Due to the idea of "incremental parallelization", OpenMP is ideal for the developers wishing to quickly parallelize their applications with large parallel loops. A developer does not create a new parallel program but simply adds OpenMP-directives into the text of a serial program. 2. OpenMP is a very flexible mechanism providing the developer with great capabilities of controlling a parallel application's behavior. 3. OpenMP-program is supposed to be used as a serial one on a single-processor platform, i.e. you do not need to support both the serial and parallel versions. OpenMP-directives are simply ignored by the serial compiler and to call the OpenMP-procedures you may place stubs whose texts are given in the specifications. 4. One of OpenMP's advantages, as its developers point out, is support of the so called "orphan" directives, i.e. work synchronization and distribution directives do not necessarily need to be included directly into the lexical context of a parallel area. OpenMP and toolkit At present, OpenMP technology is supported by most C/C++ compilers. Yet, it is not so good with the tools of testing parallel OpenMP programs. Although analysis tools and tools for testing and optimizing parallel programs have existed for a long time, they were not too popular in the sphere of applied software development until recently. That is why they are often less convenient than other development tools. The fullest support of parallel OpenMP-program development is provided by the package Intel Parallel Studio. It includes a tool of preliminary code analysis for detecting code fragments that can be potentially parallelized. There is a compiler with OpenMP support providing good optimization. There is also a profiler and a dynamic analysis tool for detecting parallel errors. Also, we should mention one more tool - VivaMP included into PVS-Studio. This is a static code analyzer oriented on detecting errors in OpenMP programs at the stage of writing. References 1. OpenMP Architecture Review Board. http://www.openmp.org/ 2. Joel Yliluoma. Guide into OpenMP: Easy multithreading programming for C++. http://www.viva64.com/go.php?url=135 3. Kang Su Gatlin and Pete Isensee. OpenMP and C++. http://www.viva64.com/go.php?url=113 4. The collection of links referring to parallel programming and OpenMP technology. http://www.viva64.com/links/parallel-programming/