SlideShare a Scribd company logo
“Parallelization Using OpenMP

Pro. Ranjit R. Banshpal
Contents
•Abstract
•Introduction
•Literature survey
•Why Parallelization?
•What Is Parallelization?
•Parallel Programming Model
•Achieving Parallelism In Shared Memory Model Using
OpenMP
•What is Message Passing?
•OpenMP Vs MPI
•Pros & Cons Of OpenMP
•Pros & Cons Of MPI
•Conclusion
•References
2
Abstract
• A more powerful machine leads to new kinds of applications, which in
turn fuel our demand for yet more powerful systems.
• Hardware engineers are striving harder to get the attainable performance,
however find limit after a certain point.

• This has given birth to what we call software parallelism.
• There are different types of tools such as OpenMP and MPI, which can be
used to model software program to work faster by parallelism.

3
Introduction
 Programming languages evolve just as natural languages do.
 In the early days of computing, programs were serial.
 It ran from start to finish on a single processor.

 Parallel programming developed as a means of improving performance
and efficiency.
 The instructions from each part run simultaneously on different CPUs.

4
Literature Survey
Serial No.

Name Of Authors

Name of Paper

Discussion

1.

T.G. Mattson, B.A. Sanders,
and B. Massingill

Patterns for Parallel
Programming

Classification of
parallel programming
models

2.

D.R. Butenhof

Programming with
POSIX Threads

Portable operating
system interface
Thread
programming model

3.

B. Chapman, G. Jost, and R.
van der Pas

Using, OpenMP:
Shared Memory
Portable
Model
Shared Memory
Parallel Programming

4.

P.S. Pacheco

Parallel Programming Message Passing
with MPI
Model
5
Parallel Computer Memory Architectures
 Shared Memory Architecture

• UMA

6
Parallel computer memory
architectures
 Shared Memory Architecture
• NUMA

 Distributed Memory Architecture

7
Parallel computer memory
architectures
 Hybrid Memory Architecture

8
Why Parallelization?
Carefully optimizing the serial version of code could lead to significant
performance gains.
Nevertheless, there will always be some codes which demand “too many”
resources in terms of CPU time or memory.
Parallelization is optimization technique. The goal is to reduce the execution
time.

9
What Is Parallelization?
Something is parallel if there is certain level of independence in the order
of operations.
In other words, it doesn’t matter in what order the operations are performed.

10
Parallel Programming Models
 Parallel programming models exist as an abstraction above hardware and
memory architectures.
 These models are not specific to a particular type of machine or memory
architecture.
 There are several parallel programming models in common use:
• Shared Memory Model
• Thread Model
• Message Passing Model

11
Shared Memory Model
 Tasks share a common address space, which they read and write
asynchronously.

 Task oriented and works at higher level of abstraction than the threads.
 Advantage:
There is no need to specify explicitly the communication of
data between tasks. Program development can often be simplified.
 Disadvantage:
In terms of performance, it becomes more difficult to
understand and manage data locality.
12
Thread Model
A single process can have multiple, concurrent execution paths.

Each thread has local data, but also shares the entire resources of program.
A thread's work may best be described as a subroutine within the main
program.
Threads communicate with each other through global memory (updating
address locations).

Threads are commonly associated with shared memory architectures and
operating systems.

13
Message Passing Model
A set of tasks that use their own local memory during computation.
 Multiple tasks can reside on the same physical machine and/or across
an arbitrary number of machines.

Tasks exchange data through communications by sending and receiving
messages.
Data transfer usually requires cooperative operations to be performed
by each process.

14
Achieving Parallelism in Shared Memory
Model Using OpenMP

15
What Is OpenMP?
 Open specifications for Multi Processing.
 “Standard” API for defining multi-threaded shared-memory programs.
 OpenMP is not a “language”.
 OpenMP consists of three main parts:

16
Why OpenMP Is Popular?
 No message passing .
 OpenMP directives or library calls may be incorporated incrementally.
 The code is in effect a serial code.
 Code size increase is generally smaller.
 OpenMP-enabled codes tend to be more readable .

17
The Basic Idea
• The code starts with one master thread.
• When a parallel tasks needs to be performed, additional threads are
created.
• When the parallel tasks are finished, the additional threads are released.

JOIN

FORK

JOIN

Master thread

FORK

OpenMP Execution Model

Paralle
Parallel
l
Region
Region

18
What is Message Passing ?
 A computational model in which, processes are able to communicate
with other processes by sending and receiving messages.

 Distributed Memory Systems.
• Networks of Workstations (clusters)
• Massively parallel machines
 Shared Memory Systems.
• Supercomputer Setting
 MPI is a library specification for message-passing.
 Use for Distributed Memory Systems.
19
OpenMP Vs MPI
OpenMP

MPI

1. Works on shared memory systems.

1. Works on both shared memory and
distributed memory systems .

2. Has better performance on SMP systems,
than MPI.

2. Has poor performance on SMP systems.

3. Directive based.

3. Message passing style

4. Easier to program and debug.

4. More flexible and scalable

20
Pros & Cons of OpenMP
• Pros
– Easy to Instrument (and check)
– Parallelism can be implemented incrementally
– Allows for coarse-grained or fine-grained parallelism
– Widely available, portable
• Cons
– Not as scalable as MPI
– Available on Shared memory systems only

21
Pros & Cons of MPI
• Pros :
– runs on either shared or distributed memory architectures
– can be used on a wider range of problems than OpenMP
– each process has its own local variables
• Cons :
– requires more programming changes to go from serial to
parallel version
– can be harder to debug
– performance is limited by the communication network
between the nodes
22
Conclusion
 OpenMP is better option for parallelization in shared memory.
 OpenMP is a compiler-based technique to create concurrent code from
(mostly) serial code.
 OpenMP can enable (easy) parallelization of loop-based code.
 OpenMP performs comparably to manually-coded threading
• Scalable
• Portable

23
References
[1]. Javier Diaz, Camelia Mun˜oz-Caro, and Alfonso Nin˜o, “A Survey of Parallel Programming
Models and Tools in the Multi and Many-Core Era”, IEEE transactions on parallel and
distributed systems, vol. 23, no. 8, august 2012.
[2]. D. S. Henty, “Performance of Hybrid Message-Passing and Shared-Memory Parallelism for
Discrete Element Modeling”, Proceedings of the IEEE/ACM SC2000 Conference (SC’00),
2000.
[3]. David Clark, “OpenMP: a parallel standard for the masses”, IEEE Concurrency, January–March
1998.
[4]. Joe Throop, Kuck & Associates Inc., “OpenMP: Shared-Memory Parallelism From the Ashes”,
IEEE Standards, May 1999.
[5]. Leonardo Dagum and Ramesh Menon“OpenMP: An Industry Standard API for Shared-Memory
Programming”, IEEE computationascli ence & engineering, May 1998.
[6]. J. B. Dennis and E. C. Van Horn, “Programming semantics for multiprogrammed computations”,
Comm. ACM, 9(3):143–155, 1966.

[7]. MPI Forum, “MPI: A Message Passing Interface”, Int. Journal of Supercomputing Applications,
8(3/4), 1994.
24
References
[8]. Barbara Chapman, Gabriele Jost, Ruud van der Pas, “Using OpenMP”, The MIT Press.
Cambridge, Massachusetts ,London, England, 2008.
[9]. William Gropp, “Tutorial on MPI: The Message Passing Interface”, Mathematics and Computer
Science Division, Argonne National Laboratory, Argonne, IL 60439, January–March 1999.
[10]. Ewing Lusk and Anthony Chan., “Early Experiments with the OpenMP/MPI Hybrid
Programming Model”, Mathematics and Computer Science Division Argonne National
Laboratory, ASCI FLASH Center, University of Chicago, 2008.
[11]. Dieter an Mey, Thomas Reichstein Parallelization with OpenMP and MPI, A Simple Example
(C)”, October 26, 2007.
[12]. Wahid Nasri and Karim Fathallah, “A Performance model for OpenMP programs on multicore machines.” IEEE 2013
[13]. MPI Forum. “Hybrid MPI/OpenMP Optimization in Linpack Benchmark on Multi-core
Platforms”, The 8th International Conference on Computer Science & Education (ICCSE
2013),IEEE 2013

25
26

More Related Content

What's hot

Cache coherence problem and its solutions
Cache coherence problem and its solutionsCache coherence problem and its solutions
Cache coherence problem and its solutions
Majid Saleem
 
Von neumann Architecture | Computer Science
Von neumann Architecture | Computer ScienceVon neumann Architecture | Computer Science
Von neumann Architecture | Computer Science
Transweb Global Inc
 
Parallel programming model
Parallel programming modelParallel programming model
Parallel programming model
easy notes
 
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
sumithragunasekaran
 
Concurrency
ConcurrencyConcurrency
Concurrency
rizwanaabassi
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
Syed Zaid Irshad
 
hardwired control unit ppt
hardwired control unit ppthardwired control unit ppt
hardwired control unit ppt
SushmithaAcharya7
 
Parallel processing
Parallel processingParallel processing
Parallel processing
rajshreemuthiah
 
Course outline of parallel and distributed computing
Course outline of parallel and distributed computingCourse outline of parallel and distributed computing
Course outline of parallel and distributed computing
National College of Business Administration & Economics ( NCBA&E)
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Universal turing coastus
Universal turing coastusUniversal turing coastus
Universal turing coastus
Shiraz316
 
Memory consistency models and basics
Memory consistency models and basicsMemory consistency models and basics
Memory consistency models and basics
Ramdas Mozhikunnath
 
Code Generation
Code GenerationCode Generation
Code Generation
PrabuPappuR
 
Peephole optimization techniques
Peephole optimization techniquesPeephole optimization techniques
Peephole optimization techniques
garishma bhatia
 
Memory Management & Garbage Collection
Memory Management & Garbage CollectionMemory Management & Garbage Collection
Memory Management & Garbage Collection
Abhishek Sur
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
Prof. Dr. K. Adisesha
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani1
 
Storage management
Storage managementStorage management
Storage management
Atul Sharma
 
Parallel computing
Parallel computingParallel computing
Parallel computing
Vinay Gupta
 
Unix files
Unix filesUnix files
Unix files
Sunil Rm
 

What's hot (20)

Cache coherence problem and its solutions
Cache coherence problem and its solutionsCache coherence problem and its solutions
Cache coherence problem and its solutions
 
Von neumann Architecture | Computer Science
Von neumann Architecture | Computer ScienceVon neumann Architecture | Computer Science
Von neumann Architecture | Computer Science
 
Parallel programming model
Parallel programming modelParallel programming model
Parallel programming model
 
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
Terminologies Used In Big data Environments,G.Sumithra,II-M.sc(computer scien...
 
Concurrency
ConcurrencyConcurrency
Concurrency
 
Limitations of memory system performance
Limitations of memory system performanceLimitations of memory system performance
Limitations of memory system performance
 
hardwired control unit ppt
hardwired control unit ppthardwired control unit ppt
hardwired control unit ppt
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Course outline of parallel and distributed computing
Course outline of parallel and distributed computingCourse outline of parallel and distributed computing
Course outline of parallel and distributed computing
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Universal turing coastus
Universal turing coastusUniversal turing coastus
Universal turing coastus
 
Memory consistency models and basics
Memory consistency models and basicsMemory consistency models and basics
Memory consistency models and basics
 
Code Generation
Code GenerationCode Generation
Code Generation
 
Peephole optimization techniques
Peephole optimization techniquesPeephole optimization techniques
Peephole optimization techniques
 
Memory Management & Garbage Collection
Memory Management & Garbage CollectionMemory Management & Garbage Collection
Memory Management & Garbage Collection
 
Object oriented concepts ppt
Object oriented concepts pptObject oriented concepts ppt
Object oriented concepts ppt
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Storage management
Storage managementStorage management
Storage management
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 
Unix files
Unix filesUnix files
Unix files
 

Similar to Parallelization using open mp

parallel programming models
 parallel programming models parallel programming models
parallel programming models
Swetha S
 
Unit5
Unit5Unit5
Unit5
Sneha Soni
 
OpenMp
OpenMpOpenMp
OpenMp
Neel Bhad
 
OpenMP
OpenMPOpenMP
OpenMP
PVS-Studio
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
Anil Bohare
 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONS
ijdpsjournal
 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collections
ijdpsjournal
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx
SimRelokasi2
 
01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt
HarshitPal37
 
Parallel programming model, language and compiler in ACA.
Parallel programming model, language and compiler in ACA.Parallel programming model, language and compiler in ACA.
Parallel programming model, language and compiler in ACA.
MITS Gwalior
 
Aq4301224227
Aq4301224227Aq4301224227
Aq4301224227
IJERA Editor
 
Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computing
Vajira Thambawita
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Sachintha Gunasena
 
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
aminnezarat
 
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
Ritu Arora
 
Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!
A Jorge Garcia
 
openmp final2.pptx
openmp final2.pptxopenmp final2.pptx
openmp final2.pptx
GopalPatidar13
 
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
ijceronline
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
Sou Jana
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
Janani S
 

Similar to Parallelization using open mp (20)

parallel programming models
 parallel programming models parallel programming models
parallel programming models
 
Unit5
Unit5Unit5
Unit5
 
OpenMp
OpenMpOpenMp
OpenMp
 
OpenMP
OpenMPOpenMP
OpenMP
 
Parallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMPParallelization of Coupled Cluster Code with OpenMP
Parallelization of Coupled Cluster Code with OpenMP
 
LOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONSLOCK-FREE PARALLEL ACCESS COLLECTIONS
LOCK-FREE PARALLEL ACCESS COLLECTIONS
 
Lock free parallel access collections
Lock free parallel access collectionsLock free parallel access collections
Lock free parallel access collections
 
6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx6-9-2017-slides-vFinal.pptx
6-9-2017-slides-vFinal.pptx
 
01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt
 
Parallel programming model, language and compiler in ACA.
Parallel programming model, language and compiler in ACA.Parallel programming model, language and compiler in ACA.
Parallel programming model, language and compiler in ACA.
 
Aq4301224227
Aq4301224227Aq4301224227
Aq4301224227
 
Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computing
 
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency ProgrammingConcurrency Programming in Java - 01 - Introduction to Concurrency Programming
Concurrency Programming in Java - 01 - Introduction to Concurrency Programming
 
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
01 introduction fundamentals_of_parallelism_and_code_optimization-www.astek.ir
 
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
PEARC17: Interactive Code Adaptation Tool for Modernizing Applications for In...
 
Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!
 
openmp final2.pptx
openmp final2.pptxopenmp final2.pptx
openmp final2.pptx
 
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
 
Multicore and shared multi processor
Multicore and shared multi processorMulticore and shared multi processor
Multicore and shared multi processor
 

More from ranjit banshpal

Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
ranjit banshpal
 
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHESSECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
ranjit banshpal
 
Secure Image Retrieval based on Hybrid Features and Hashes
Secure Image Retrieval based on Hybrid Features and HashesSecure Image Retrieval based on Hybrid Features and Hashes
Secure Image Retrieval based on Hybrid Features and Hashes
ranjit banshpal
 
LCT in day2 day life
LCT in day2 day lifeLCT in day2 day life
LCT in day2 day life
ranjit banshpal
 
Fingerprint recognition
Fingerprint recognitionFingerprint recognition
Fingerprint recognition
ranjit banshpal
 
“Web crawler”
“Web crawler”“Web crawler”
“Web crawler”
ranjit banshpal
 
Data mining technique for classification and feature evaluation using stream ...
Data mining technique for classification and feature evaluation using stream ...Data mining technique for classification and feature evaluation using stream ...
Data mining technique for classification and feature evaluation using stream ...
ranjit banshpal
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
ranjit banshpal
 
using big-data methods analyse the Cross platform aviation
 using big-data methods analyse the Cross platform aviation using big-data methods analyse the Cross platform aviation
using big-data methods analyse the Cross platform aviation
ranjit banshpal
 
E mail image spam filtering techniques
E mail image spam filtering techniquesE mail image spam filtering techniques
E mail image spam filtering techniques
ranjit banshpal
 
Hybrid encryption
Hybrid encryption Hybrid encryption
Hybrid encryption
ranjit banshpal
 
Autocorrelators1
Autocorrelators1Autocorrelators1
Autocorrelators1
ranjit banshpal
 
Static Networks
Static NetworksStatic Networks
Static Networks
ranjit banshpal
 
Ranjitbanshpal
RanjitbanshpalRanjitbanshpal
Ranjitbanshpal
ranjit banshpal
 
Ranjitbanshpal1
Ranjitbanshpal1Ranjitbanshpal1
Ranjitbanshpal1
ranjit banshpal
 

More from ranjit banshpal (15)

Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
Designing Hybrid Cryptosystem for Secure Transmission of Image Data using Bio...
 
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHESSECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
SECURE IMAGE RETRIEVAL BASED ON HYBRID FEATURES AND HASHES
 
Secure Image Retrieval based on Hybrid Features and Hashes
Secure Image Retrieval based on Hybrid Features and HashesSecure Image Retrieval based on Hybrid Features and Hashes
Secure Image Retrieval based on Hybrid Features and Hashes
 
LCT in day2 day life
LCT in day2 day lifeLCT in day2 day life
LCT in day2 day life
 
Fingerprint recognition
Fingerprint recognitionFingerprint recognition
Fingerprint recognition
 
“Web crawler”
“Web crawler”“Web crawler”
“Web crawler”
 
Data mining technique for classification and feature evaluation using stream ...
Data mining technique for classification and feature evaluation using stream ...Data mining technique for classification and feature evaluation using stream ...
Data mining technique for classification and feature evaluation using stream ...
 
Face recognition technology
Face recognition technologyFace recognition technology
Face recognition technology
 
using big-data methods analyse the Cross platform aviation
 using big-data methods analyse the Cross platform aviation using big-data methods analyse the Cross platform aviation
using big-data methods analyse the Cross platform aviation
 
E mail image spam filtering techniques
E mail image spam filtering techniquesE mail image spam filtering techniques
E mail image spam filtering techniques
 
Hybrid encryption
Hybrid encryption Hybrid encryption
Hybrid encryption
 
Autocorrelators1
Autocorrelators1Autocorrelators1
Autocorrelators1
 
Static Networks
Static NetworksStatic Networks
Static Networks
 
Ranjitbanshpal
RanjitbanshpalRanjitbanshpal
Ranjitbanshpal
 
Ranjitbanshpal1
Ranjitbanshpal1Ranjitbanshpal1
Ranjitbanshpal1
 

Recently uploaded

Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Leena Ghag-Sakpal
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
Celine George
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
TechSoup
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
dot55audits
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
ssuser13ffe4
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
haiqairshad
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
MysoreMuleSoftMeetup
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
BoudhayanBhattachari
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 

Recently uploaded (20)

Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
Bed Making ( Introduction, Purpose, Types, Articles, Scientific principles, N...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
How to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 InventoryHow to Setup Warehouse & Location in Odoo 17 Inventory
How to Setup Warehouse & Location in Odoo 17 Inventory
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Leveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit InnovationLeveraging Generative AI to Drive Nonprofit Innovation
Leveraging Generative AI to Drive Nonprofit Innovation
 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
ZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptxZK on Polkadot zero knowledge proofs - sub0.pptx
ZK on Polkadot zero knowledge proofs - sub0.pptx
 
math operations ued in python and all used
math operations ued in python and all usedmath operations ued in python and all used
math operations ued in python and all used
 
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skillsspot a liar (Haiqa 146).pptx Technical writhing and presentation skills
spot a liar (Haiqa 146).pptx Technical writhing and presentation skills
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47Mule event processing models | MuleSoft Mysore Meetup #47
Mule event processing models | MuleSoft Mysore Meetup #47
 
B. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdfB. Ed Syllabus for babasaheb ambedkar education university.pdf
B. Ed Syllabus for babasaheb ambedkar education university.pdf
 
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 

Parallelization using open mp

  • 2. Contents •Abstract •Introduction •Literature survey •Why Parallelization? •What Is Parallelization? •Parallel Programming Model •Achieving Parallelism In Shared Memory Model Using OpenMP •What is Message Passing? •OpenMP Vs MPI •Pros & Cons Of OpenMP •Pros & Cons Of MPI •Conclusion •References 2
  • 3. Abstract • A more powerful machine leads to new kinds of applications, which in turn fuel our demand for yet more powerful systems. • Hardware engineers are striving harder to get the attainable performance, however find limit after a certain point. • This has given birth to what we call software parallelism. • There are different types of tools such as OpenMP and MPI, which can be used to model software program to work faster by parallelism. 3
  • 4. Introduction  Programming languages evolve just as natural languages do.  In the early days of computing, programs were serial.  It ran from start to finish on a single processor.  Parallel programming developed as a means of improving performance and efficiency.  The instructions from each part run simultaneously on different CPUs. 4
  • 5. Literature Survey Serial No. Name Of Authors Name of Paper Discussion 1. T.G. Mattson, B.A. Sanders, and B. Massingill Patterns for Parallel Programming Classification of parallel programming models 2. D.R. Butenhof Programming with POSIX Threads Portable operating system interface Thread programming model 3. B. Chapman, G. Jost, and R. van der Pas Using, OpenMP: Shared Memory Portable Model Shared Memory Parallel Programming 4. P.S. Pacheco Parallel Programming Message Passing with MPI Model 5
  • 6. Parallel Computer Memory Architectures  Shared Memory Architecture • UMA 6
  • 7. Parallel computer memory architectures  Shared Memory Architecture • NUMA  Distributed Memory Architecture 7
  • 8. Parallel computer memory architectures  Hybrid Memory Architecture 8
  • 9. Why Parallelization? Carefully optimizing the serial version of code could lead to significant performance gains. Nevertheless, there will always be some codes which demand “too many” resources in terms of CPU time or memory. Parallelization is optimization technique. The goal is to reduce the execution time. 9
  • 10. What Is Parallelization? Something is parallel if there is certain level of independence in the order of operations. In other words, it doesn’t matter in what order the operations are performed. 10
  • 11. Parallel Programming Models  Parallel programming models exist as an abstraction above hardware and memory architectures.  These models are not specific to a particular type of machine or memory architecture.  There are several parallel programming models in common use: • Shared Memory Model • Thread Model • Message Passing Model 11
  • 12. Shared Memory Model  Tasks share a common address space, which they read and write asynchronously.  Task oriented and works at higher level of abstraction than the threads.  Advantage: There is no need to specify explicitly the communication of data between tasks. Program development can often be simplified.  Disadvantage: In terms of performance, it becomes more difficult to understand and manage data locality. 12
  • 13. Thread Model A single process can have multiple, concurrent execution paths. Each thread has local data, but also shares the entire resources of program. A thread's work may best be described as a subroutine within the main program. Threads communicate with each other through global memory (updating address locations). Threads are commonly associated with shared memory architectures and operating systems. 13
  • 14. Message Passing Model A set of tasks that use their own local memory during computation.  Multiple tasks can reside on the same physical machine and/or across an arbitrary number of machines. Tasks exchange data through communications by sending and receiving messages. Data transfer usually requires cooperative operations to be performed by each process. 14
  • 15. Achieving Parallelism in Shared Memory Model Using OpenMP 15
  • 16. What Is OpenMP?  Open specifications for Multi Processing.  “Standard” API for defining multi-threaded shared-memory programs.  OpenMP is not a “language”.  OpenMP consists of three main parts: 16
  • 17. Why OpenMP Is Popular?  No message passing .  OpenMP directives or library calls may be incorporated incrementally.  The code is in effect a serial code.  Code size increase is generally smaller.  OpenMP-enabled codes tend to be more readable . 17
  • 18. The Basic Idea • The code starts with one master thread. • When a parallel tasks needs to be performed, additional threads are created. • When the parallel tasks are finished, the additional threads are released. JOIN FORK JOIN Master thread FORK OpenMP Execution Model Paralle Parallel l Region Region 18
  • 19. What is Message Passing ?  A computational model in which, processes are able to communicate with other processes by sending and receiving messages.  Distributed Memory Systems. • Networks of Workstations (clusters) • Massively parallel machines  Shared Memory Systems. • Supercomputer Setting  MPI is a library specification for message-passing.  Use for Distributed Memory Systems. 19
  • 20. OpenMP Vs MPI OpenMP MPI 1. Works on shared memory systems. 1. Works on both shared memory and distributed memory systems . 2. Has better performance on SMP systems, than MPI. 2. Has poor performance on SMP systems. 3. Directive based. 3. Message passing style 4. Easier to program and debug. 4. More flexible and scalable 20
  • 21. Pros & Cons of OpenMP • Pros – Easy to Instrument (and check) – Parallelism can be implemented incrementally – Allows for coarse-grained or fine-grained parallelism – Widely available, portable • Cons – Not as scalable as MPI – Available on Shared memory systems only 21
  • 22. Pros & Cons of MPI • Pros : – runs on either shared or distributed memory architectures – can be used on a wider range of problems than OpenMP – each process has its own local variables • Cons : – requires more programming changes to go from serial to parallel version – can be harder to debug – performance is limited by the communication network between the nodes 22
  • 23. Conclusion  OpenMP is better option for parallelization in shared memory.  OpenMP is a compiler-based technique to create concurrent code from (mostly) serial code.  OpenMP can enable (easy) parallelization of loop-based code.  OpenMP performs comparably to manually-coded threading • Scalable • Portable 23
  • 24. References [1]. Javier Diaz, Camelia Mun˜oz-Caro, and Alfonso Nin˜o, “A Survey of Parallel Programming Models and Tools in the Multi and Many-Core Era”, IEEE transactions on parallel and distributed systems, vol. 23, no. 8, august 2012. [2]. D. S. Henty, “Performance of Hybrid Message-Passing and Shared-Memory Parallelism for Discrete Element Modeling”, Proceedings of the IEEE/ACM SC2000 Conference (SC’00), 2000. [3]. David Clark, “OpenMP: a parallel standard for the masses”, IEEE Concurrency, January–March 1998. [4]. Joe Throop, Kuck & Associates Inc., “OpenMP: Shared-Memory Parallelism From the Ashes”, IEEE Standards, May 1999. [5]. Leonardo Dagum and Ramesh Menon“OpenMP: An Industry Standard API for Shared-Memory Programming”, IEEE computationascli ence & engineering, May 1998. [6]. J. B. Dennis and E. C. Van Horn, “Programming semantics for multiprogrammed computations”, Comm. ACM, 9(3):143–155, 1966. [7]. MPI Forum, “MPI: A Message Passing Interface”, Int. Journal of Supercomputing Applications, 8(3/4), 1994. 24
  • 25. References [8]. Barbara Chapman, Gabriele Jost, Ruud van der Pas, “Using OpenMP”, The MIT Press. Cambridge, Massachusetts ,London, England, 2008. [9]. William Gropp, “Tutorial on MPI: The Message Passing Interface”, Mathematics and Computer Science Division, Argonne National Laboratory, Argonne, IL 60439, January–March 1999. [10]. Ewing Lusk and Anthony Chan., “Early Experiments with the OpenMP/MPI Hybrid Programming Model”, Mathematics and Computer Science Division Argonne National Laboratory, ASCI FLASH Center, University of Chicago, 2008. [11]. Dieter an Mey, Thomas Reichstein Parallelization with OpenMP and MPI, A Simple Example (C)”, October 26, 2007. [12]. Wahid Nasri and Karim Fathallah, “A Performance model for OpenMP programs on multicore machines.” IEEE 2013 [13]. MPI Forum. “Hybrid MPI/OpenMP Optimization in Linpack Benchmark on Multi-core Platforms”, The 8th International Conference on Computer Science & Education (ICCSE 2013),IEEE 2013 25
  • 26. 26