Programming Paradigms and Algorithms
W+A 3.1, 3.2, p. 178, 5.1, 5.3.3, Chapter 6, 9.2.8, 10.4.1,
Kumar 12.1.3
1. Berman, F., Wolski, R., Figueira, S., Schopf, J. and Shao, G., "Application-Level Scheduling on Distributed Heterogeneous Networks," Proceedings of Supercomputing '96
(http:apples.ucsd.edu)
CSE 160/Berman
Common Parallel Programming Paradigms
CSE 160/Berman
Regular, Iterative Stencil Applications
Loop until some condition is true
Perform computation �which involves�communicating with �N,E,W,S neighbors�of a point �(5 point stencil)
[Convergence test?]
CSE 160/Berman
Stencil Example: Jacobi2D
CSE 160/Berman
Jacobi 2D Strategy
where the values from the (k-1)st iteration are used to compute the values for the kth iteration
CSE 160/Berman
Jacobi 2D
CSE 160/Berman
�La Place’s Equation
CSE 160/Berman
�La Place’s Equation
Any update will involve only local communication!
CSE 160/Berman
(x,y)
(x+Δ,y)
(x-Δ,y)
(x,y+Δ)
(x,y-Δ)
Solving La Place using Jacobi strategy
CSE 160/Berman
Solving La Place using Jacobi strategy
becomes
CSE 160/Berman
Working backward
CSE 160/Berman
Finding the A matrix
CSE 160/Berman
N=9, n=3:
Jacobi Implementation Strategy
error threshold.
CSE 160/Berman
Data Parallel Jacobi 2D Pseudo-code
[Initialize ghost regions]
for (i=1; i<=N; i++)
x[0][i] = north[i];
x[N+1][i] = south[i];
x[i][0] = west[i];
x[i][N+1] = east[i];
[Initialize matrix]
for (i=1; i<=N; i++)
for (j=1; j<=N; j++)
x[i][j] = initvalue;
[Iterative refinement of x until values converge]
while (maxdiff > CONVERG)
[Update x array]
for (i=1; i<=N; i++)
for (j=1; j<=N; j++)
newx[i][j] = ¼ (x[i-1][j] + x[i][j+1] + x[i+1][j] + x[i][j-1]);
[Convergence test]
maxdiff = 0;
for (i=1; i<=N; i++)
for (j=1; j<=N; j++)
maxdiff = max(maxdiff, |newx[i][j]-x[i][j]|);
x[i][j] = newx[i][j];
CSE 160/Berman
Jacobi2D Programming Issues
CSE 160/Berman
Jacobi2D Programming Issues
CSE 160/Berman
Block
Uniform Strip
Non-uniform Strip
HPF-Style Data Decompositions
CSE 160/Berman
Block
Cyclic
Block-cyclic
HPF-Style Data Decompositions
CSE 160/Berman
[Block, Block]
[Block, *]
[* , Cyclic]
Jacobi on a Cluster
CSE 160/Berman
Jacobi AppLeS
CSE 160/Berman
How Does AppLeS Work?
CSE 160/Berman
Grid � Infrastructure
NWS
Schedule �Deployment
Resource �Discovery
Resource �Selection
Schedule�Planning�and �Performance�Modeling
Decision�Model
accessible �resources
feasible �resource sets
evaluated�schedules
“best” �schedule
AppLeS + application
= self-scheduling � application
Resources
Network Weather Service (Wolski, �U. Tenn.)
CSE 160/Berman
Sensor Interface
Reporting Interface
Forecaster
Model 2
Model 3
Model 1
Jacobi2D AppLeS Resource Selector
D[locus,X] = |comp[unit,locus]-comp[unit,X]| + comm[W,E columns]
CSE 160/Berman
Jacobi2D Performance Model and �Schedule Planning
Execution time for ith strip
where load = predicted percentage of CPU time available (NWS)
comm = time to send and receive messages factored by
predicted BW (NWS)
AppLeS uses time-balancing �to determine best partition on �a given set of resources
Solve
for
CSE 160/Berman
P1
P2
P3
Jacobi2D Experiments
CSE 160/Berman
Jacobi2D AppLeS Experiments
CSE 160/Berman