



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Data dependence in parallel loops, focusing on forall, dopar, and dosingle loops. It explains how data access conflicts are resolved, the semantics of each loop type, and the concept of a program dependence graph (pdg). The document also covers data dependence analysis for arrays and building dependence systems.
Typology: Slides
1 / 7
This page cannot be seen from the preview
Don't miss anything!
Two statements or loops have data access conflict when they refer to the same location It is resolved by completing the first access before initiating the second one
Each statement computes rhs for all index values before store forall i = 2 to 10 do x[i] = x[i-1] + x[i+1] endall If it were a sequential loop flow dependence from x[i] to x[i-1] anti dependence from x[i+1] to x[i] Semantics of forall loop Fetch all old values before writing therefore, no flow dependence Two anti dependence from S to S with distances (-1, 1)
Each iteration starts with copies of variables with the values available before the loop Value computed in one iteration can not be fetched in another iteration If there is conflict between two stores, language model does not resolve. It is likely to be a programmer error
Control dependence edges in data dependence graph.
S (^1) S (^2) S (^3) S (^4) S (^5) S (^6) S (^7) S (^8)
if Y < T then X = 2 else Y = X endif Z = X + Y
Concentrate on linear subscripts:
Linear Non-Linear
Linear & Non-Linear
[I * J], [I/J], [mod(I, 2) + 1] [IP[I] + 1] [2 * I - 1, I * J]
In case of non-linear subscripts Ignore the subscript Use special solvers(very little work available)
Form dependence equations Unknowns are loop induction variables Coefficients are compile time constants One coefficient for each loop induction variable plus a constant coefficient Generally use induction variable corresponding to normalized or semi normalized loops. indicates a definition indicates a use Express dependence equation as a matrix notation AI = C where A: Coefficient matrix; I: Vector of unknowns C: Constant vector
If there is no solution, there can be no dependence.
Loop limits add constraints Lower limit is zero for normalized loop Constraints are realities Dependence system can be expressed in matrix notation.
A i = C B i = b
Linear equalities Linear inequalities (+)ve coefficient for unknown (-)ve coefficient for unknown
Upper limit Lower limit
for I = 2, 100 for J = 1, I- B[I, J] = B[J, I] endfor endfor
The 2 eqns. for equality are: