170 likes | 304 Views
Scalable on-the-fly detection of the first races in parallel programs J eong-si K im and Young- kee J un. D. SAHAJA. Contents . Introduction Back ground Detecting the first races and scalability Related works Conclusion . Introduction .
E N D
Scalable on-the-fly detection of the first races in parallel programsJeong-siKim and Young-keeJun D. SAHAJA
Contents • Introduction • Back ground • Detecting the first races and scalability • Related works • Conclusion
Introduction • Detecting races is important for debugging shared memory parallel programs. • A new scalable on-the-fly technique which reduces the central bottlenecks to serializing at most two accesses of each thread to a shared variable for detecting the first races in parallel programs. • Removal of such races may make other races disappear.
Background Data races First races • Can occur when there are two or more concurrent accesses to the same shared data in a non atomic way. • And at least one of them is a write access • The race which occurs first First race race1 race2 … r1-w2,r1-w8,w2-r3,w2-r5,w2-r6,w2-r7, w2-w8,r4-w8,r5-w8,r7-w8 and w8-r9
First races • Candidates : • Any access such that there does not exist any other access happened before it in the same thread. • The Candidate Accesses • Definition 1: A read (write) access ai, is a read(write ) candidate, if and only if • ai is involved in a race • There is no other access ah such that ah ai, and ai is involved in a race. • Example : In the below fig1 r1 and r3 are read candidates and w2 is a write candidate.
Definition : • A read-write candidate is a write access wi such that there does not exists any other write access that happened before wi ,and there exists a read candidate which happened before wi . • Example : W8 is a r-write candidate in the fig1. • Definition 3: Candidate sets for variable X are denoted • Read set: CS(X, R) • Write set: CS(X, W) • R-Write set: CS(X, RW) Fig 1
Affected event : • An access ej is affected by another access ei, if eiej and ei is involved in a race. • Unaffectedrace : • A race ei-ej is unaffected, if neither ei nor ej is affected by any other accesses. • The race is partially-affected ,if only one of ei 0r ej is affected by another access. • In fig2 r3 is an affected event. Affected event Fig 2
Affected event Affected event • Tangled race A tangle T is a set of partially-affected races such that if ei-ej is a race in T then exactly one of ei or ej is affected by ek such that ek-el is also in T. • In Fig 3 ,Tangle races are • r0-w3 • r1-w2 Fig 3 A first race is either an unaffected race or a tangle race.
A read(write) candidate is effective by itself .An r-write candidate is effective, if there does not exist a write candidate. • Not effective candidate w8 is an r-write candidate » w8 is not effective
r1 w2 r6 r7 r9 • Example : r1-w2,r1-w8,w2-r3,w2-r5,w2-r6,w2-r7,w2-w8, r4-w8,r5-w8,r7-w8 and w8-r9 r3 r5 r4 w8 r1-w2 and w2-r3 The first racesare important in debugging, because the removal of such races may make other races disappear.
On-the-fly detection • Most existing on-the-fly techniques use thread-labelingscheme and race detection protocol. • Thread labeling scheme : • Label . • Comparing the labels . • Race detection protocol: • Monitors each access to every shared variable and detects races by maintaining an access history for each shared variable. • Check if there exists any access which is conflicting and concurrent with current access to detect races.
In this technique, an access history for a shared variable consists of 3 kinds of candidates. • On every access to shared variables, the detection protocol for the first races • Examines and update. • Detects . • This technique introduces the central bottlenecks for serializing all access to a shared variable. • Example : Four bottle necks for four candidates are enough.
Detecting first races and Scalability t_ah(X) w2 r1 r3 w8 r1 r3 w2 r1-w2,w2-r3
w2 r1 r3 w8 Rc w2-r3 r1-w2 r1 r3 w2
Related works • Choi and min[ChMi91]: • Deterministic re execution of the program up to the point of the races detected first. • By allowing additional instrumentation that can locate the previously undetected races. • Jun and Koh[JuKo94]: • Detecting the first race in one monitored execution but restricted to nested parallelism. • Serializing all accesses of each thread to every shared variable.
Netzer and Miller[NeMi91]: • Non-artifact race, event control dependences to define how accesses affect each other. • Data races validations determines the feasible races which involve accesses either did execute concurrently or could have. • Min and Choi: • Checking accesses to shared variables by minimizing the number of times that the monitored program is interrupted. • It cannot precisely identify each pair of accesses involved in a race, can not guarantee to be a first race.
Conclusion • Existing on-the-fly techniques to detect races cause the central bottle-necks of serializing all accesses to a shared variable. • Their technique reduces the centralized bottlenecks to serializing at most two accesses of each thread to a shared variable. • Removal of first races can make other races disappear. • Extending their technique for the programs which have nested parallelism with inter-thread coordination.