SlideShare a Scribd company logo
MULTICORE AND SHARED MULTI
PROCESSOR
S. Janani, AP/CSE
KCET
• Purpose:
Hardware multithreading improved the
efficiency of processors at modest cost, still
the big challenge was to deliver on the
performance potential of Moore’s Law by
efficiently programming the increasing
number of processors per chip.
• While rewriting old programs to run well on
parallel hardware, the question may be arise
as what can computer designers do to simplify
the task?
• Solution #1 : To provide a single physical
address space that all processors can share, so
that programs need not concern themselves
with where their data is. In this approach, all
variables of a program can be made available
at any time to any processor.
SMP
A shared memory multiprocessor (SMP) is one
that offers the programmer a single physical
address space across all processors (multicore
chips) also known as shared-address
multiprocessor.
• Processors communicate through shared
variables in memory, with all processors
capable of accessing any memory location via
loads and stores
• Such systems can still run independent jobs in
Figure: Classical Shared Memory Multiprocessor
Types of Single Address space multi
processor
• Single address space multiprocessors come in two styles.
• Type #1: Uniform Memory Access (UMA): the latency to a word
in memory does not depend on which processor asks for it
• Type #2: Non-Uniform Memory Access (NUMA): some memory
accesses are much faster than others, depending on which
processor asks for which word, typically because main memory
is divided and attached to different microprocessors or to
different memory controllers on the same chip
• As you might expect, the programming challenges are harder for
a NUMA multiprocessor than for a UMA multiprocessor, but
NUMA machines can scale to larger sizes and NUMAs can have
lower latency to nearby memory
• When sharing is supported with a single
address space, there must be a separate
mechanism for synchronization
• Lock : For synchronization => Only one
processor at a time can acquire the lock, and
other processors interested in shared data
must wait until the original processor unlocks
the variable
Example
OpenMP
• OpenMP: It is just an Application Programmer
Interface (API) along with a set of compiler
directives, environment variables, and runtime
library routines that can extend standard
programming languages.
• It offers a portable, scalable, and simple
programming model for shared memory
multiprocessors. Its primary goal is to
parallelize loops and to perform reductions.
• Command to use the OpenMP API with the
#pragma omp parallel for
for (Pn = 0; Pn < P; Pn += 1)
for (i = 0; 1000*Pn; i < 1000*(Pn+1); i += 1)
sum[Pn] += A[i]; /*sum the assigned
areas*/
Reduction:
#pragma omp parallel for reduction(+ :
FinalSum)
for (i = 0; i < P; i += 1)
FinalSum += sum[i]; /* Reduce to a single
Advantages and Limitations
• Note that it is now up to the OpenMP library
to find efficient code to sum 64 numbers
efficiently using 64 processors.
• While OpenMP makes it easy to write simple
parallel code, it is not very helpful with
debugging, so many parallel programmers use
more sophisticated parallel programming
systems than OpenMP, just as many
programmers today use more productive
languages than C

More Related Content

What's hot

FIne Grain Multithreading
FIne Grain MultithreadingFIne Grain Multithreading
FIne Grain Multithreading
Dharmesh Tank
 
Parallel architecture
Parallel architectureParallel architecture
Parallel architecture
Mr SMAK
 
Parallel architecture-programming
Parallel architecture-programmingParallel architecture-programming
Parallel architecture-programming
Shaveta Banda
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1
Mr SMAK
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
Muhammad Ishaq
 

What's hot (20)

Lecture1
Lecture1Lecture1
Lecture1
 
CUDA
CUDACUDA
CUDA
 
Lect18
Lect18Lect18
Lect18
 
FIne Grain Multithreading
FIne Grain MultithreadingFIne Grain Multithreading
FIne Grain Multithreading
 
Parallel architecture
Parallel architectureParallel architecture
Parallel architecture
 
Parallelism in sql server
Parallelism in sql serverParallelism in sql server
Parallelism in sql server
 
Introduction to OpenMP
Introduction to OpenMPIntroduction to OpenMP
Introduction to OpenMP
 
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...Multithreading: Exploiting Thread-Level  Parallelism to Improve Uniprocessor ...
Multithreading: Exploiting Thread-Level Parallelism to Improve Uniprocessor ...
 
MPI in TNT for parallel processing
MPI in TNT for parallel processingMPI in TNT for parallel processing
MPI in TNT for parallel processing
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture1
Lecture1Lecture1
Lecture1
 
Linux NUMA & Databases: Perils and Opportunities
Linux NUMA & Databases: Perils and OpportunitiesLinux NUMA & Databases: Perils and Opportunities
Linux NUMA & Databases: Perils and Opportunities
 
Parallel architecture-programming
Parallel architecture-programmingParallel architecture-programming
Parallel architecture-programming
 
Lecture 6.1
Lecture  6.1Lecture  6.1
Lecture 6.1
 
Introduction to parallel processing
Introduction to parallel processingIntroduction to parallel processing
Introduction to parallel processing
 
Parallel processing extra
Parallel processing extraParallel processing extra
Parallel processing extra
 
Superscalar & superpipeline processor
Superscalar & superpipeline processorSuperscalar & superpipeline processor
Superscalar & superpipeline processor
 
Lecture4
Lecture4Lecture4
Lecture4
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
NUMA overview
NUMA overviewNUMA overview
NUMA overview
 

Similar to Multicore and shared multi processor

Lecture 6
Lecture  6Lecture  6
Lecture 6
Mr SMAK
 
Lecture 6
Lecture  6Lecture  6
Lecture 6
Mr SMAK
 
Lecture 6
Lecture  6Lecture  6
Lecture 6
Mr SMAK
 

Similar to Multicore and shared multi processor (20)

message passing vs shared memory
message passing vs shared memorymessage passing vs shared memory
message passing vs shared memory
 
Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mp
 
CA UNIT IV.pptx
CA UNIT IV.pptxCA UNIT IV.pptx
CA UNIT IV.pptx
 
Overview of HPC.pptx
Overview of HPC.pptxOverview of HPC.pptx
Overview of HPC.pptx
 
Multiprocessor_YChen.ppt
Multiprocessor_YChen.pptMultiprocessor_YChen.ppt
Multiprocessor_YChen.ppt
 
Shared memory.pptx
Shared memory.pptxShared memory.pptx
Shared memory.pptx
 
Underlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computingUnderlying principles of parallel and distributed computing
Underlying principles of parallel and distributed computing
 
Week 13-14 Parrallel Processing-new.pptx
Week 13-14 Parrallel Processing-new.pptxWeek 13-14 Parrallel Processing-new.pptx
Week 13-14 Parrallel Processing-new.pptx
 
Parallel & Distributed processing
Parallel & Distributed processingParallel & Distributed processing
Parallel & Distributed processing
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Symmetric multiprocessing and Microkernel
Symmetric multiprocessing and MicrokernelSymmetric multiprocessing and Microkernel
Symmetric multiprocessing and Microkernel
 
Lecture 6
Lecture  6Lecture  6
Lecture 6
 
Lecture 6
Lecture  6Lecture  6
Lecture 6
 
Lecture 6
Lecture  6Lecture  6
Lecture 6
 
Distributed Shared Memory
Distributed Shared MemoryDistributed Shared Memory
Distributed Shared Memory
 
22CS201 COA
22CS201 COA22CS201 COA
22CS201 COA
 
Communication model of parallel platforms
Communication model of parallel platformsCommunication model of parallel platforms
Communication model of parallel platforms
 
Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computing
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 
unit 4.pptx
unit 4.pptxunit 4.pptx
unit 4.pptx
 

More from Sou Jana

More from Sou Jana (19)

PGP S/MIME
PGP S/MIMEPGP S/MIME
PGP S/MIME
 
UHV Self Management and Peer Pressure.pptx
UHV Self Management and Peer Pressure.pptxUHV Self Management and Peer Pressure.pptx
UHV Self Management and Peer Pressure.pptx
 
RC4.pptx
RC4.pptxRC4.pptx
RC4.pptx
 
X.509 Certificates
X.509 CertificatesX.509 Certificates
X.509 Certificates
 
Digital Signature Standard
Digital Signature StandardDigital Signature Standard
Digital Signature Standard
 
Message Authentication Requirement-MAC
Message Authentication Requirement-MACMessage Authentication Requirement-MAC
Message Authentication Requirement-MAC
 
Kerberos
KerberosKerberos
Kerberos
 
Elliptic Curve Cryptography
Elliptic Curve CryptographyElliptic Curve Cryptography
Elliptic Curve Cryptography
 
Elgamal Digital Signature
Elgamal Digital SignatureElgamal Digital Signature
Elgamal Digital Signature
 
Key management.ppt
Key management.pptKey management.ppt
Key management.ppt
 
Mathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptographyMathematics of Asymmetric cryptography
Mathematics of Asymmetric cryptography
 
RSA Algm.pptx
RSA Algm.pptxRSA Algm.pptx
RSA Algm.pptx
 
Diffie Hellman.pptx
Diffie Hellman.pptxDiffie Hellman.pptx
Diffie Hellman.pptx
 
Security Model
Security ModelSecurity Model
Security Model
 
Classical Encryption Techniques
Classical Encryption TechniquesClassical Encryption Techniques
Classical Encryption Techniques
 
Perfect Security
Perfect SecurityPerfect Security
Perfect Security
 
Cryptanalysis
CryptanalysisCryptanalysis
Cryptanalysis
 
Information Theory
Information TheoryInformation Theory
Information Theory
 
Product Cipher
Product CipherProduct Cipher
Product Cipher
 

Recently uploaded

Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
Kamal Acharya
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
Kamal Acharya
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
ssuser9bd3ba
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
Kamal Acharya
 

Recently uploaded (20)

Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-5 Notes for II-II Mechanical Engineering
 
Laundry management system project report.pdf
Laundry management system project report.pdfLaundry management system project report.pdf
Laundry management system project report.pdf
 
shape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptxshape functions of 1D and 2 D rectangular elements.pptx
shape functions of 1D and 2 D rectangular elements.pptx
 
Construction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptxConstruction method of steel structure space frame .pptx
Construction method of steel structure space frame .pptx
 
Natalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in KrakówNatalia Rutkowska - BIM School Course in Kraków
Natalia Rutkowska - BIM School Course in Kraków
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Fruit shop management system project report.pdf
Fruit shop management system project report.pdfFruit shop management system project report.pdf
Fruit shop management system project report.pdf
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
LIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.pptLIGA(E)11111111111111111111111111111111111111111.ppt
LIGA(E)11111111111111111111111111111111111111111.ppt
 
Event Management System Vb Net Project Report.pdf
Event Management System Vb Net  Project Report.pdfEvent Management System Vb Net  Project Report.pdf
Event Management System Vb Net Project Report.pdf
 
Automobile Management System Project Report.pdf
Automobile Management System Project Report.pdfAutomobile Management System Project Report.pdf
Automobile Management System Project Report.pdf
 
İTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering WorkshopİTÜ CAD and Reverse Engineering Workshop
İTÜ CAD and Reverse Engineering Workshop
 
Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.Quality defects in TMT Bars, Possible causes and Potential Solutions.
Quality defects in TMT Bars, Possible causes and Potential Solutions.
 
WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234WATER CRISIS and its solutions-pptx 1234
WATER CRISIS and its solutions-pptx 1234
 
A case study of cinema management system project report..pdf
A case study of cinema management system project report..pdfA case study of cinema management system project report..pdf
A case study of cinema management system project report..pdf
 
ASME IX(9) 2007 Full Version .pdf
ASME IX(9)  2007 Full Version       .pdfASME IX(9)  2007 Full Version       .pdf
ASME IX(9) 2007 Full Version .pdf
 
Architectural Portfolio Sean Lockwood
Architectural Portfolio Sean LockwoodArchitectural Portfolio Sean Lockwood
Architectural Portfolio Sean Lockwood
 
Courier management system project report.pdf
Courier management system project report.pdfCourier management system project report.pdf
Courier management system project report.pdf
 
fundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projectionfundamentals of drawing and isometric and orthographic projection
fundamentals of drawing and isometric and orthographic projection
 
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES  INTRODUCTION UNIT-IENERGY STORAGE DEVICES  INTRODUCTION UNIT-I
ENERGY STORAGE DEVICES INTRODUCTION UNIT-I
 

Multicore and shared multi processor

  • 1. MULTICORE AND SHARED MULTI PROCESSOR S. Janani, AP/CSE KCET
  • 2. • Purpose: Hardware multithreading improved the efficiency of processors at modest cost, still the big challenge was to deliver on the performance potential of Moore’s Law by efficiently programming the increasing number of processors per chip.
  • 3. • While rewriting old programs to run well on parallel hardware, the question may be arise as what can computer designers do to simplify the task? • Solution #1 : To provide a single physical address space that all processors can share, so that programs need not concern themselves with where their data is. In this approach, all variables of a program can be made available at any time to any processor.
  • 4. SMP A shared memory multiprocessor (SMP) is one that offers the programmer a single physical address space across all processors (multicore chips) also known as shared-address multiprocessor. • Processors communicate through shared variables in memory, with all processors capable of accessing any memory location via loads and stores • Such systems can still run independent jobs in
  • 5. Figure: Classical Shared Memory Multiprocessor
  • 6. Types of Single Address space multi processor • Single address space multiprocessors come in two styles. • Type #1: Uniform Memory Access (UMA): the latency to a word in memory does not depend on which processor asks for it • Type #2: Non-Uniform Memory Access (NUMA): some memory accesses are much faster than others, depending on which processor asks for which word, typically because main memory is divided and attached to different microprocessors or to different memory controllers on the same chip • As you might expect, the programming challenges are harder for a NUMA multiprocessor than for a UMA multiprocessor, but NUMA machines can scale to larger sizes and NUMAs can have lower latency to nearby memory
  • 7. • When sharing is supported with a single address space, there must be a separate mechanism for synchronization • Lock : For synchronization => Only one processor at a time can acquire the lock, and other processors interested in shared data must wait until the original processor unlocks the variable
  • 9.
  • 10.
  • 11. OpenMP • OpenMP: It is just an Application Programmer Interface (API) along with a set of compiler directives, environment variables, and runtime library routines that can extend standard programming languages. • It offers a portable, scalable, and simple programming model for shared memory multiprocessors. Its primary goal is to parallelize loops and to perform reductions. • Command to use the OpenMP API with the
  • 12. #pragma omp parallel for for (Pn = 0; Pn < P; Pn += 1) for (i = 0; 1000*Pn; i < 1000*(Pn+1); i += 1) sum[Pn] += A[i]; /*sum the assigned areas*/ Reduction: #pragma omp parallel for reduction(+ : FinalSum) for (i = 0; i < P; i += 1) FinalSum += sum[i]; /* Reduce to a single
  • 13. Advantages and Limitations • Note that it is now up to the OpenMP library to find efficient code to sum 64 numbers efficiently using 64 processors. • While OpenMP makes it easy to write simple parallel code, it is not very helpful with debugging, so many parallel programmers use more sophisticated parallel programming systems than OpenMP, just as many programmers today use more productive languages than C