SlideShare a Scribd company logo
1 of 22
OpenMP
Presented by :
Mohammad Radpour
Amirali Sharifian
Farbod Nosrat Nezami
Introduction
• What is parallel processing ?
It is ability of processing more than one job simultaneously.
• Why going parallel ?
• Great deal of data to be processed
• Time needed to calculate an engineering equation
• Need jobs to be done faster
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
2
Technologies
• What technologies used for parallel processing ?
• Network based parallel processing
• Utilizing CPU free time and power
• Fact is most of CPU time and power is wasting
• Tearing down jobs and run them on resources
• Local parallelism on multicore/multiprocessor systems
• Utilize the concept of multithreading
• Utilize the concept of share memory
• Can be run on either GPU or CPU
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
3
Tools and Technics
• What tools used for parallel processing ?
• Network based parallel processing
• Gird based parallel computing
• Cloud based parallelism and Cloud computing
• Local parallelism on multicore/multiprocessor systems
• NVidia® CUDA™
• MPI
• Posix Threads
• OpenMP
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
4
What is OpenMP
• OpenMP
• In simple word runs a user program in parallel.
• It utilize to main concepts for parallelism
• Multithreading
• Shared Memory
• It takes user application, tear it down into group of threads and
runs them on a shared memory foundation
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
5
Why using OpenMP
• It is simple to use it
• Most of the times there is no need to change program code
• It utilize compiler directives to demonstrate parallel region
• It is cross platform
• It supports by Fortran and C / C++
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
6
Programming Model
• Shared Memory
• Parallelism by threading
• Fork-Join model
• Explicit Parallelism
• Nested Parallelism
• Dynamic Threads
• Input / Output
• Memory model
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
7
Shared Memory
• What is shared memory ?
• Why using shared memory?
• Shared Memory in OpenMP
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
8
Shared Memory (Cont.)
• Following system can be used for shared memory access
• a single core chip (older PC’s, sequential execution)
• a multicore chip (such as your laptop?)
• multiple single core chips in a NUMA system
• multiple multicore chips in a NUMA system (VT SGI system)
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
9
UMA Vs. NUMA
• Unified Memory Access ( UMA )
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
10
UMA Vs. NUMA (Cont.)
• Non Unified Memory Access ( NUMA )
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
11
Multi Threading
• What is Multi Threading
• What is Intel Hyper-Threading
• Why using Multi Threading
• Multi Threading in OpenMP
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
12
Fork – Join Model
• What is Fork
• What is Join
• How Multi Threading works in OpenMP
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
13
Fork – Join Model (Cont.)
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
14
F
J
Master
Thread
Thread
OpenMP Elements
• Compiler Directives
• Runtime Libraries
• Environmental Variables
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
15
How to use OpenMP
• OpenMP implemented for C/C++ and Fortran
• In C/C++ we use compiler directives
• We only need to specify the parallel region
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
16
How to use OpenMP
• In non Microsoft compiler:
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
17
How to use OpenMP (Cont.)
• In Visual Studio :
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
18
Real Experiment
void main()
{
omp_set_num_threads(6);
LARGE_INTEGER frequency; // ticks per secon
LARGE_INTEGER t1, t2; // ticks
double elapsedTime;
// get ticks per second
QueryPerformanceFrequency(&frequency);
// start timer
QueryPerformanceCounter(&t1);
#pragma omp parallel for
for(int i =0 ; i < 999999 ; i++)
for(int i =0 ; i < 1000 ; i++);
// stop timer
QueryPerformanceCounter(&t2);
elapsedTime= (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart;
cout << elapsedTime << " ms.n";
}
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
19
Experiment Result - Sequential
• It took 3347.68 milliseconds to run
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
20
Experiment Result - Parallel
• It took 983.576 milliseconds to run
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
21
The End
Isfahan University of Technology, Dep. Electronic and Computer
Engineering
22

More Related Content

What's hot

Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Chris Fregly
 
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
Spring.Net, Feb 2008, PostSharp:  A Technical IntroductionSpring.Net, Feb 2008, PostSharp:  A Technical Introduction
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
gfraiteur
 
Uber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep LearningUber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep Learning
inside-BigData.com
 
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
Chris Fregly
 
C# Parallel programming
C# Parallel programmingC# Parallel programming
C# Parallel programming
Umeshwaran V
 

What's hot (20)

Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)Introduction to OpenMP (Performance)
Introduction to OpenMP (Performance)
 
Open mp directives
Open mp directivesOpen mp directives
Open mp directives
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
Hands-on Learning with KubeFlow + Keras/TensorFlow 2.0 + TF Extended (TFX) + ...
 
Horovod - Distributed TensorFlow Made Easy
Horovod - Distributed TensorFlow Made EasyHorovod - Distributed TensorFlow Made Easy
Horovod - Distributed TensorFlow Made Easy
 
Coding For Cores - C# Way
Coding For Cores - C# WayCoding For Cores - C# Way
Coding For Cores - C# Way
 
Multicore
MulticoreMulticore
Multicore
 
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
Spring.Net, Feb 2008, PostSharp:  A Technical IntroductionSpring.Net, Feb 2008, PostSharp:  A Technical Introduction
Spring.Net, Feb 2008, PostSharp: A Technical Introduction
 
Gpgpu intro
Gpgpu introGpgpu intro
Gpgpu intro
 
Concurrency & Parallel Programming
Concurrency & Parallel ProgrammingConcurrency & Parallel Programming
Concurrency & Parallel Programming
 
Php 7 - YNS
Php 7 - YNSPhp 7 - YNS
Php 7 - YNS
 
Uber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep LearningUber's Journey in Distributed Deep Learning
Uber's Journey in Distributed Deep Learning
 
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
Swift for TensorFlow - Tanmay Bakshi - Advanced Spark and TensorFlow Meetup -...
 
MPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI ForumMPI Sessions: a proposal to the MPI Forum
MPI Sessions: a proposal to the MPI Forum
 
C# Parallel programming
C# Parallel programmingC# Parallel programming
C# Parallel programming
 
Horovod ubers distributed deep learning framework by Alex Sergeev from Uber
Horovod ubers distributed deep learning framework  by Alex Sergeev from UberHorovod ubers distributed deep learning framework  by Alex Sergeev from Uber
Horovod ubers distributed deep learning framework by Alex Sergeev from Uber
 
Tensor flow intro and summit info feb 2017
Tensor flow intro and summit info feb 2017Tensor flow intro and summit info feb 2017
Tensor flow intro and summit info feb 2017
 
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
“Programação paralela híbrida com MPI e OpenMP – uma abordagem prática”. Edua...
 
Parallel Computing - Lec 5
Parallel Computing - Lec 5Parallel Computing - Lec 5
Parallel Computing - Lec 5
 
Introduction to TensorFlow Lite
Introduction to TensorFlow Lite Introduction to TensorFlow Lite
Introduction to TensorFlow Lite
 

Viewers also liked

MPI Presentation
MPI PresentationMPI Presentation
MPI Presentation
Tayfun Sen
 
Biref Introduction to OpenMP
Biref Introduction to OpenMPBiref Introduction to OpenMP
Biref Introduction to OpenMP
JerryHe
 
DH Western State SPSL Article - 06-15
DH Western State SPSL Article - 06-15DH Western State SPSL Article - 06-15
DH Western State SPSL Article - 06-15
Tamera Cook
 
Inspiring Journeys Case Statement
Inspiring Journeys Case StatementInspiring Journeys Case Statement
Inspiring Journeys Case Statement
Kim Mills
 

Viewers also liked (19)

Intro to OpenMP
Intro to OpenMPIntro to OpenMP
Intro to OpenMP
 
Cloud Services On UI and Ideas for Federated Cloud on idREN
Cloud Services On UI and Ideas for Federated Cloud on idRENCloud Services On UI and Ideas for Federated Cloud on idREN
Cloud Services On UI and Ideas for Federated Cloud on idREN
 
presentation
presentationpresentation
presentation
 
Openmp combined
Openmp combinedOpenmp combined
Openmp combined
 
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013Intel® MPI Library e OpenMP* - Intel Software Conference 2013
Intel® MPI Library e OpenMP* - Intel Software Conference 2013
 
Wolfgang Lehner Technische Universitat Dresden
Wolfgang Lehner Technische Universitat DresdenWolfgang Lehner Technische Universitat Dresden
Wolfgang Lehner Technische Universitat Dresden
 
MPI Presentation
MPI PresentationMPI Presentation
MPI Presentation
 
Biref Introduction to OpenMP
Biref Introduction to OpenMPBiref Introduction to OpenMP
Biref Introduction to OpenMP
 
Presentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel ProgrammingPresentation on Shared Memory Parallel Programming
Presentation on Shared Memory Parallel Programming
 
HowTo Install openMPI on Ubuntu
HowTo Install openMPI on UbuntuHowTo Install openMPI on Ubuntu
HowTo Install openMPI on Ubuntu
 
Open mp intro_01
Open mp intro_01Open mp intro_01
Open mp intro_01
 
OpenMP Tutorial for Beginners
OpenMP Tutorial for BeginnersOpenMP Tutorial for Beginners
OpenMP Tutorial for Beginners
 
Parohia Târg Horezu I
Parohia Târg Horezu I Parohia Târg Horezu I
Parohia Târg Horezu I
 
DH Western State SPSL Article - 06-15
DH Western State SPSL Article - 06-15DH Western State SPSL Article - 06-15
DH Western State SPSL Article - 06-15
 
Gerd Schenkel, Executive Director, Telstra Digital
Gerd Schenkel, Executive Director, Telstra DigitalGerd Schenkel, Executive Director, Telstra Digital
Gerd Schenkel, Executive Director, Telstra Digital
 
practica #1 ecxel
practica #1 ecxelpractica #1 ecxel
practica #1 ecxel
 
SUCCESS STORY OF CHANGE IN CISCO
SUCCESS STORY OF CHANGE IN CISCOSUCCESS STORY OF CHANGE IN CISCO
SUCCESS STORY OF CHANGE IN CISCO
 
Inspiring Journeys Case Statement
Inspiring Journeys Case StatementInspiring Journeys Case Statement
Inspiring Journeys Case Statement
 
Гавриленко
ГавриленкоГавриленко
Гавриленко
 

Similar to OpenMP

Similar to OpenMP (20)

Lecture6
Lecture6Lecture6
Lecture6
 
Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mp
 
A Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC ChallengesA Source-To-Source Approach to HPC Challenges
A Source-To-Source Approach to HPC Challenges
 
Lecture 1 introduction to parallel and distributed computing
Lecture 1   introduction to parallel and distributed computingLecture 1   introduction to parallel and distributed computing
Lecture 1 introduction to parallel and distributed computing
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
Async programming in c#
Async programming in c#Async programming in c#
Async programming in c#
 
openmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.pptopenmp.New.intro-unc.edu.ppt
openmp.New.intro-unc.edu.ppt
 
Putting Compilers to Work
Putting Compilers to WorkPutting Compilers to Work
Putting Compilers to Work
 
Introduction to multicore .ppt
Introduction to multicore .pptIntroduction to multicore .ppt
Introduction to multicore .ppt
 
OpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC SystemsOpenPOWER Acceleration of HPCC Systems
OpenPOWER Acceleration of HPCC Systems
 
Taming the resource tiger
Taming the resource tigerTaming the resource tiger
Taming the resource tiger
 
Automatic Launch and Tracking the Computational Simulations with LiFlow and S...
Automatic Launch and Tracking the Computational Simulations with LiFlow and S...Automatic Launch and Tracking the Computational Simulations with LiFlow and S...
Automatic Launch and Tracking the Computational Simulations with LiFlow and S...
 
Multithreaded Programming Part- II.pdf
Multithreaded Programming Part- II.pdfMultithreaded Programming Part- II.pdf
Multithreaded Programming Part- II.pdf
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
openmp final2.pptx
openmp final2.pptxopenmp final2.pptx
openmp final2.pptx
 
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)Parallel and Asynchronous Programming -  ITProDevConnections 2012 (English)
Parallel and Asynchronous Programming - ITProDevConnections 2012 (English)
 
"The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P..."The BG collaboration, Past, Present, Future. The new available resources". P...
"The BG collaboration, Past, Present, Future. The new available resources". P...
 
Gfarm presentation and thesis topic introduction
Gfarm presentation and thesis topic introductionGfarm presentation and thesis topic introduction
Gfarm presentation and thesis topic introduction
 
Threads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess CommunicationThreads in Operating System | Multithreading | Interprocess Communication
Threads in Operating System | Multithreading | Interprocess Communication
 
Deep Learning at Scale
Deep Learning at ScaleDeep Learning at Scale
Deep Learning at Scale
 

Recently uploaded

Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 

Recently uploaded (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 

OpenMP

  • 1. OpenMP Presented by : Mohammad Radpour Amirali Sharifian Farbod Nosrat Nezami
  • 2. Introduction • What is parallel processing ? It is ability of processing more than one job simultaneously. • Why going parallel ? • Great deal of data to be processed • Time needed to calculate an engineering equation • Need jobs to be done faster Isfahan University of Technology, Dep. Electronic and Computer Engineering 2
  • 3. Technologies • What technologies used for parallel processing ? • Network based parallel processing • Utilizing CPU free time and power • Fact is most of CPU time and power is wasting • Tearing down jobs and run them on resources • Local parallelism on multicore/multiprocessor systems • Utilize the concept of multithreading • Utilize the concept of share memory • Can be run on either GPU or CPU Isfahan University of Technology, Dep. Electronic and Computer Engineering 3
  • 4. Tools and Technics • What tools used for parallel processing ? • Network based parallel processing • Gird based parallel computing • Cloud based parallelism and Cloud computing • Local parallelism on multicore/multiprocessor systems • NVidia® CUDA™ • MPI • Posix Threads • OpenMP Isfahan University of Technology, Dep. Electronic and Computer Engineering 4
  • 5. What is OpenMP • OpenMP • In simple word runs a user program in parallel. • It utilize to main concepts for parallelism • Multithreading • Shared Memory • It takes user application, tear it down into group of threads and runs them on a shared memory foundation Isfahan University of Technology, Dep. Electronic and Computer Engineering 5
  • 6. Why using OpenMP • It is simple to use it • Most of the times there is no need to change program code • It utilize compiler directives to demonstrate parallel region • It is cross platform • It supports by Fortran and C / C++ Isfahan University of Technology, Dep. Electronic and Computer Engineering 6
  • 7. Programming Model • Shared Memory • Parallelism by threading • Fork-Join model • Explicit Parallelism • Nested Parallelism • Dynamic Threads • Input / Output • Memory model Isfahan University of Technology, Dep. Electronic and Computer Engineering 7
  • 8. Shared Memory • What is shared memory ? • Why using shared memory? • Shared Memory in OpenMP Isfahan University of Technology, Dep. Electronic and Computer Engineering 8
  • 9. Shared Memory (Cont.) • Following system can be used for shared memory access • a single core chip (older PC’s, sequential execution) • a multicore chip (such as your laptop?) • multiple single core chips in a NUMA system • multiple multicore chips in a NUMA system (VT SGI system) Isfahan University of Technology, Dep. Electronic and Computer Engineering 9
  • 10. UMA Vs. NUMA • Unified Memory Access ( UMA ) Isfahan University of Technology, Dep. Electronic and Computer Engineering 10
  • 11. UMA Vs. NUMA (Cont.) • Non Unified Memory Access ( NUMA ) Isfahan University of Technology, Dep. Electronic and Computer Engineering 11
  • 12. Multi Threading • What is Multi Threading • What is Intel Hyper-Threading • Why using Multi Threading • Multi Threading in OpenMP Isfahan University of Technology, Dep. Electronic and Computer Engineering 12
  • 13. Fork – Join Model • What is Fork • What is Join • How Multi Threading works in OpenMP Isfahan University of Technology, Dep. Electronic and Computer Engineering 13
  • 14. Fork – Join Model (Cont.) Isfahan University of Technology, Dep. Electronic and Computer Engineering 14 F J Master Thread Thread
  • 15. OpenMP Elements • Compiler Directives • Runtime Libraries • Environmental Variables Isfahan University of Technology, Dep. Electronic and Computer Engineering 15
  • 16. How to use OpenMP • OpenMP implemented for C/C++ and Fortran • In C/C++ we use compiler directives • We only need to specify the parallel region Isfahan University of Technology, Dep. Electronic and Computer Engineering 16
  • 17. How to use OpenMP • In non Microsoft compiler: Isfahan University of Technology, Dep. Electronic and Computer Engineering 17
  • 18. How to use OpenMP (Cont.) • In Visual Studio : Isfahan University of Technology, Dep. Electronic and Computer Engineering 18
  • 19. Real Experiment void main() { omp_set_num_threads(6); LARGE_INTEGER frequency; // ticks per secon LARGE_INTEGER t1, t2; // ticks double elapsedTime; // get ticks per second QueryPerformanceFrequency(&frequency); // start timer QueryPerformanceCounter(&t1); #pragma omp parallel for for(int i =0 ; i < 999999 ; i++) for(int i =0 ; i < 1000 ; i++); // stop timer QueryPerformanceCounter(&t2); elapsedTime= (t2.QuadPart - t1.QuadPart) * 1000.0 / frequency.QuadPart; cout << elapsedTime << " ms.n"; } Isfahan University of Technology, Dep. Electronic and Computer Engineering 19
  • 20. Experiment Result - Sequential • It took 3347.68 milliseconds to run Isfahan University of Technology, Dep. Electronic and Computer Engineering 20
  • 21. Experiment Result - Parallel • It took 983.576 milliseconds to run Isfahan University of Technology, Dep. Electronic and Computer Engineering 21
  • 22. The End Isfahan University of Technology, Dep. Electronic and Computer Engineering 22