Lecture 13 - Programming Models
Lecture 13 - Programming Models
Lecture 13
Programming Models
Parallel Programming Model
• Parallel programming models exist as an abstraction of hardware and
memory architectures.
• In fact, these models are not specific and do not refer to particular types
of machines or memory architectures.
• They can be implemented (at least theoretically) on any kind of
machines.
• Compared to the previous subdivisions, these programming models are
made at a higher level and represent the way in which the software
must be implemented to perform a parallel computation.
• Each model has its own way of sharing information with other
processors in order to access memory and divide the work.
Parallel Programming Model
• Most widely used models are discussed here
• Data Parallel Model
• Task Parallel Model
• Process-Centric Model
• Shared/Distributed Memory Model
Data Parallel Model
• In data parallel model, tasks are assigned to processes and each task
performs similar types of operations on different data.
• Data parallelism is a consequence of single operations that is being
applied on multiple data items.
• Many programs apply the same operation on different parts of the
common structure
Data Parallel Model
Data Parallel Model
Example
• Suppose the task is to add two arrays of 100 elements store the result in
another array. If there are four processor then each processor can do 25
additions.
Data Parallel Model
• The primary characteristic of data-parallel model problems is that the
intensity of data parallelism increases with the size of the problem,
which in turn makes it possible to use more processes to solve larger
problems.