Embarrassingly Parallel Computations processes …….. Input data results Each process requires different data and produces results from its input without.

Slides:



Advertisements
Similar presentations
PRAM Algorithms Sathish Vadhiyar. PRAM Model - Introduction Parallel Random Access Machine Allows parallel-algorithm designers to treat processing power.
Advertisements

Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Prepared 7/28/2011 by T. O’Neil for 3460:677, Fall 2011, The University of Akron.
Practical techniques & Examples
4.1 Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M.
Chess Problem Solver Solves a given chess position for checkmate Problem input in text format.
Partitioning and Divide-and-Conquer Strategies Cluster Computing, UNC-Charlotte, B. Wilkinson, 2007.
§3 Compare the Algorithms 〖 Example 〗 Given (possibly negative) integers A 1, A 2, …, A N, find the maximum value of Max sum is 0 if all the integers.
COMPE472 Parallel Computing Embarrassingly Parallel Computations Partitioning and Divide-and-Conquer Strategies Pipelined Computations Synchronous Computations.
Embarrassingly Parallel (or pleasantly parallel) Domain divisible into a large number of independent parts. Minimal or no communication Each processor.
Computational Physics Lecture 4 Dr. Guy Tel-Zur.
CSE 160/Berman Programming Paradigms and Algorithms W+A 3.1, 3.2, p. 178, 6.3.2, H. Casanova, A. Legrand, Z. Zaogordnov, and F. Berman, "Heuristics.
EECC756 - Shaaban #1 lec # 8 Spring Message-Passing Computing Examples Problems with a very large degree of parallelism: –Image Transformations:
Embarrassingly Parallel Computations Partitioning and Divide-and-Conquer Strategies Pipelined Computations Synchronous Computations Asynchronous Computations.
CS150 Introduction to Computer Science 1
Lesson2 Point-to-point semantics Embarrassingly Parallel Examples.
Pipelined Computations Divide a problem into a series of tasks A processor completes a task sequentially and pipes the results to the next processor Pipelining.
Characteristics of Embarrassingly Parallel Computations Easily parallelizable Little or no interaction between processes Can give maximum speedup.
Embarrassingly Parallel Computations Partitioning and Divide-and-Conquer Strategies Pipelined Computations Synchronous Computations Asynchronous Computations.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Monte Carlo Simulation Used when it is infeasible or impossible to compute an exact result with a deterministic algorithm Especially useful in –Studying.
1 CS4402 – Parallel Computing Lecture 7 Parallel Graphics – More Fractals Scheduling.
Exercise problems for students taking the Programming Parallel Computers course. Janusz Kowalik Piotr Arlukowicz Tadeusz Puzniakowski Informatics Institute.
1 CS4402 – Parallel Computing Lecture 6 MPE Library – Graphics in MPI. Parallel Computer Graphics.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Computer Science 320 Load Balancing for Hybrid SMP/Clusters.
Greedy Backtracking ? ? ? ?.  Fast, low complexity, gives acceptable solution (not necessarily the best)  At each step choose the best option considering.
Scientific Computing Lecture 5 Dr. Guy Tel-Zur Autumn Colors, by Bobby Mikul, Mikul Autumn Colors, by Bobby Mikul,
1 MPI: Message-Passing Interface Chapter 2. 2 MPI - (Message Passing Interface) Message passing library standard (MPI) is developed by group of academics.
Chapter 3 Parallel Algorithm Design. Outline Task/channel model Task/channel model Algorithm design methodology Algorithm design methodology Case studies.
CS320n –Visual Programming More LabVIEW Control Structures.
CSC 7600 Lecture 15: Applied Parallel Algorithms 1, Spring 2011 HIGH PERFORMANCE COMPUTING: MODELS, METHODS, & MEANS APPLIED PARALLEL ALGORITHMS 1 Prof.
C++ Tutorial Hany Samuel and Douglas Wilhelm Harder Department of Electrical and Computer Engineering University of Waterloo Copyright © 2006 by Douglas.
Pipelined Computations P0P1P2P3P5. Pipelined Computations a s in s out a[0] a s in s out a[1] a s in s out a[2] a s in s out a[3] a s in s out a[4] for(i=0.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Embarrassingly Parallel Computations Partitioning and Divide-and-Conquer Strategies Pipelined Computations Synchronous Computations Asynchronous Computations.
Decomposition Data Decomposition – Dividing the data into subgroups and assigning each piece to different processors – Example: Embarrassingly parallel.
Message Passing and MPI Laxmikant Kale CS Message Passing Program consists of independent processes, –Each running in its own address space –Processors.
Computer Science 320 Load Balancing with Clusters.
1 BİL 542 Parallel Computing. 2 Message Passing Chapter 2.
CSCI-455/552 Introduction to High Performance Computing Lecture 9.
12.1 Parallel Programming Types of Parallel Computers Two principal types: 1.Single computer containing multiple processors - main memory is shared,
Master/Workers Model Example Research Computing UNC - Chapel Hill Instructor: Mark Reed
Embarrassingly Parallel (or pleasantly parallel) Characteristics Domain divisible into a large number of independent parts. Little or no communication.
Computer Science 320 Reduction. Estimating π Throw N darts, and let C be the number of darts that land within the circle quadrant of a unit circle Then,
Int fact (int n) { If (n == 0) return 1; else return n * fact (n – 1); } 5 void main () { Int Sum; : Sum = fact (5); : } Factorial Program Using Recursion.
Suzaku Pattern Programming Framework (a) Structure and low level patterns © 2015 B. Wilkinson Suzaku.pptx Modification date February 22,
Operator Overloading What is operator overloading? Most predefined operators (arithmetic, logic, etc.) in C++ can be overloaded when applied to objects.
Parallel Computing Chapter 3 - Patterns R. HALVERSON MIDWESTERN STATE UNIVERSITY 1.
Embarrassingly Parallel Computations
Parallel Computers Chapter 1.
Embarrassingly Parallel (or pleasantly parallel)
Problem Solving Strategies
Parallel Techniques之 易并行计算
Using compiler-directed approach to create MPI code automatically
Embarrassingly Parallel
COMPUTER 2430 Object Oriented Programming and Data Structures I
Counting Loops.
Lecture 12 Oct 16, 02.
Histogram Equalization with Cell Broadband Engine™
CSC4005 – Distributed and Parallel Computing
Introduction to parallelism and the Message Passing Interface
Monte Carlo Methods A so-called “embarrassingly parallel” computation as it decomposes into obviously independent tasks that can be done in parallel without.
Computer Programming Techniques Semester 1, 1998
Introduction to High Performance Computing Lecture 7
Parallel Techniques • Embarrassingly Parallel Computations
Embarrassingly Parallel Computations
Parallel Algorithm Models
Load Balancing Definition: A load is balanced if no processes are idle
Introduction to Programming
Presentation transcript:

Embarrassingly Parallel Computations processes …….. Input data results Each process requires different data and produces results from its input without any results from other processes

Embarrassingly Parallel Computations …….. Collect results send initial data slaves recv() send() spawn() send() recv() Master

Geometrical Transformations of images (a)Shift (b) Scaling © Rotation (d) Clipping

Geometrical Transformations of images process map

Geometrical Transformations of images process 10

Geometrical Transformations of images Master for(i=0, row; i<48 ; i++, row = row +10) send(row, Pi); for(i=0 ; i<480 ; i++) for(j=0 ; j<640 ; j++) temp_map[i][j] = 0; for(i=0 ; I<(640*480) ; i++){ recv(oldrow, oldcol, newcol, Pany); if(!((newrow =480)||(new =640))) temp_map[newrow][newcol]=map[oldrow][oldcol]; } for(i=0 ; i<480 ; i++) for(j=0 ; j<640 ; j++) map[i][j] = temp_map[i][j];

Geometrical Transformations of images Slave recv(row, Pmaster); for(oldrow = row ; oldrow<(row+10) ; oldrow++) for(oldcol=0 ; oldcol<640 ; oldcol++){ newrow = oldrow + delta_x; newcol = newcol + delta_y; send(oldrow, oldcol, newrow, newcol, Pmaster); }

Geometrical Transformations of images Analysis communication computation

Mandelbrot Set

int cal_pixel(complex c) { int count, max; complex z; float temp, lengthsq; max = 256; z.real = 0; z.imag = 0; count = 0; do{ temp = z.real *z.real - z.imag * z.imag; z.real = temp; lengthsq = z.real * z.real + z.imag * z.imag; count++; }while((length<4.0)&&(count<max)); return count; } struct complex{ float real; float imag; }; Sequential code

Mandelbrot Set Sequential code c.real = real_min + x * (real_max - real_min) / disp_height; c.imag = imag_min + y * (imag_max - imag_min) / disp_width; scale_real = (real_max - real_min) / disp_height; scale_imag = (imag_max - imag_min) / disp_width; for(x=0 ; x < disp_width ; x++) for(y=0 ; y < disp_height ; y++){ c.real = real_min + ((float) x * scale_real); c.imag = imag_min + ((float) y * scale_imag); color = cal_pixel(c); display(x, y, color); }

Mandelbrot Set Static Task Assignment Master : for(i=0, row=0 ; i<48 ; i++, row = row + 10) sned(&row, Pi) for(i=0 ; i < (480*640) ; i++){ recv(&c, &color, Pany); display(c, color); } Slave recv(&row, Pmaster); for( x=0 ; x< disp_width ; x++) for(y=0 ; y < (row+10) ; y++){ c.real = min_real + ((float)x*scale_real); c.imag = min_imag + ((float)y*scale_imag); color = cal_pixel(c); send(&c, &color, Pmaster); }

Mandelbrot Set Dynamic Task Assignment Work pool.(x a, y a ).(x b, y b ).(x c, y c ).(x d, y d ).(x e, y e ) ………….

Mandelbrot Set Dynamic Task Assignment Master: recv(&slave, &r, color, Pany, result_tag) count--; if( row<disp_height ){ sned(&row, Pslave, data_tag); row++; count++; }else send(&row, Pslave, terminator_tag); row_recv++; disply(r, color); }while(count>0); Slave: recv(y, Pmaster, ANYTAG, source_tag); while( source_tag == data_tag){ c.imag = imag_min + ((float)y*scale_imag); for(x=0 ; x<width ; x++){ c.real = real_min + ((float)x*scale_real); color[x] = cal_pixel(c); } send(&i, &y, color, Pmaster, result_tag); recv(y, Pmaster, source_tag); };

Mandelbrot Set Dynamic Task Assignment terminate Row returned decrement Row sent increment disp_height

Mandelbrot Set Phase I Phase II Phase III

Monte Carlo Methods 2 2

1 1 x

sum=0; for(i=0; i<N ; i++) xr = rand_v(x1, x2); sum = sum + xr * xr – 3 * xr; } Area = sum / N; Sequential Code

Monte Carlo Methods Parallel Code Master Slaves Partial sum random number process Master for(i=0 ; i<N/n ; i++){ for(j=0 ; j< n ; j++) xr[j] = rand(); recv(Pany, reg_tag, Psource); send(xr, &n, Psource, compute_tag); } for(i=0 ; i<slave_no ; i++){ recv(Pi, reg_tag); send(Pi, stop_tag); } sum=0; reduce_add(&sum, Pgroup);

Monte Carlo Methods Parallel Code Master Slaves Partial sum random number process Slave sum=0; send(Pmaster, reg_tag); recv(xr, &n, Pmaster, source_tag); while(source_tag == compute_tag){ for(i=0 ; i<n ; i++) sum = sum + xr[i] * xr[i] - 3 * xr[i]; send(Pmaster, reg_tag); recv(xr, &n, Pmaster, source_tag); }; reduce_add(&sum, Pgroup);