This preview shows pages 1–9. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Computational Model Design Methodology Example Parallel Numerical Algorithms Chapter 2 Parallel Algorithm Design Prof. Michael T. Heath Department of Computer Science University of Illinois at UrbanaChampaign CSE 512 / CS 554 Michael T. Heath Parallel Numerical Algorithms 1 / 36 Computational Model Design Methodology Example Outline 1 Computational Model 2 Design Methodology Partitioning Communication Agglomeration Mapping 3 Example Michael T. Heath Parallel Numerical Algorithms 2 / 36 Computational Model Design Methodology Example Computational Model Task : sequential program and its local storage Parallel computation : two or more tasks executing concurrently Communication channel : link between two tasks over which messages can be sent and received send is nonblocking : sending task resumes execution immediately receive is blocking : receiving task blocks execution until requested message is available Michael T. Heath Parallel Numerical Algorithms 3 / 36 Computational Model Design Methodology Example Example: Laplace Equation in 1D Consider Laplace equation in 1D u 00 ( t ) = 0 on interval a < t < b with BC u ( a ) = , u ( b ) = Seek approximate solution values u i u ( t i ) at mesh points t i = a + ih , i = 0 ,...,n + 1 , where h = ( b a ) / ( n + 1) Michael T. Heath Parallel Numerical Algorithms 4 / 36 Computational Model Design Methodology Example Example: Laplace Equation in 1D Finite difference approximation u 00 ( t i ) u i +1 2 u i + u i 1 h 2 yields tridiagonal system of algebraic equations u i +1 2 u i + u i 1 h 2 = 0 , i = 1 ,...,n, for u i , i = 1 ,...,n , where u = and u n +1 = Starting from initial guess u (0) , compute Jacobi iterates u ( k +1) i = u ( k ) i 1 + u ( k ) i +1 2 , i = 1 ,...,n, for k = 1 ,... until convergence Michael T. Heath Parallel Numerical Algorithms 5 / 36 Computational Model Design Methodology Example Example: Laplace Equation in 1D Define n tasks, one for each u i , i = 1 ,...,n Task i stores initial value of u i and updates it at each iteration until convergence To update u i , necessary values of u i 1 and u i +1 obtained from neighboring tasks i 1 and i + 1 u 1 u 2 u 3 u n Tasks 1 and n determine u and u n +1 from BC Michael T. Heath Parallel Numerical Algorithms 6 / 36 Computational Model Design Methodology Example Example: Laplace Equation in 1D initialize u i for k = 1 ,... if i > 1 , send u i to task i 1 if i < n , send u i to task i + 1 if i < n , recv u i +1 from task i + 1 if i > 1 , recv u i 1 from task i 1 wait for sends to complete u i = ( u i 1 + u i +1 ) / 2 end { send to left neighbor } { send to right neighbor } { receive from right neighbor } { receive from left neighbor } { update my value } Michael T. Heath Parallel Numerical Algorithms 7 / 36 Computational Model Design Methodology Example Mapping Tasks to Processors Tasks must be assigned to physical processors for execution Tasks can be mapped to processors in various ways, including multiple tasks per processor...
View Full
Document
 Summer '09
 STAFF
 Algorithms

Click to edit the document details