SlideShare a Scribd company logo
UNIT 5UNIT 5
Parallel ProgrammingParallel Programming
ModelsModels
Parallel Programming Models
Parallel Programming Models:
 Data parallelism / Task parallelism
 Explicit parallelism / Implicit parallelism
 Shared memory / Distributed memory
 Other programming paradigms
• Object-oriented
• Functional and logic
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.
 Any of these models can be
implemented on any underlying
hardware
Parallel Programming Models
 Data Parallelism
Parallel programs that emphasize concurrent execution of the
same task on different data elements (data-parallel programs)
• Most programs for scalable parallel computers are data parallel in
nature.
 Task Parallelism
Parallel programs that emphasize the concurrent execution of
different tasks on the same or different data
• Used for modularity reasons.
• Parallel programs, structured as a task-parallel composition of data-
parallel components is common.
Parallel Programming Models
Data parallelism
Task Parallelism
Parallel Programming Models
 Explicit Parallelism
The programmer specifies directly the activities of the multiple
concurrent “threads of control” that form a parallel
computation.
• Provide the programmer with more control over program behavior
and hence can be used to achieve higher performance.
 Implicit Parallelism
The programmer provides high-level specification of program
behavior.
It is then the responsibility of the compiler or library to
implement this parallelism efficiently and correctly.
Parallel Programming Models
 Shared Memory
The programmer’s task is to specify the activities of a set of processes
that communicate by reading and writing shared memory.
• Advantage: the programmer need not be concerned with data-distribution
issues.
• Disadvantage: performance implementations may be difficult on computers
that lack hardware support for shared memory, and race conditions tend to
arise more easily
 Distributed Memory
Processes have only local memory and must use some other
mechanism (e.g., message passing or remote procedure call) to
exchange information.
• Advantage: programmers have explicit control over data distribution and
communication.
Shared vs Distributed Memory
 Shared memory
 Distributed memory
Memory
Bus
P P P P
P P P P
M M M M
Network
Parallel Programming Models
Parallel Programming Tools:
 Parallel Virtual Machine (PVM)
 Message-Passing Interface (MPI)
 High-Performance Fortran (HPF)
 Parallelizing Compilers
Parallel Programming Models
Message Passing Model
 Used on Distributed memory MIMD architectures
 Multiple processes execute in parallel
asynchronously
• Process creation may be static or dynamic
 Processes communicate by using send and
receive primitives
Parallel Programming Models
 Blocking send: waits until all data is received
 Non-blocking send: continues execution after
placing the data in the buffer
 Blocking receive: if data is not ready, waits until it
arrives
 Non-blocking receive: reserves buffer and
continue execution. In a later wait operation if data
is ready, copies it into the memory.
Distributed Memory / Message
Passing Model
Parallel Programming Models
 Synchronous message-passing: Sender and
receiver processes are synchronized
• Blocking-send / Blocking receive
 Asynchronous message-passing: no
synchronization between sender and receiver
processes
• Large buffers are required. As buffer size is finite, the
sender may eventually block.
Parallel Programming Models
Advantages of message-passing model
 Programs are highly portable
 Provides the programmer with explicit control over the
location of data in the memory
Disadvantage of message-passing model
 Programmer is required to pay attention to such details as
the placement of memory and the ordering of
communication.
Parallel Programming Models
Factors that influence the performance of message-passing
model
 Bandwidth
 Latency
 Ability to overlap communication with computation.
Parallel Programming Models
Shared Memory Model
 Used on Shared memory MIMD architectures
 Program consists of many independent threads
 Concurrently executing threads all share a single, common
address space.
 Threads can exchange information by reading and writing to
memory using normal variable assignment operations
Parallel Programming Models
Memory Coherence Problem
 To ensure that the latest value of a variable updated in one thread
is used when that same variable is accessed in another thread.
 Hardware support and compiler support are required
 Cache-coherency protocol
Thread 1 Thread 2
X
Parallel Programming Models
Synchronization operations in Shared Memory Model
 Monitors
 Locks
 Critical sections
 Condition variables
 Semaphores
 Barriers
Data Parallel Model
Data Parallel Model
 It require extension use of pre distributed
data sets.
 Inter connected data structure are also
needed to facilitate the data exchange
operations
 It emphasize on the local computations
and performs several data routing
operations like replication, reduction, etc
Data Parallel Model
 The data parallel model demonstrates the
following characteristics:
• Most of the parallel work focuses on performing
operations on a data set.
• The data set is typically organized into a
common structure, such as an array or cube.
• A set of tasks work collectively on the same data
structure, however, each task works on a
different partition of the same data structure.
Data Parallel Model
• Tasks perform the same operation on their
partition of work, for example, "add 4 to every
array element".
• On shared memory architectures, all tasks may
have access to the data structure through global
memory.
• On distributed memory architectures the data
structure is split up and resides as "chunks" in
the local memory of each task.
Data Parallel Model
Parallel language and compilers
 They are different as compared to the
sequential language.
 More focus is given on the hardware as
compared to the program parallelism
using high level of abstraction.
Parallel language and compilers
 Language features
• Algorithm design : the problem must be
decomposable so that it can be breakup in
the part and can work in parallel.
• Programming Language: language needs
specific statements for implementing the
parallel algorithm
• Parallel Computer : the computer or network
of computers needs hardware capabilities for
a real parallel running of the program.
Examples of the parallel
language
 FORTRAN
 JAVA
 C++
 C*: C extended for parallelism
Parallel Compilers
 It Automatically Transform the sequential
program into parallel program
 It identify the loops whose iteration can
be executed in parallel whenever
possible.
 It often uses stages and concepts of data
dependencies.
Steps involve in creating
parallel program
 Decomposition :
• breakup computation in tasks
 Assignment:
• involve mechanism to divide work among
process,
 Orchestration :
• Naming data, structure communication,
synchronization, organization data structure
and scheduling the task, data access ,
communication and synchronization
 Mapping : processes to processors
Language features for
parallelism
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5
Unit5

More Related Content

What's hot

Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
Sunita Sahu
 
Advanced Techniques for Exploiting ILP
Advanced Techniques for Exploiting ILPAdvanced Techniques for Exploiting ILP
Advanced Techniques for Exploiting ILP
A B Shinde
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Gyanmanjari Institute Of Technology
 
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
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
Ashish Kumar
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
Bhavik Vashi
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
Pankaj Kumar Jain
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
babak danyal
 
Parallel processing
Parallel processingParallel processing
Parallel processing
Praveen Kumar
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
Kumbirai Junior Muzavazi
 
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
Vajira Thambawita
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
Ali Usman
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
Pooja Dixit
 
Multivector and multiprocessor
Multivector and multiprocessorMultivector and multiprocessor
Multivector and multiprocessor
Kishan Panara
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
LECO9
 
Lecture 4 principles of parallel algorithm design updated
Lecture 4   principles of parallel algorithm design updatedLecture 4   principles of parallel algorithm design updated
Lecture 4 principles of parallel algorithm design updated
Vajira Thambawita
 
Improving of software processes
Improving of software processesImproving of software processes
Improving of software processes
REHMAT ULLAH
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interface
Mohit Raghuvanshi
 
Resource management
Resource managementResource management
Resource management
Dr Sandeep Kumar Poonia
 

What's hot (20)

Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Advanced Techniques for Exploiting ILP
Advanced Techniques for Exploiting ILPAdvanced Techniques for Exploiting ILP
Advanced Techniques for Exploiting ILP
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
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.
 
distributed shared memory
 distributed shared memory distributed shared memory
distributed shared memory
 
Parallel processing (simd and mimd)
Parallel processing (simd and mimd)Parallel processing (simd and mimd)
Parallel processing (simd and mimd)
 
program partitioning and scheduling IN Advanced Computer Architecture
program partitioning and scheduling  IN Advanced Computer Architectureprogram partitioning and scheduling  IN Advanced Computer Architecture
program partitioning and scheduling IN Advanced Computer Architecture
 
key distribution in network security
key distribution in network securitykey distribution in network security
key distribution in network security
 
Parallel processing
Parallel processingParallel processing
Parallel processing
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
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
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
 
Multivector and multiprocessor
Multivector and multiprocessorMultivector and multiprocessor
Multivector and multiprocessor
 
INTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptxINTER PROCESS COMMUNICATION (IPC).pptx
INTER PROCESS COMMUNICATION (IPC).pptx
 
Lecture 4 principles of parallel algorithm design updated
Lecture 4   principles of parallel algorithm design updatedLecture 4   principles of parallel algorithm design updated
Lecture 4 principles of parallel algorithm design updated
 
Improving of software processes
Improving of software processesImproving of software processes
Improving of software processes
 
MPI message passing interface
MPI message passing interfaceMPI message passing interface
MPI message passing interface
 
Resource management
Resource managementResource management
Resource management
 

Similar to Unit5

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
 
01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt
HarshitPal37
 
Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mp
ranjit banshpal
 
PGAS Programming Model
PGAS Programming ModelPGAS Programming Model
PGAS Programming Model
ch adnan
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
Kunal Bangar
 
Aca2 10 11
Aca2 10 11Aca2 10 11
Aca2 10 11
Sumit Mittu
 
Aq4301224227
Aq4301224227Aq4301224227
Aq4301224227
IJERA Editor
 
message passing vs shared memory
message passing vs shared memorymessage passing vs shared memory
message passing vs shared memory
Hamza Zahid
 
Lec 2 (parallel design and programming)
Lec 2 (parallel design and programming)Lec 2 (parallel design and programming)
Lec 2 (parallel design and programming)
Sudarshan Mondal
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
Diego Perini
 
Parallel computing High performance computing .pdf
Parallel computing High performance computing .pdfParallel computing High performance computing .pdf
Parallel computing High performance computing .pdf
LadoKranjcevic1
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compiler
SVijaylakshmi
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computing
Sachin Gowda
 
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
 
Data Parallel and Object Oriented Model
Data Parallel and Object Oriented ModelData Parallel and Object Oriented Model
Data Parallel and Object Oriented Model
Nikhil Sharma
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
BishowRajBaral
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
Zvi Avraham
 
Open MP
Open MPOpen MP
Open MP
Woonhyuk Baek
 
Parallel language & compilers
Parallel language & compilersParallel language & compilers
Parallel language & compilers
dikshagupta111
 

Similar to Unit5 (20)

Lecture 2 more about parallel computing
Lecture 2   more about parallel computingLecture 2   more about parallel computing
Lecture 2 more about parallel computing
 
01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt01-MessagePassingFundamentals.ppt
01-MessagePassingFundamentals.ppt
 
Parallelization using open mp
Parallelization using open mpParallelization using open mp
Parallelization using open mp
 
PGAS Programming Model
PGAS Programming ModelPGAS Programming Model
PGAS Programming Model
 
Advanced computer architecture unit 5
Advanced computer architecture  unit 5Advanced computer architecture  unit 5
Advanced computer architecture unit 5
 
Aca2 10 11
Aca2 10 11Aca2 10 11
Aca2 10 11
 
Aq4301224227
Aq4301224227Aq4301224227
Aq4301224227
 
message passing vs shared memory
message passing vs shared memorymessage passing vs shared memory
message passing vs shared memory
 
Lec 2 (parallel design and programming)
Lec 2 (parallel design and programming)Lec 2 (parallel design and programming)
Lec 2 (parallel design and programming)
 
Doppl Development Introduction
Doppl Development IntroductionDoppl Development Introduction
Doppl Development Introduction
 
Parallel computing High performance computing .pdf
Parallel computing High performance computing .pdfParallel computing High performance computing .pdf
Parallel computing High performance computing .pdf
 
Parallel language and compiler
Parallel language and compilerParallel language and compiler
Parallel language and compiler
 
VTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computingVTU 6th Sem Elective CSE - Module 3 cloud computing
VTU 6th Sem Elective CSE - Module 3 cloud computing
 
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
 
Data Parallel and Object Oriented Model
Data Parallel and Object Oriented ModelData Parallel and Object Oriented Model
Data Parallel and Object Oriented Model
 
Cluster Computing
Cluster ComputingCluster Computing
Cluster Computing
 
Migration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming ModelsMigration To Multi Core - Parallel Programming Models
Migration To Multi Core - Parallel Programming Models
 
Open MP
Open MPOpen MP
Open MP
 
Parallel language & compilers
Parallel language & compilersParallel language & compilers
Parallel language & compilers
 

Recently uploaded

Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
mamunhossenbd75
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
Madan Karki
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
rpskprasana
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
Aditya Rajan Patra
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
RadiNasr
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
camseq
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
heavyhaig
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
insn4465
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
nooriasukmaningtyas
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
PuktoonEngr
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
gerogepatton
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
awadeshbabu
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
VICTOR MAESTRE RAMIREZ
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
IJNSA Journal
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
mahammadsalmanmech
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 

Recently uploaded (20)

Heat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation pptHeat Resistant Concrete Presentation ppt
Heat Resistant Concrete Presentation ppt
 
spirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptxspirit beverages ppt without graphics.pptx
spirit beverages ppt without graphics.pptx
 
CSM Cloud Service Management Presentarion
CSM Cloud Service Management PresentarionCSM Cloud Service Management Presentarion
CSM Cloud Service Management Presentarion
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Recycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part IIIRecycled Concrete Aggregate in Construction Part III
Recycled Concrete Aggregate in Construction Part III
 
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdfIron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
Iron and Steel Technology Roadmap - Towards more sustainable steelmaking.pdf
 
Modelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdfModelagem de um CSTR com reação endotermica.pdf
Modelagem de um CSTR com reação endotermica.pdf
 
Technical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prismsTechnical Drawings introduction to drawing of prisms
Technical Drawings introduction to drawing of prisms
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
哪里办理(csu毕业证书)查尔斯特大学毕业证硕士学历原版一模一样
 
Low power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniquesLow power architecture of logic gates using adiabatic techniques
Low power architecture of logic gates using adiabatic techniques
 
2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt2. Operations Strategy in a Global Environment.ppt
2. Operations Strategy in a Global Environment.ppt
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
[JPP-1] - (JEE 3.0) - Kinematics 1D - 14th May..pdf
 
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student MemberIEEE Aerospace and Electronic Systems Society as a Graduate Student Member
IEEE Aerospace and Electronic Systems Society as a Graduate Student Member
 
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSA SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMS
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Question paper of renewable energy sources
Question paper of renewable energy sourcesQuestion paper of renewable energy sources
Question paper of renewable energy sources
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 

Unit5

  • 1. UNIT 5UNIT 5 Parallel ProgrammingParallel Programming ModelsModels
  • 2. Parallel Programming Models Parallel Programming Models:  Data parallelism / Task parallelism  Explicit parallelism / Implicit parallelism  Shared memory / Distributed memory  Other programming paradigms • Object-oriented • Functional and logic
  • 3. 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.  Any of these models can be implemented on any underlying hardware
  • 4. Parallel Programming Models  Data Parallelism Parallel programs that emphasize concurrent execution of the same task on different data elements (data-parallel programs) • Most programs for scalable parallel computers are data parallel in nature.  Task Parallelism Parallel programs that emphasize the concurrent execution of different tasks on the same or different data • Used for modularity reasons. • Parallel programs, structured as a task-parallel composition of data- parallel components is common.
  • 5. Parallel Programming Models Data parallelism Task Parallelism
  • 6. Parallel Programming Models  Explicit Parallelism The programmer specifies directly the activities of the multiple concurrent “threads of control” that form a parallel computation. • Provide the programmer with more control over program behavior and hence can be used to achieve higher performance.  Implicit Parallelism The programmer provides high-level specification of program behavior. It is then the responsibility of the compiler or library to implement this parallelism efficiently and correctly.
  • 7. Parallel Programming Models  Shared Memory The programmer’s task is to specify the activities of a set of processes that communicate by reading and writing shared memory. • Advantage: the programmer need not be concerned with data-distribution issues. • Disadvantage: performance implementations may be difficult on computers that lack hardware support for shared memory, and race conditions tend to arise more easily  Distributed Memory Processes have only local memory and must use some other mechanism (e.g., message passing or remote procedure call) to exchange information. • Advantage: programmers have explicit control over data distribution and communication.
  • 8. Shared vs Distributed Memory  Shared memory  Distributed memory Memory Bus P P P P P P P P M M M M Network
  • 9. Parallel Programming Models Parallel Programming Tools:  Parallel Virtual Machine (PVM)  Message-Passing Interface (MPI)  High-Performance Fortran (HPF)  Parallelizing Compilers
  • 10. Parallel Programming Models Message Passing Model  Used on Distributed memory MIMD architectures  Multiple processes execute in parallel asynchronously • Process creation may be static or dynamic  Processes communicate by using send and receive primitives
  • 11. Parallel Programming Models  Blocking send: waits until all data is received  Non-blocking send: continues execution after placing the data in the buffer  Blocking receive: if data is not ready, waits until it arrives  Non-blocking receive: reserves buffer and continue execution. In a later wait operation if data is ready, copies it into the memory.
  • 12. Distributed Memory / Message Passing Model
  • 13. Parallel Programming Models  Synchronous message-passing: Sender and receiver processes are synchronized • Blocking-send / Blocking receive  Asynchronous message-passing: no synchronization between sender and receiver processes • Large buffers are required. As buffer size is finite, the sender may eventually block.
  • 14. Parallel Programming Models Advantages of message-passing model  Programs are highly portable  Provides the programmer with explicit control over the location of data in the memory Disadvantage of message-passing model  Programmer is required to pay attention to such details as the placement of memory and the ordering of communication.
  • 15. Parallel Programming Models Factors that influence the performance of message-passing model  Bandwidth  Latency  Ability to overlap communication with computation.
  • 16. Parallel Programming Models Shared Memory Model  Used on Shared memory MIMD architectures  Program consists of many independent threads  Concurrently executing threads all share a single, common address space.  Threads can exchange information by reading and writing to memory using normal variable assignment operations
  • 17. Parallel Programming Models Memory Coherence Problem  To ensure that the latest value of a variable updated in one thread is used when that same variable is accessed in another thread.  Hardware support and compiler support are required  Cache-coherency protocol Thread 1 Thread 2 X
  • 18. Parallel Programming Models Synchronization operations in Shared Memory Model  Monitors  Locks  Critical sections  Condition variables  Semaphores  Barriers
  • 20. Data Parallel Model  It require extension use of pre distributed data sets.  Inter connected data structure are also needed to facilitate the data exchange operations  It emphasize on the local computations and performs several data routing operations like replication, reduction, etc
  • 21. Data Parallel Model  The data parallel model demonstrates the following characteristics: • Most of the parallel work focuses on performing operations on a data set. • The data set is typically organized into a common structure, such as an array or cube. • A set of tasks work collectively on the same data structure, however, each task works on a different partition of the same data structure.
  • 22. Data Parallel Model • Tasks perform the same operation on their partition of work, for example, "add 4 to every array element". • On shared memory architectures, all tasks may have access to the data structure through global memory. • On distributed memory architectures the data structure is split up and resides as "chunks" in the local memory of each task.
  • 24.
  • 25.
  • 26.
  • 27. Parallel language and compilers  They are different as compared to the sequential language.  More focus is given on the hardware as compared to the program parallelism using high level of abstraction.
  • 28. Parallel language and compilers  Language features • Algorithm design : the problem must be decomposable so that it can be breakup in the part and can work in parallel. • Programming Language: language needs specific statements for implementing the parallel algorithm • Parallel Computer : the computer or network of computers needs hardware capabilities for a real parallel running of the program.
  • 29. Examples of the parallel language  FORTRAN  JAVA  C++  C*: C extended for parallelism
  • 30. Parallel Compilers  It Automatically Transform the sequential program into parallel program  It identify the loops whose iteration can be executed in parallel whenever possible.  It often uses stages and concepts of data dependencies.
  • 31. Steps involve in creating parallel program  Decomposition : • breakup computation in tasks  Assignment: • involve mechanism to divide work among process,  Orchestration : • Naming data, structure communication, synchronization, organization data structure and scheduling the task, data access , communication and synchronization  Mapping : processes to processors