Docsity

Parallel Programming: Understanding Shared Memory Model vs Message Passing Model, Slides of Parallel Computing and Programming

Partial preview of the text

Download Parallel Programming: Understanding Shared Memory Model vs Message Passing Model and more Slides Parallel Computing and Programming in PDF only on Docsity!

Parallel Programming*

Shared Memory Model vsMessage Passing model

MIMD platforms Prog Models

- MPMD vs SPMD

-^

Sequential programming language and askparallelizing compiler to convert it into parallelexecutable code. (Implicit or explicit)

-^

Sequential programming language with addedsyntax to declare shared variables and specifyparallelism. Example UPC (Unified Parallel C) -needs a UPC compiler.(explicit)

-^

Parallel programming language with syntax toexpress parallelism - compiler creates executablecode for each processor. (explicit)

Programming Parallel Machines

docsity.com

Programming Message Passing

Multicomputer / Cluster

•^

These platforms are programmed using messagesend and receive primitives (also need whoamI &numproc).

-^

Message Passing Parallel Programming options:– Parallel Virtual Machine (PVM) - developed in late 1980’s.

Became very popular.

  • Message-Passing Interface (MPI) - standard defined in

1990s. Presently most popular option.

•^

Both provide a set of user-level libraries for messagepassing. Used with regular programming languages(C, C++, ...). We will use MPI.

docsity.com

Message Passing Programming:

Generic Program Concepts

•^

Send & Receive Primitive

-^

Blocked Send/ Receive:

Synchronous

•^

Send/ Receive: Asynchronous

( p – 1 )

(N > p) & (N div by p)

(p – 1)

(N > p) & (N NOT div by p)

(N > p) & (N NOT div by p)