NikhilSharma779
1,261 views
38 slides
Nov 18, 2019
Slide 1 of 38
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
About This Presentation
All the content is taken from Advance Computer Architecture book. Which (10.1.3 and 10.1.4)
This PPT covers the basics of Data-Parallel Model and Object-Oriented Model.
Size: 4.08 MB
Language: en
Added: Nov 18, 2019
Slides: 38 pages
Slide Content
Data Parallel Model An Overview
Content taken from. A book by Naresh Jotwani & Kai Hwang
Slide 3 Part IV Software for Parallel Programming Chapter 10). Parallel Models, Languages, and Compilers Parallel Programming Models 10.1.1 Shared Variable Model 10.1.2 Message Passing Model
Special Thanks to Dr. Preeti Aggarwal ASSISTANT PROFESSOR Tutorials Point
Data-Parallel Model Created and presented by: Nikhil Sharma M.E CSE 1 st year Roll no (19-311) July 2019- Dec 2019 Session
Title Anatomy Data Parallel Model
Programming Model A collection of program abstractions providing a programmer a simplified and transparent view of the computer Hardware/software system . Parallel programming models are specifically designed for multiprocessors, multicomputer, or vector SIMD computers.
Lockstep Operation this Provides Atomicity State 1--------- State 2 Nothing in b/w set of changes (new inputs, new outputs, new state)
SIMD Parallelism is explicitly handled by hardware synchronization and flow control. Choice of Data structure Figure courtesy: [2] Main Focus ( local computations and data routing operation)
Where data-parallel programming is used ? Fine Grain Figure courtesy : ACA, Naresh kotwani
Single Instruction, Multiple Data (SIMD) Single instruction: All processing units execute the same instruction at any given clock cycle Multiple data: Each processing unit can operate on a different data element Best suited for specialized problems characterized by a high degree of regularity, such as image processing. Two varieties: Processor Arrays and Vector Pipelines Examples : Processor Arrays : Connection Machine CM-2, Maspar MP-1, MP-2 Vector Pipelines: IBM 9000, Cray C90, Fujitsu VP, NEC SX-2, Hitachi S820
Simplified View Figure courtesy: [1]
Data parallelism If you want to see data parallelism SIMD SPMD Multicomputer
Data parallelism Challenge Matching of problem size with fixed machine size Ex. Partitioning of large arrays or matrixes in to 64 –element segments. SCIENTIST BE LIKE
Synhronization Data – parallel operation is done at COMPILE TIME Instead of RUN TIME Hardware synchronization: Enforced by control unit and LOCKSTEP execution.
Synchronous SIMD Lockstep fashion Do not have mutual exclusion or synchronization problem associated with multiprocessors or multicomputer Inter-PE directly controlled by hardware Inter-PE data communication is also carried by lockstep Spatial Parallelism
Parallelism Example What is the latency and throughput if Ben uses parallelism? Spatial parallelism: Ben asks Allysa to help, using her own oven Temporal parallelism: Ben breaks the task into two stages: roll and baking. He uses two trays. While the first batch is baking he rolls the second batch, and so on.
SIMD--- SCALAR v/s VECTOR Scalar are directly executed by the control unit. Vector are broadcast to all processing elements. (because vector operands are located at different location-PE)
Array Language Extensions Array extensions in data parallel languages are represented by high-level data types. Enables the removal of some nested loops in the code. global address space , which obviates the need for explicit data routing between PEs In computer science , array programming refers to solutions which allow the application of operations to an entire set of values at once. Such solutions are commonly used in scientific and engineering settings. (source wiki ) Fortan 77
Compiler Support facilitate precise control of massively parallel hardware, and enable incremental migration to data-parallel execution. Compiler-optimized control of SIMD machine hardware allows the programmer to drive the PE array transparently. The compiler must separate the program into scalar and parallel components and integrate with the OS environment. array extensions to optimize data placement, minimize data movement, and virtualize the dimensions of the PE array. The compiler generates data-parallel machine code to perform operations on arrays.
Array sectioning allows a programmer to reference a section or a region of a multidimensional array. Array sections are designated by specifying a start index, a bound, and a stride. Vector-valued subscripts arc often used to construct arrays from arbitrary permutations of another array. These expressions are vectors that map the desired elements into the target array. They facilitate the implementation of gather and scatter operations on a vector of indices.
SPMD programs are a special class of SIMD programs which emphasize medium-grain parallelism and synchronization at the subprogram level rather than at the instruction level.
What was covered ? Lockstep operation SIMD (data parallel model) Synchronization Spatial Parallelism SIMD--- SCALAR v/s VECTOR Array Language ( Fortan 77 ) and extension Compiler support
Q & A
Slide 3 Part IV Software for Parallel Programming Chapter 10). Parallel Models, Languages, and Compilers Parallel Programming Models 10.1.1 Shared Variable Model 10.1.2 Message Passing Model Covered 10.1.3 Data- Parallel Model 10.1 .4 Object-Oriented Model
In this model In this model, objects are dynamically created and manipulated. Concurrent programming models are built up from low-level objects such as processes , queues , and semaphores into high level objects like monitors and program modules.
Concurrent Object First increased use of interacting processes by individual users Second workstation networks have become a cost-effective mechanism for resource sharing and distributed problem solving Third multiprocessor technology in several variants has advanced to the point of providing supercomputing power at a fraction of the traditional cost.
Program abstraction Program modularity and software reusability as is commonly experienced with OOP Objects Program entities which encapsulate data and operations into single computational units.
An Actor Model Message passing is attached with semantics Create: Creating an actor from a behavior description and a set of parametric. Send-to: Sending a message to another actor. Become: An actor replacing its own behavior by a new behavior
Parallelism in COOP Pipeline concurrency involves the overlapped enumeration of successive solutions and concurrent testing of the solutions as they emerge from an evaluation pipeline. Divide-and-conquer concurrency Example A prime-number generation pipeline in Integer numbers are generated and successively tested for divisibility by previously generated primes in a linear pipeline of primes .
Example 10.2 Concurrency in object-oriented programming Integer numbers are generated and successively tested for divisibility by previously generated primes in a linear pipeline of primes.
Multiplication of a list of numbers [10, 7, -2, 3, 4, -11, -3] using a divide and-conquer approach Figure courtesy: ACA a book by Jotwani
Q & A
References Introduction to Parallel Computing [1]. https://computing.llnl.gov/tutorials/parallel_comp/#ModelsData Programming Models [2]. https://ict.senecacollege.ca/~gpu621/pages/content/model.html Data parallelism [3]. https://en.wikipedia.org/wiki/Data_parallelism