SlideShare a Scribd company logo
1 of 43
Parallel Computing
30.09.2020
Holy Cross College, Puttady Kerala
International Webinar
Dr.A.Bharathi Lakshmi
Head of IT Department, VVVC, VNR
Content
ā€¢What
ā€¢Why
ā€¢Architecture
ā€¢Software and Processors
ā€¢Parallel Programming
ā€¢Research Work
Preliminary
Preliminary
Preliminary
Parallel Computing
Serial Computing
Parallel Computing
Why Parallel Computing
ā€¢Save Time
ā€¢Memory Usage
ā€¢Concurrency
Architecture
Architecture
ā€¢Flynnā€™s Taxonomy
ā€¢Fengā€™s Classification
ā€¢Handler Classification
Flynnā€™s Taxonomy
Flynnā€™s Taxonomy - SISD
Flynnā€™s Taxonomy ā€“ SIMD
Flynnā€™s Taxonomy - MISD
Flynnā€™s Taxonomy - MIMD
Memory Architecture
ā€¢Shared Memory
ā€¢Uniform Memory Access (UMA)
ā€¢Non Uniform Memory Access (NUMA)
ā€¢Distributed Memory
ā€¢Hybrid Memory
Memory Architecture - UMA
Memory Architecture - NUMA
Memory Architecture
Distributed Memory
Memory Architecture
Hybrid Memory
Type of Parallel Computing
ā€¢Data Parallel
ā€¢Task Parallel
ā€¢Pipeline Parallel
OS & Processor
ā€¢ Multiprocessing
ā€¢ Multitasking
ā€¢ Multithreading
ā€¢ AMD
ā€¢ 4 ā€“ 32 Cores
ā€¢ 4 ā€“ 64 Threads
ā€¢ Intel
ā€¢ 2 ā€“ 7 Cores
ā€¢ Duo ā€“ multithreading
ā€¢ I7 ā€“ 8 Cores
Programming Languages
ā€¢ Apache Hadoop
ā€¢ Apache Spark
ā€¢ Apache Flink
ā€¢ Apache Beam
ā€¢ CUDA
ā€¢ OpenCL
ā€¢ OpenHMPP
ā€¢ OpenMP for C, C++ and Fortran (Shared Memory)
ā€¢ Message Passing Interface (MPI) for C, C++ and Fortran (Distributed
Memory)
OpenMP
ā€¢Thread Modeling
ā€¢Converting Serial to Parallel program is easy
ā€¢Unix pThread
ā€¢Compiler directives
ā€¢Runtime Library
ā€¢Environmental Variables
ā€¢Fork-Join Model
OpenMP ā€“ Fork-Join Model
OpenMP - Directives
ā€¢ For Parallel work-sharing
ā€¢ parallel - # pragma omp parallel
ā€¢ for - #pragma omp [parallel] for [clauses]
ā€¢ sections - #pragma omp [parallel] sections [clauses]
ā€¢ single - #pragma omp single [clauses]
ā€¢ For Master and Synchronization
ā€¢ master
ā€¢ critical
ā€¢ barrier
ā€¢ atomic
ā€¢ flush
ā€¢ Ordered
ā€¢ #pragma omp directive
OpenMP
ā€¢omp.h ā€“ Runtime Library
ā€¢Environmental Variable
ā€¢omp_dynamic
ā€¢omp_num_threads
ā€¢omp_schedule
ā€¢omp_nested
omp_dynamic
ā€¢Syntax
omp_dynamic = boolean value
ā€¢value ā€“ true | false
ā€¢True ā€“ allow users to adjust number of threads
ā€¢False ā€“ users canā€™t adjust number of threads
ā€¢Default value - false
omp_num_threads
ā€¢ Syntax
omp_num_threads = num_list
ā€¢ Num_list ā€“ positive integer values
ā€¢ Single value
ā€¢ True & parallel construct without num_threads
ā€¢ false & parallel construct without num_threads
ā€¢ Multiple values
ā€¢ True & parallel construct without num_threads
ā€¢ false & parallel construct without num_threads
omp_schedule
ā€¢ Syntax
omp_schedule [= type[,size]]
ā€¢ Type
ā€¢ Dynamic
ā€¢ Guided
ā€¢ Runtime
ā€¢ static
ā€¢ Size
ā€¢ Iterations
ā€¢ Integer
ā€¢ Not valid ā€“ Runtime
omp_nested
ā€¢ Syntax
omp_nested [= true | false]
ā€¢ True - enabled
ā€¢ False ā€“ disabled
ā€¢ Default - false
Functions
ā€¢ omp_set_num_threads(int num_threads)
ā€¢ int omp_get_num_threads
ā€¢ int omp_get_max_threads
ā€¢ int omp_get_thread_num
ā€¢ int omp_get_num_procs
ā€¢ void omp_set_dynamic
ā€¢ int omp_get_dynamic
ā€¢ void omp_set_nested
ā€¢ int omp_get_nested
OpenMP - Clauses
ā€¢ For General attributes
ā€¢ if - if(expression)
ā€¢ num_threads ā€“ num_threads(num)
ā€¢ ordered - ordered
ā€¢ schedule
ā€¢ nowait - nowait
ā€¢ For data-sharing attributes
ā€¢ private ā€“ private(var)
ā€¢ firstprivate ā€“ firstprivate(var)
ā€¢ lastprivate ā€“ lastprivate(var)
ā€¢ shared ā€“ shared(var)
ā€¢ default ā€“ default(shared | none)
ā€¢ reduction ā€“ reduction(operator:list)
Paradigm for using OMP
ā€¢ Write a sequential program
ā€¢ Identify the portion to be parallelized
ā€¢Add directive/pragmas
ā€¢ In addition to this call runtime library routines and
modify environment variables
ā€¢ Parallel programming is ready.
ā€¢ Use OpenMPā€™s compiler to compile
ā€¢Run the program
Matrix Multiplication
ā€¢Serial coding
for(int i=0;i<n;i++)
for(int k=0;k<n;k++)
for(int j=0;j<m;j++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
Matrix Multiplication
ā€¢ Parallel coding
#include<omp.h>
omp_set_num_threads(4);
#pragma omp parallel for private(i,j,k)
{
for(int i=0;i<n;i++)
for(int k=0;k<n;k++)
for(int j=0;j<m;j++)
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
Sum of an Array
ā€¢Serial coding
sum=0;
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
sum+=a[i][j];
Sum of an Array
ā€¢ Parallel coding
#include<omp.h>
omp_set_num_threads(4);
#pragma omp parallel for private(i,j) reduction(+:sum)
{
for(int i=0;i<n;i++)
for(int j=0;j<m;j++)
sum+=a[i][j];
}
Image Reconstruction - Pseducode
Image Reconstruction ā€“ Time complexity
Time complexity Time complexity Graph
Speedup Graph
10 12 15 20 30
FBP 0.008455 0.007704 0.00781 0.015839 0.021083
SIRT 75.6588 76.6664 91.628 56.3881 176.8353
SART 50.5161 57.6855 56.3243 56.3881 202.067
ART 1609.1 1699.73 1889.8 918.3131 723.983
MLEM 522.894 462.973 750.215 709.861 2134.4
MAPEM 726.522 532.309 727.098 532.317 771.465
2 Core 502.087 332.341 502.65 332.347 463.192
4 Core 398.953 297.146 399.495 297.143 447.483
8 Core 198.488 145.926 199.045 145.934 259.513
Square NaĆÆve Matrix Multiplication
Time complexity
Time complexity Graph
Speedup Graph
0
200
400
600
800
1000
1200
1400
1000 Ɨ 1000 2000 Ɨ 2000 3000 Ɨ 3000 4000 Ɨ 4000 5000 Ɨ 5000
1 Core 2 Cores 4 Cores 8 Cores
12 Cores 16 Cores 18 cores 20 Cores
0.0000
2.0000
4.0000
6.0000
8.0000
10.0000
12.0000
14.0000
16.0000
18.0000
1000 Ɨ
1000
2000 Ɨ
2000
3000 Ɨ
3000
4000 Ɨ
4000
5000 Ɨ
5000
2 4 8 12
16 18 20
Cores
1000 x
1000
2000 x
2000
3000 x
3000
4000 x
4000
5000 x
5000
1 4.1621 54.4683 233.965 639.153 1282.2257
2 2.1539 25.9129 118.3784 316.9857 641.8125
4 1.0993 17.0027 64.2888 172.9639 329.7763
8 0.5822 8.5168 34.0960 81.1930 163.0.773
12 0.5074 5.8074 22.6845 62.6338 135.0753
16 0.5061 4.7371 19.455 57.1035 126.0156
18 0.4708 4.6368 18.6277 52.2070 120.5529
20 0.4487 0.5695 0.6275 0.5502 0.5177
Hot research
ā€¢Nividia
ā€¢Data mining ā€“ tremendous data
ā€¢Lacking in techniques and Computational power
ā€¢AI/Machine learning
ā€¢Image Processing
ā€¢Medical Field
ā€¢ Image Reconstruction
parallelcomputing-webminar.ppsx
parallelcomputing-webminar.ppsx

More Related Content

Similar to parallelcomputing-webminar.ppsx

Connecting C++ and JavaScript on the Web with Embind
Connecting C++ and JavaScript on the Web with EmbindConnecting C++ and JavaScript on the Web with Embind
Connecting C++ and JavaScript on the Web with Embind
Chad Austin
Ā 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
bartzon
Ā 
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLITSQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
chaitalidarode1
Ā 
SMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning ApproachSMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning Approach
Reza Rahimi
Ā 

Similar to parallelcomputing-webminar.ppsx (20)

Connecting C++ and JavaScript on the Web with Embind
Connecting C++ and JavaScript on the Web with EmbindConnecting C++ and JavaScript on the Web with Embind
Connecting C++ and JavaScript on the Web with Embind
Ā 
Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"Adam Sitnik "State of the .NET Performance"
Adam Sitnik "State of the .NET Performance"
Ā 
State of the .Net Performance
State of the .Net PerformanceState of the .Net Performance
State of the .Net Performance
Ā 
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
Fedor Polyakov - Optimizing computer vision problems on mobile platforms Fedor Polyakov - Optimizing computer vision problems on mobile platforms
Fedor Polyakov - Optimizing computer vision problems on mobile platforms
Ā 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
Ā 
Lessons learned while building Omroep.nl
Lessons learned while building Omroep.nlLessons learned while building Omroep.nl
Lessons learned while building Omroep.nl
Ā 
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLITSQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
SQL SCIPY STREAMLIT_Introduction to the basic of SQL SCIPY STREAMLIT
Ā 
Building source code level profiler for C++.pdf
Building source code level profiler for C++.pdfBuilding source code level profiler for C++.pdf
Building source code level profiler for C++.pdf
Ā 
Performance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen BorgersPerformance van Java 8 en verder - Jeroen Borgers
Performance van Java 8 en verder - Jeroen Borgers
Ā 
Look Mommy, No GC! (TechDays NL 2017)
Look Mommy, No GC! (TechDays NL 2017)Look Mommy, No GC! (TechDays NL 2017)
Look Mommy, No GC! (TechDays NL 2017)
Ā 
The Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance TuningThe Diabolical Developers Guide to Performance Tuning
The Diabolical Developers Guide to Performance Tuning
Ā 
c++ UNIT II.pptx
c++ UNIT II.pptxc++ UNIT II.pptx
c++ UNIT II.pptx
Ā 
MATLAB & Image Processing
MATLAB & Image ProcessingMATLAB & Image Processing
MATLAB & Image Processing
Ā 
SMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning ApproachSMS Spam Filter Design Using R: A Machine Learning Approach
SMS Spam Filter Design Using R: A Machine Learning Approach
Ā 
Algorithm and Data Structures - Basic of IT Problem Solving
Algorithm and Data Structures - Basic of IT Problem SolvingAlgorithm and Data Structures - Basic of IT Problem Solving
Algorithm and Data Structures - Basic of IT Problem Solving
Ā 
Basic terminologies & asymptotic notations
Basic terminologies & asymptotic notationsBasic terminologies & asymptotic notations
Basic terminologies & asymptotic notations
Ā 
EM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM MetricsEM12c: Capacity Planning with OEM Metrics
EM12c: Capacity Planning with OEM Metrics
Ā 
Ip mdu-b.tech
Ip mdu-b.techIp mdu-b.tech
Ip mdu-b.tech
Ā 
Processing Large Graphs
Processing Large GraphsProcessing Large Graphs
Processing Large Graphs
Ā 
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard WorldMonitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Ā 

More from Bharathi Lakshmi Pon

More from Bharathi Lakshmi Pon (13)

Knowing about Computer SS.pptx
Knowing about Computer SS.pptxKnowing about Computer SS.pptx
Knowing about Computer SS.pptx
Ā 
iterativealgorithms.ppsx
iterativealgorithms.ppsxiterativealgorithms.ppsx
iterativealgorithms.ppsx
Ā 
intensitytransformationspatialfiltering.ppsx
intensitytransformationspatialfiltering.ppsxintensitytransformationspatialfiltering.ppsx
intensitytransformationspatialfiltering.ppsx
Ā 
mapem.ppsx
mapem.ppsxmapem.ppsx
mapem.ppsx
Ā 
graphicsdesigning-intro.ppsx
graphicsdesigning-intro.ppsxgraphicsdesigning-intro.ppsx
graphicsdesigning-intro.ppsx
Ā 
intensitytransformation.ppsx
intensitytransformation.ppsxintensitytransformation.ppsx
intensitytransformation.ppsx
Ā 
PSNR based Optimization using statistical algorithm.ppsx
PSNR based Optimization using statistical algorithm.ppsxPSNR based Optimization using statistical algorithm.ppsx
PSNR based Optimization using statistical algorithm.ppsx
Ā 
dipslideshare.ppsx
dipslideshare.ppsxdipslideshare.ppsx
dipslideshare.ppsx
Ā 
matrixmultiplicationparallel.ppsx
matrixmultiplicationparallel.ppsxmatrixmultiplicationparallel.ppsx
matrixmultiplicationparallel.ppsx
Ā 
webdesigning.ppsx
webdesigning.ppsxwebdesigning.ppsx
webdesigning.ppsx
Ā 
classtimetable.ppsx
classtimetable.ppsxclasstimetable.ppsx
classtimetable.ppsx
Ā 
Intensity Transformation and Spatial Filtering
Intensity Transformation and Spatial FilteringIntensity Transformation and Spatial Filtering
Intensity Transformation and Spatial Filtering
Ā 
Sequential consistency model
Sequential consistency modelSequential consistency model
Sequential consistency model
Ā 

Recently uploaded

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
Ā 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
Ā 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
Ā 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Ā 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
Ā 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
Ā 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
Ā 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
Ā 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
Ā 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
Ā 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
Ā 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
Ā 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
Ā 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
Ā 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
Ā 
Tį»”NG ƔN Tįŗ¬P THI VƀO Lį»šP 10 MƔN TIįŗ¾NG ANH NĂM Hį»ŒC 2023 - 2024 CƓ ĐƁP ƁN (NGį»® Ƃ...
Tį»”NG ƔN Tįŗ¬P THI VƀO Lį»šP 10 MƔN TIįŗ¾NG ANH NĂM Hį»ŒC 2023 - 2024 CƓ ĐƁP ƁN (NGį»® Ƃ...Tį»”NG ƔN Tįŗ¬P THI VƀO Lį»šP 10 MƔN TIįŗ¾NG ANH NĂM Hį»ŒC 2023 - 2024 CƓ ĐƁP ƁN (NGį»® Ƃ...
Tį»”NG ƔN Tįŗ¬P THI VƀO Lį»šP 10 MƔN TIįŗ¾NG ANH NĂM Hį»ŒC 2023 - 2024 CƓ ĐƁP ƁN (NGį»® Ƃ...
Ā 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
Ā 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
Ā 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Ā 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
Ā 

parallelcomputing-webminar.ppsx