PARALLEL PROGRAMMING MODEL
•The model of a parallel algorithm is developed by considering a
strategy for dividing the data and processing method and applying to
reduce interactions.
SHARED VARIABLE MODEL
1. A program is a collection of processes.
parallelism depend on how inter –process
communication is implemented.
2. Multiprocessor programming is based on the
use of shared variables in a common memory
for ipc (inter process communication).
3. Shared variable ipc demands the use of shared
memory and mutual exclusion among multiple
process accessing the same set of variable.
Block diagram of shared
varibale communication
process
A
Shared variable
in common
memory
Process
B
ProcessC
Issues with shared variable
1. Critical section problem
2. Memory consistency
3. Atomicity with memory operation
4. Fast synchronization
5. Shared data structure
MESSAGE PASSING MODEL
 Two process A and B communicate with each
other by passing message through a direct
network.
 The messages may be data ,instruction ,
synchronization or interrupt signals etc.
 delay cause by a message is much more
longer than a shared variable model in a same
memory.
ProcessA Process B
 Two message passing programming models are introduced
here.
1. SYNCHRONUS MESSAGE PASSING
2. ASYNCHRONUS MESSAGE PASSING
3. synchronous message passing: it synchronizes the sender
and receiver process with time and space just like
telephone.
4. No shared memory
5. No need of mutual exclusion
6. No buffer is used in communication channel
7. It can be block by channel being busy or error
8. One message is allowed to be transmitted via a channel at
a time
 Sender and receiver must be coupled in both
time and space
 Also called blocking communication scheme
ASYNCHRONOUS MESSAGE PASSING:
Does not need to synchronize the sender and
receiver in time and space
Non –blocking can be achieved
Buffer are used to hold the message along the
path of connecting channel
DATA PARALLEL MODEL
 The data parallel code is easier to write and
debug because the parallelism explicitly is
handled by hardware synchronization and
control flow
 Data parallel languages can be directly
modified from standard serial programming
languages
 Data parallel programming emphasizes local
computation and data routing , replication
,reduction and parallel prefix
 It is applied to fine grain problems using regular grids
,stencils and multidimensional signal /image data
sets.
 In data parallel model tasks are assigned to the
process and each task perform similar type of
operation on different data
 Data parallel model can be applied on shared-
address space , message passing paradigms
 The primary characteristic of data parallel model
problems is that the intensity of data parallelism
increases with the size of problem which in turn
makes it possible to use more processes to solve
larger.
Example: dense matrix
multip.
Processor 1
Processor 2
Processor 4
Processor 3
Memory
unit
Control unit
Object oriented model
 In this model objects are dynamically created
and manipulated
 Processing Is performed by sending and
receiving messages among objects
 concurrent programming models are built up
from low level objects such as queues ,
semaphores and process into high level object
like monitor and program modules
 Program abstraction lead to program modularity
and software reusability as is often found in oop
 Other areas have encouraged the growth of
oop include the CAD tools and word
processors with graphics capability
 The idea behind parallel object oriented
programming is to provide suitable
abstractions and software engineering
methods for structured application design
 Processing is performed using object
FUNCTONAL AND LOGIC MODELS
 Functional programming languages such as
pure , lisp , sisal , strand 88.
 A functional programming language
emphasizes the functionality of program and
should not produce side affects after
execution
 There is no concept of storage ,assignment
and branching programs
 It is used in artificial intelligence where
parallel processing is verymuch in demand
Logic models
 Logic programming languages such as
concurrent space prolog and parlog
 Based on predicate logic , logic programming
is suitable for knowledge processing deal
with large database

Parallel programming model

  • 1.
    PARALLEL PROGRAMMING MODEL •Themodel of a parallel algorithm is developed by considering a strategy for dividing the data and processing method and applying to reduce interactions.
  • 2.
    SHARED VARIABLE MODEL 1.A program is a collection of processes. parallelism depend on how inter –process communication is implemented. 2. Multiprocessor programming is based on the use of shared variables in a common memory for ipc (inter process communication). 3. Shared variable ipc demands the use of shared memory and mutual exclusion among multiple process accessing the same set of variable.
  • 3.
    Block diagram ofshared varibale communication process A Shared variable in common memory Process B ProcessC
  • 4.
    Issues with sharedvariable 1. Critical section problem 2. Memory consistency 3. Atomicity with memory operation 4. Fast synchronization 5. Shared data structure
  • 5.
    MESSAGE PASSING MODEL Two process A and B communicate with each other by passing message through a direct network.  The messages may be data ,instruction , synchronization or interrupt signals etc.  delay cause by a message is much more longer than a shared variable model in a same memory. ProcessA Process B
  • 6.
     Two messagepassing programming models are introduced here. 1. SYNCHRONUS MESSAGE PASSING 2. ASYNCHRONUS MESSAGE PASSING 3. synchronous message passing: it synchronizes the sender and receiver process with time and space just like telephone. 4. No shared memory 5. No need of mutual exclusion 6. No buffer is used in communication channel 7. It can be block by channel being busy or error 8. One message is allowed to be transmitted via a channel at a time
  • 7.
     Sender andreceiver must be coupled in both time and space  Also called blocking communication scheme ASYNCHRONOUS MESSAGE PASSING: Does not need to synchronize the sender and receiver in time and space Non –blocking can be achieved Buffer are used to hold the message along the path of connecting channel
  • 8.
    DATA PARALLEL MODEL The data parallel code is easier to write and debug because the parallelism explicitly is handled by hardware synchronization and control flow  Data parallel languages can be directly modified from standard serial programming languages  Data parallel programming emphasizes local computation and data routing , replication ,reduction and parallel prefix
  • 9.
     It isapplied to fine grain problems using regular grids ,stencils and multidimensional signal /image data sets.  In data parallel model tasks are assigned to the process and each task perform similar type of operation on different data  Data parallel model can be applied on shared- address space , message passing paradigms  The primary characteristic of data parallel model problems is that the intensity of data parallelism increases with the size of problem which in turn makes it possible to use more processes to solve larger.
  • 10.
    Example: dense matrix multip. Processor1 Processor 2 Processor 4 Processor 3 Memory unit Control unit
  • 11.
    Object oriented model In this model objects are dynamically created and manipulated  Processing Is performed by sending and receiving messages among objects  concurrent programming models are built up from low level objects such as queues , semaphores and process into high level object like monitor and program modules  Program abstraction lead to program modularity and software reusability as is often found in oop
  • 12.
     Other areashave encouraged the growth of oop include the CAD tools and word processors with graphics capability  The idea behind parallel object oriented programming is to provide suitable abstractions and software engineering methods for structured application design  Processing is performed using object
  • 13.
    FUNCTONAL AND LOGICMODELS  Functional programming languages such as pure , lisp , sisal , strand 88.  A functional programming language emphasizes the functionality of program and should not produce side affects after execution  There is no concept of storage ,assignment and branching programs  It is used in artificial intelligence where parallel processing is verymuch in demand
  • 14.
    Logic models  Logicprogramming languages such as concurrent space prolog and parlog  Based on predicate logic , logic programming is suitable for knowledge processing deal with large database