On the Serializability Theorem for Nested Transactions R. F. Resende ? A. El Abbadiy Department of Computer Science University of California Santa Barbara , CA 93106 Abstract The fundamental theorem of the classical serializability theory states the necessary and sufficient conditions for the conflict serializability of an execution . In this paper , we extend the correctness criteria of the classical theory by presenting a definition of conflict serializability for concurrency control of nested transactions . We define a serialization graph for nested transactions and we prove that its acyclicity is a sufficient and necessary condition for conflict serializability . 1 Introduction Concurrency has always been a major aspect of computing systems . In a database system the easier the task of the applications programmer the more reliable the product . It is vital with respect to the easy of use of databases that concurrency be transparent for the applications programmer . This has been done , and in most systems the programmer simply has to design a program without considering interferences from other programs accessing shared data . The simplicity of this concept was formally captured by the serializability theory -LSB- 2 -RSB- -LSB- 6 -RSB- . Most of the results of the serializability theory are related to a system model that has two levels , that of atomic operations , and above it , programs that use those operations . These systems are called flat , and the corresponding theory classical . In nested transactions , transactions may use subtransactions , which in turn may use subtransactions , and so on -LSB- 5 -RSB- . Nested transactions allow the benefits of atomicity to be used within a transaction , so that , for example , a transaction can include several simultaneous remote procedure calls , which can be coded without considering possible interference among them -LSB- 4 -RSB- . In this paper , we extend the correctness criteria of the classical theory by presenting a definition of conflict serializability for concurrency control of nested transactions . An execution of nested ? Work supported in part by CNPq - Conselho Nacional de Desenvolvimento Cient ?? fico e Tecnol?ogico yWork supported in part by the NSF under grant number IRI-9117094 . transactions is correct , i.e. , conflict serializable , if it is conflict equivalent to the execution of a serial nested transaction . Our contribution is a well balanced group of definitions based on -LSB- 1 -RSB- and -LSB- 3 -RSB- and a proof of the fundamental theorem of serializability theory . We define a serialization graph for nested transactions and we prove that its acyclicity is a sufficient and necessary condition for conflict serializability . In prior work on nested transactions , Hadzilacos and Hadzilacos -LSB- 3 -RSB- define a serialization graph and prove that its acyclicity is a sufficient condition for their notion of serializability . Fekete et al. -LSB- 4 -RSB- give a similar graph using a different system model , and again only prove sufficiency . This paper chooses a more restrictive notion of \ conflict serializability '' , and then proves that this is equivalent to acyclicity of a serialization graph . Thus we show that one can obtain theorems for nested transactions systems that correspond to the standard theorems of the classical theory -LSB- 2 -RSB- . We conclude the paper by deriving a proof of the correctness of executions produced by a modular graph testing scheduler . 2 The Model This section is divided in two subsections . In the first subsection we summarize part of the work presented in Beeri , Bernstein and Goodman -LSB- 1 -RSB- . In the second subsection we introduce our notion of equivalence and correctness . 2.1 Database System Model The components of a computation are states , operations , transactions , return values , and a partial order . Each state represents the state of the entire database , states are denoted by St = fs1 ; s2 ; : : : g . The set of transactions are denoted by T = ft1 ; t2 ; : : : g . The set of operation occurrences in computations is denoted by OP . A DM or Data Manager represents the storage subsystem . The DM is characterized by the set of computations it can execute . A computation is described by a tuple . A DM tuple is a tuple -LRB- s1 ; O ; < ; r ; s2 -RRB- , where s1 and s2 are states , O is a finite subset of OP , < is a partial order on O , and r is a return value function with domain O . A D-computation is a DM tuple that obeys axioms -LRB- C1 -RRB- , -LRB- C2 -RRB- , and -LRB- C3 -RRB- below . A DM D is the set of all D-computations of a given system . A DM tuple -LRB- s1 ; O ; < ; r ; s2 -RRB- in D means that starting from state s1 , D can execute the operations in O in the execution order < , return the values specified by r , and end in state s2 . For o1 ; o2 2 O , we say that o1 precedes o2 in c if o1 < o2 . To denote that o1 does not precede o2 we write o1 6 < o2 . If o1 6 < o2 and o2 6 < o1 then o1 and o2 are concurrent . A D-computation -LRB- s1 ; O ; < ; r ; s2 -RRB- is serial if < is a total order on O . A D-computation c = -LRB- s1 ; O ; < ; r ; s2 -RRB- is order preserving atomic -LRB- OPA -RRB- if there exists a total order < 1 such that < ? < 1 and ^ c = -LRB- s1 ; O ; < 1 ; r ; s2 -RRB- is also a D-computation . That is , c has the same effect as a serial computation that preserves the order of c 's operations . Let O1 ; O2 ? OP , such that O1 \ O2 = ; , let < 1 and < 2 be partial orders on O1 and O2 respectively , and let < 1 ? < 2 be defined as < 1 -LSB- < 2 -LSB- O1 ? O2 . Square brackets are used to restrict domains , e.g. , r -LSB- O -RSB- denotes function r restricted to domain O . A DM D must satisfy : -LRB- C1 -RRB- -LRB- Composition axiom -RRB- If , for some s1 ; s2 ; s3 , the computations c1 = -LRB- s1 ; O1 ; < 1 ; r1 ; s2 -RRB- and c2 = -LRB- s2 ; O2 ; < 2 ; r2 ; s3 -RRB- are in D then so is their composition c = c1 ? c2 = -LRB- s1 ; O1 -LSB- O2 ; < 1 ? < 2 ; r1 -LSB- r2 ; s3 -RRB- -LRB- C2 -RRB- -LRB- Decomposition axiom -RRB- If , for some s1 and s3 , there is a computation c = -LRB- s1 ; O1 -LSB- O2 ; < 1 ? < 2 ; r ; s3 -RRB- in D , then there exists a state s2 in St such that c1 = -LRB- s1 ; O1 ; < -LSB- O1 -RSB- ; r -LSB- O1 -RSB- ; s2 -RRB- and c2 = -LRB- s2 ; O2 ; < -LSB- O2 -RSB- ; r -LSB- O2 -RSB- ; s3 -RRB- are in D. -LRB- C3 -RRB- All D-computations are OPA . Axioms -LRB- C1 -RRB- and -LRB- C2 -RRB- show how to compose and decompose tuples . Axiom -LRB- C3 -RRB- entails the assumptions in the classical theory of serializability that operations are atomic and that noncommutative operations are related by < . A transaction is an execution of a program . Formally , a transaction is a tuple t = -LRB- O ; < t ; r -RRB- , where O is the set of operations executed in the computation , < t the transaction order , is a partial order on O , and r is a return value function with domain O -LSB- ftg . A transaction tuple for t , or a t-tuple , is any tuple -LRB- O ; < ; r -RRB- . A t-computation is a t-tuple that satisfies axiom -LRB- C4 -RRB- : -LRB- C4 -RRB- -LRB- Order extension axiom -RRB- If t = -LRB- O ; < t ; r -RRB- is a transaction , then -LRB- O ; < ; r -RRB- is a t-computation if and only if < t ? < . A subtransaction is viewed by its parent as an operation , though in reality it is an execution of a program . To achieve this dual view , we assume a function from the set T of transactions to a subset OPT of OP , which gives the operation of which the -LRB- sub -RRB- transaction is an implementation . As an abuse of functional notation tr -LRB- o -RRB- denotes any transaction associated with operation o. Axiom -LRB- C5 -RRB- below states that tr -LRB- o -RRB- 's effect can be achieved by o , i.e. , it relates an operation 's specification to its implementation . -LRB- C5 -RRB- -LRB- Sequential correctness axiom -RRB- Let tr -LRB- o -RRB- be a transaction associated with operation o. For all s1 , s2 , < , r , if -LRB- O ; < ; r -RRB- is a tr -LRB- o -RRB- - computation , and if -LRB- s1 ; O ; < ; r -LSB- O -RSB- ; s2 -RRB- is a serial D - computation , then -LRB- s1 ; fog ; ; ; r -LSB- tr -LRB- o -RRB- -RSB- ; s2 -RRB- is also a D-computation . A hierarchical tuple is a tuple c = -LRB- s1 ; F ; < ; r ; s2 -RRB- where s1 and s2 are initial and final states respectively . F is a forest of subtransactions and operations , < is an execution order , and r is a return value function . The special case in which F is a one-level forest , c is also a DM tuple . Sometimes it is convenient to treat a given forest as a tree . This can be done adding a root -LRB- in -LSB- 4 -RSB- this root is called \ mythical '' t0 -RRB- . Formally , we assume that a hierarchical tuple c = -LRB- s1 ; F ; < ; r ; s2 -RRB- can also be represented by a ^ c = -LRB- s1 ; A ; < ; ^ r ; s2 -RRB- , where A is the same as F together with a distinguished transaction , t0 , that invokes as subtransactions the roots of F , and ^ r is the same as r with domain extended to t0 , r -LRB- t0 -RRB- is irrelevant . The set of computations forests CFs 1 is the set of hierarchical tuples that satisfies axioms -LRB- C6 -RRB- - -LRB- C8 -RRB- below . For a hierarchical tuple c , the set of leaves is leaves -LRB- A -RRB- or leaves -LRB- c -RRB- ; the roots -LRB- top-level transactions -RRB- are roots -LRB- c -RRB- . For a node x , the subtree rooted at x is Ax , and its leaves are leaves -LRB- x -RRB- . The set of descendents of x is desc -LRB- x -RRB- and the set of children -LRB- i.e. immediate descendents -RRB- is child -LRB- x -RRB- , -LRB- roots -LRB- c -RRB- is the same as child -LRB- t0 -RRB- or child -LRB- A -RRB- -RRB- . The lowest common ancestor of nodes x and y is lca -LRB- x ; y -RRB- . Nodes x and y are incomparable if neither is a descendent of the other . The DM projection of c is c -LSB- leaves -LRB- c -RRB- -RSB- , also denoted as c -LSB- D -RSB- . For an internal node x , c restricted to x is the transaction tuple -LRB- child -LRB- x -RRB- ; < -LSB- child -LRB- x -RRB- -RSB- ; r -LSB- child -LRB- x -RRB- -LSB- fxg -RSB- -RRB- . A CF c = -LRB- s1 ; A ; < ; r ; s2 -RRB- must satisfy : -LRB- C6 -RRB- -LRB- Downward compatibility -RRB- Let x ; y 2 A , and let p 2 desc -LRB- x -RRB- -LSB- fxg ; q 2 desc -LRB- y -RRB- -LSB- fyg , if x < y , then p < q. -LRB- C7 -RRB- -LRB- Transaction validity -RRB- For each internal node x , c restricted to x is an x-computation . -LRB- C8 -RRB- -LRB- DM validity -RRB- The DM projection of c , c -LSB- D -RSB- , is a D-computation . Axiom -LRB- C6 -RRB- says that if x completes before y begins , then each operation and subtransaction of x completes before any operation or subtransaction of y begins . -LRB- C7 -RRB- requires the consistency of < with the partial order of each constituent transaction , and -LRB- C8 -RRB- says that a CF comprises a computation of a DM D. Proposition 1 . -LSB- 1 -RSB- Let c = -LRB- s1 ; A ; < ; r ; s2 -RRB- be a CF. The partial order < can be extended to a partial order < 0 such that c0 = -LRB- s1 ; A ; < 0 ; r ; s2 -RRB- is also a CF and for all nodes x and y , if , for all p 2 child -LRB- x -RRB- and all q 2 child -LRB- y -RRB- , p < 0 q then x < 0 y. Proposition 1 establishes a \ normalization '' process for CFs . Such canonical partial orders will be assumed from now on , i.e. , < in the following CFs can not be further extended as prescribed by Proposition 1 . Furthermore , by DM-validity , -LRB- C8 -RRB- , for every CF c , c -LSB- D -RSB- is a D-computation . By the OPA property of axiom -LRB- C3 -RRB- we can extend the order to be serial on the leaves , and by Proposition 1 , we can extend it further to be upward compatible . Hence we assume that all D-computations are serial . 2.2 Conflict consistency and conflict equivalence In this section we define serializability for nested transactions based on the notion of conflicts . We then contrast this definition with other definitions . Let o1 and o2 be operations and s be a state . We say that o1 and o2 commute with respect to s if for all r and ? s , -LRB- s ; fo1 ; o2g ; -LRB- o1 ; o2 -RRB- ; r ; ? s -RRB- 2 D iff -LRB- s ; fo1 ; o2g ; -LRB- o2 ; o1 -RRB- ; r ; ? s -RRB- 2 D. Two operations -LRB- generally -RRB- commute if they commute with respect to all states . Operation o1 conflicts with o2 if o1 does not commute with o2 . Let < and < 0 be total orders such that < is a permutation of < 0 . We say that < 0 is conflict consistent -LSB- 3 -RSB- with < if whenever o conflicts with and precedes o0 in < then o precedes o0 in < 0 . 1We will maintain the denomination \ Computation Forest '' or \ CF '' , despite the introduction of t0 . Two DM tuples c = -LRB- s1 ; O ; < ; r ; s2 -RRB- and c0 = -LRB- s01 ; O0 ; < 0 ; r0 ; s02 -RRB- are conflict equivalent , denoted c ? c0 , iff s1 = s01 , s2 = s02 , O = O0 , < is conflict consistent with < 0 , and r = r0 . Now we will prove that if two DM tuples are conflict equivalent and one of them is a D-computation then the other is also a D-computation . We will use the technique of reversing commutative operations presented in -LSB- 1 -RSB- and -LSB- 6 -RSB- . First we show that the DM-tuple obtained by inverting the order of two contiguous and commutative operations of a D-computation is also in D. Lemma 1 . Let c be a DM tuple with operations x and y contiguous and commutative with respect to the state in which the first one was executed . Let c0 be a DM tuple obtained from c by reversing x and y . If c 2 D then c0 2 D and c ? c0 . Proof . Without loss of generality assume that x < y . Since c 2 D , c obeys the decomposition axiom and can be represented as c = c1 ? -LRB- ^ s1 ; fx ; yg ; -LRB- x ; y -RRB- ; r -LSB- fx ; yg -RSB- ; ^ s2 -RRB- ? c2 . By definition of commutativity -LRB- ^ s1 ; fx ; yg ; -LRB- y ; x -RRB- ; r -LSB- fx ; yg -RSB- ; ^ s2 -RRB- 2 D hence c0 = c1 ? -LRB- ^ s1 ; fx ; yg ; -LRB- y ; x -RRB- ; r -LSB- fx ; yg -RSB- ; ^ s2 -RRB- ? c2 2 D . That c ? c0 is obvious . 2 Now we show the relation between conflict equivalence and membership in D. Lemma 2 . Let c = -LRB- s1 ; O ; < ; r ; s2 -RRB- and c0 = -LRB- s01 ; O0 ; < 0 ; r0 ; s02 -RRB- be DM tuples . If c 2 D and c is conflict equivalent to c0 then c0 2 D. Proof . By induction on the number of pairs , k , of operations that are reversed in c with respect to c0 . The basis -LRB- k = 1 -RRB- is trivial from Lemma 1 . For the induction hypothesis lets assume that the lemma is true for k ? 1 pairs . Consider the pair of operations x and y that are reversed in c0 and contiguous in c 2 . The operations of such a pair commute since the total order < in c is conflict consistent with the order < 0 in c0 . Now we use Lemma 1 to obtain ? c which is in D , is conflict equivalent to c , and has only k ? 1 pairs of operations reversed with respect to c0 . 2 Two CFs c = -LRB- s1 ; A ; < ; r ; s2 -RRB- and c0 = -LRB- s01 ; A0 ; < 0 ; r0 ; s02 -RRB- are conflict equivalent , denoted c1 ? c2 , iff A = A0 , r = r0 , and c -LSB- D -RSB- ? c0 -LSB- D -RSB- . A CF c = -LRB- s1 ; A ; < ; r ; s2 -RRB- is serial iff < is a total order on the roots and on the children of each node . A CF is conflict serializable iff it is conflict equivalent to some serial CF. Our notion of serializability differs from previously proposed notions . In -LSB- 1 -RSB- two CFs are equivalent if they have the same initial and final states and their roots have the same return values . In -LSB- 3 -RSB- the equivalence concept was strengthened by requiring not only the same roots but also the same forest -LRB- with the same return value for each node -RRB- . We strengthen the latter definition by requiring not only the same final state but also that the ordering relation -LRB- < -RRB- of one be conflict consistent with the ordering of the other , which we showed guarantees the same final state . We consider states and return values only to take advantage of the state-dependent commutativity definition , thus remaining within the confines of the general theory presented in -LSB- 1 -RSB- . Note that in -LSB- 4 -RSB- serial 2Such a pair exists , by choosing x and y to be the pair of operations that are reversed in c0 and closest together in c -LRB- without loss of generality , suppose x precedes y in c -RRB- . Suppose -LRB- to obtain a contradiction -RRB- that any operation z came between x and y in c . We have that x must precede z in c0 , since they are closer together in c than x and y ; similarly z must precede y in c0 . The combination of these two facts shows x precedes y in c0 , contradicting the definition . correctness for T0 corresponds to serializability in -LSB- 1 -RSB- . To illustrate the difference between the equivalence definitions of -LSB- 1 -RSB- and -LSB- 3 -RSB- , consider a transaction that increments an integer data item , using a read and a write operation . Consider two increment subtransactions belonging to two different top-level transactions . In -LSB- 1 -RSB- the order of the two increments is irrelevant as long as the underlying read and write operations are not interleaved . In contrast , in -LSB- 3 -RSB- , the order is significant since all operations must return the same values , including the read and write that implement the increment operation . The difference between our notion of equivalence and that of -LSB- 3 -RSB- can be easily illustrated by any view serializable execution of flat transactions that is not conflict serializable -LSB- 2 -RSB- . Although more restrictive , our approach allows for the development of a serializability theory similar to the classical theory for flat transactions . In the next section we develop a serialization graph for nested transactions and show that the acyclicity of the graph is both necessary and sufficient for conflict serializability . Hence , for the subset of executions that strictly depends on conflict information from the leaves , our approach complements the theory of Beeri , Bernstein and Goodman -LSB- 1 -RSB- . In particular correctness in that theory is based on operational techniques such as commutativity-based reversals and substitution while conflict serializability can be proven using graph-theoretical techniques . 3 The Serializability Theorem In this section we prove a theorem which establishes a necessary and sufficient condition for conflict serializability of nested transactions , similar to the fundamental theorem of serializability -LSB- 2 -RSB- for flat transactions . First we define the serialization graph for nested transactions then we present the theorem . The serialization graph of a CF c = -LRB- s1 ; A ; < ; r ; s2 -RRB- , SG -LRB- c -RRB- , is a directed graph whose nodes correspond to the nodes A in c and which has an edge x ! y iff x and y are siblings and either -LRB- a -RRB- There exist leaves x0 and y0 descendents of x and y respectively , so that x0 precedes and conflicts with y0 ; or -LRB- b -RRB- x < t y where t is the parent of x and y . In our model once two operations conflict , this conflict propagates up to the level of the children of their least common ancestor which are their ancestors . Type -LRB- a -RRB- edges capture the order of conflicting operations . Edges of type -LRB- b -RRB- correspond to the transaction order or algorithmic precedence relation between siblings . We first prove a technical lemma , then we show that the acyclicity of our graph is both necessary and sufficient for conflict serializability . Our sufficiency part of the proof follows the proof in -LSB- 3 -RSB- . Lemma 3 . Given a graph G = -LRB- V ; E -RRB- , a set of vertices C ? V ; jCj > = 2 , and P , a set of two or more disjoint nonempty partitions of vertices in C. Consider a graph G0 = -LRB- P ; E0 -RRB- where p ! p0 2 E0 iff there exists v ! v0 2 E and v 2 p ; v0 2 p0 . If C represents vertices which are involved in a -LRB- simple -RRB- cycle in G then there is at least one -LRB- simple -RRB- cycle in G0 . Proof . Let f map v 2 C to its partition f -LRB- v -RRB- 2 P . Consider the cycle of C 's vertices v1 ! v2 ! ? ? ? ! vn ! v1 . If f is applied to each element vi of the cycle the result after removing possible self-cycles is a cycle between nodes of G0 . Since there are two or more partitions , there is at least one simple cycle among them . 2 Theorem 1 . -LRB- The Serializability Theorem -RRB- Let c = -LRB- s1 ; A ; < ; r ; s2 -RRB- be a Computation Forest , c is conflict serializable iff SG -LRB- c -RRB- is acyclic . Proof . -LRB- if -RRB- We will show how to construct cs a CF that is serial and conflict equivalent to c. -LSB- Definition of < s -RSB- Let the level of a node in SG -LRB- c -RRB- be the number of its proper ancestors in A -LRB- thus root -LRB- A -RRB- is at level 0 -RRB- . < s is the relation at the end of the execution of the following Hierarchical Topological Sort -LRB- HTS -RRB- -LSB- 3 -RSB- : < s : = f -LRB- x ; y -RRB- : there is an edge x ! y in SG -LRB- c -RRB- g for l : = 1 to \ max . level of any node in SG -LRB- c -RRB- '' do \ extend < s to totally order all level l nodes '' \ further extend < s by setting x < s y for any x and y that are descendents of level l nodes x0 and y0 respectively with x0 < s y0 '' end for -LSB- < s is acyclic -RSB- To see this we use induction on l . The basis follows from the assumption that SG -LRB- c -RRB- is acyclic . Suppose , by way of contradiction , that before iteration l < s is acyclic but afterwards it has a cycle among the nodes in the set C . Let us instantiate < s and C as the graph G and the set of vertices C in Lemma 3 . The hypothetical cycle created by HTS at iteraction l must include one of the new newly introduced edges and all new edges are between nodes whose least common ancestor is at level l ? 1 or closer to the root . Hence node lca -LRB- C -RRB- 3 must be at level l ? 1 or closer to the root . Now consider nodes p and p0 that are children of the node lca -LRB- C -RRB- . The way HTS constructs < s guarantees that p ! p0 iff v ! v0 where v and v0 are descendents of p and p0 respectively . Hence the subgraph of < s whose vertices are the children of node lca -LRB- C -RRB- corresponds to the graph G0 in Lemma 3 . By Lemma 3 a cycle among any set of nodes C implies that there is a cycle among children of lca -LRB- C -RRB- , i.e. , a cycle among nodes at level l or above , but HTS totally orders level l and it does not add edges above level l , a contradiction . Hence at iteration l no cycle can be created and < s produced by HTS is acyclic . -LSB- Definition of cs -RSB- We now construct a hierarchical tuple cs = -LRB- s1 ; A ; < + s ; r ; s2 -RRB- where < + s is the irreflexive transitive closure of < s. -LSB- cs is a CF -RSB- To show that cs is a CF we have to prove that it satisfies -LRB- C6 -RRB- , -LRB- C7 -RRB- and -LRB- C8 -RRB- . < + s in cs satisfies -LRB- C6 -RRB- by construction : The iterated pseudo-command \ further extend < s by setting x < s y for any x and y that are descendents of level l nodes x0 and y0 respectively with x0 < s y0 '' of HTS guarantees this . Obviously extending < s to < + s does not violate -LRB- C6 -RRB- . cs satisfies -LRB- C7 -RRB- trivially , 3The lowest common ancestor of a set of nodes C is the ancestor of every x 2 C , but no proper descendent of x has this property . Assuming that the nodes of a CF are organized as a tree guarantees a uniform treatment since for any set of nodes there exist a lowest common ancestor . since all transaction orders are captured by edges of type -LRB- b -RRB- of SG -LRB- c -RRB- and embedded in < s by the first pseudo-command of HTS . By assumption c is a CF. Thus the DM projection of c , c -LSB- D -RSB- , is a D-computation . We now show that if x conflicts with and precedes y in < then x precedes y in < s. Recall that type -LRB- a -RRB- edges of SG -LRB- c -RRB- , which were originally installed between siblings that have conflicting descendents , are embedded in < s , and HTS extended all these orderings to the descendents . Hence < + s -LSB- leaves -LRB- A -RRB- -RSB- is conflict consistent with < -LSB- leaves -LRB- A -RRB- -RSB- , and hence the DM tuple cs -LSB- D -RSB- is conflict equivalent to the D-computation c -LSB- D -RSB- , and by Lemma 2 cs -LSB- D -RSB- is a D-computation . Hence cs satisfies -LRB- C8 -RRB- . -LSB- cs is serial -RSB- cs is serial by construction , the iterated pseudo-command \ extend < s to totally order all level l nodes '' guarantees this . -LSB- c is conflict serializable -RSB- By definition of cs the two CFs have the same A , and as discussed above cs -LSB- D -RSB- ? c -LSB- D -RSB- hence cs is conflict equivalent to c. -LRB- only if -RRB- Suppose CF c = -LRB- s1 ; A ; < ; r ; s2 -RRB- is conflict serializable , and hence there exists a serial CF cs such that c ? cs . For the sake of contradiction assume that SG -LRB- c -RRB- has a cycle among siblings x1 ! x2 ! : : : ! xk ! x1 . Consider xi ! xi +1 in SG -LRB- c -RRB- . If xi ! xi +1 is a type -LRB- a -RRB- edge then since c ? cs , c and cs have conflict consistent order relations and therefore xi appears before xi +1 in cs . If xi ! xi +1 is a type -LRB- b -RRB- edge then since both executions have the same nodes and obey -LRB- C4 -RRB- , the transaction validity axiom , again xi appears before xi +1 in cs . Hence a cycle implies that each of x1 ; x2 ; : : : xk appears before itself in the serial CF cs , an absurdity . Thus no cycle can exist in SG -LRB- c -RRB- . That is , if CF c is conflict serializable then SG -LRB- c -RRB- is acyclic . 2 The graph SG -LRB- c -RRB- that we have defined differs in two main ways from that defined by Hadzilacos and Hadzilacos -LSB- 3 -RSB- -LRB- which we refer to as SGHH -LRB- c -RRB- -RRB- . Firstly , SGHH includes edges between incomparable nodes even if those nodes are not siblings . For example , condition -LRB- a -RRB- gives edges in SGHH between any incomparable ancestors of x and y. Similarly condition -LRB- b -RRB- gives edges between any descendent of x and any descendent of y. Secondly , the graph SGHH does not include vertices corresponding to the atomic operations of an execution ; instead it only has vertices for subtransactions . The extra vertices for atomic operations seem essential for the definition to capture the intuitive notion of correct execution . In both respects , our definition is closer to the serialization graph defined in -LSB- 4 -RSB- . 4 An application of serializability theorem In this section we derive a simple proof of correctness of a serialization graph testing scheduler -LSB- 7 -RSB- . Hadzilacos and Hadzilacos -LSB- 3 -RSB- show proofs for a lock and for a timestamp based protocols . The Children 's Serialization Graph of transaction t , CSG -LRB- t -RRB- , is a directed graph where nodes are the children of t. CSG -LRB- t -RRB- has an edge x ! y iff -LRB- a -RRB- there exists descendents x0 and y0 of x and y respectively , so that x0 precedes and conflicts with y0 , or -LRB- b -RRB- x < t y . It follows from the definition of SG -LRB- c -RRB- and CSG -LRB- t -RRB- that CSG -LRB- t -RRB- corresponds to SG -LRB- c -RRB- restricted to the nodes children -LRB- t -RRB- . Conversely SG -LRB- c -RRB- corresponds to the union of the CSG -LRB- t -RRB- 's . The CSGT -LRB- Children 's Serialization Graph Testing -RRB- rules are as follows . A graph , called the Stored Children 's Serialization Graph of t , SCSG -LRB- t -RRB- , is created when a subtransaction t is invoked . Initially SCSG -LRB- t -RRB- has no vertices . Each time t invokes a child y , t informs the scheduler about any other terminated child x such that x < t y . This information gives the scheduler the ability to install type -LRB- b -RRB- edges . Each time a child y of t terminates , the scheduler adds the vertex y to SCSG -LRB- t -RRB- , adds the type -LRB- b -RRB- edges , and adds an edge y0 ! y -LRB- y ! y0 -RRB- for each terminated sibling y0 such that y0 -LRB- y -RRB- or one of its descendents precedes and conflicts with y -LRB- y0 -RRB- or one of its descendents . Immediately after doing this , the scheduler tests if SCSG -LRB- t -RRB- has cycles . If there are no cycles this means that up to now all children can be serialized . If a cycle is detected then CSGT signals y 's abortion to t . It follows from the definition of CSG -LRB- t -RRB- and SCSG -LRB- t -RRB- that CSG -LRB- t -RRB- is the same as SCSG -LRB- t -RRB- when t terminates . Theorem 2 . Every history produced by CSGT is conflict serializable . Proof . Let c be a CF representing an execution that follows the rules of CSGT . We will prove that SG -LRB- c -RRB- is acyclic . For the sake of contradiction suppose that SG -LRB- c -RRB- has a cycle , we will now prove that a cycle among any group C of nodes implies a cycle in SCSG -LRB- lca -LRB- C -RRB- -RRB- . Let G , C , and P of Lemma 3 be instantiated as SG -LRB- c -RRB- , C and the equivalence classes defined by the relation \ descendents of the same child of lca -LRB- C -RRB- '' respectively . Observe that graph G0 of Lemma 3 is a subgraph of CSG -LRB- lca -LRB- C -RRB- -RRB- . By Lemma 3 a cycle among nodes in C implies that there is at least one cycle in CSG -LRB- lca -LRB- C -RRB- -RRB- . As observed above , when lca -LRB- C -RRB- terminates CSG -LRB- lca -LRB- C -RRB- -RRB- is the same as SCSG -LRB- lca -LRB- C -RRB- -RRB- , but CSGT checks for cycles for every child of a transaction , a contradiction . Hence SG -LRB- c -RRB- can not have cycles and by the serializability theorem c must be serializable . 2 References -LSB- 1 -RSB- C. Beeri , P. A. Bernstein , and N. Goodman , \ A Model for Concurrency in Nested Transactions Systems '' , Journal of the Association for Computing Machinery , 36 -LRB- 2 -RRB- :230 -269 , April 1989 . -LSB- 2 -RSB- P. A. Bernstein , V. Hadzilacos , V. and N. Goodman , Concurrency Control and Recovery in Database Systems , Addison Wesley , 1987 . -LSB- 3 -RSB- T. Hadzilacos and V. Hadzilacos , \ Transaction Synchronization in Object Bases '' , Journal of Computer and System Sciences , V43 , N1 :2 -24 , August 1991 . -LSB- 4 -RSB- A. Fekete , N. Lynch , and W. Weihl , \ A Serialization Graph Construction for Nested Transactions '' , Proceedings of the 9th ACM Symposium on Principles of Database Systems , April 2-4 , 1990 , Nashville , Tennessee , ACM , New York , 1990 , pp. 94-108 . -LSB- 5 -RSB- J. E. B. Moss , \ Nested Transactions : An Approach to Reliable Distributed Computing '' , Ph.D. . Thesis , Technical Report MIT/LCS/TR -260 , April 1981 . -LSB- 6 -RSB- C. H. Papadimitriou , The Theory of Database Concurrency Control , Computer Science Press , 1986 . -LSB- 7 -RSB- R. F. Resende and A. El Abbadi , \ A Graph Testing Concurrency Control Protocol for Object Bases '' , Proceedings of the 4th International Conference on Computing and Information , May 28-30 , 1992 , Toronto , Canada , IEEE , Los Alamitos , 1992 , pp. 316-317 .

O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O B I O B O O B I O O O O O O O B I O O O O O O O O O O O O O B I O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O B I O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O B I O B I O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O B O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

concurrency
conflict serializability
databases
nested transactions


Givens and Householder Reductions for Linear Least Squares on a Cluster of Workstations ? Omer E > = gecio > = glu and Ashok Srinivasan Department of Computer Science University of California Santa Barbara , CA 93106 Abstract We report on the properties of implementations of fast-Givens rotation and Householder reflector based parallel algorithms for the solution of linear least squares problems on a cluster of workstations . It is shown that the Givens rotations enable communication hiding and take greater advantage of parallelism than Householder reflectors , provided the matrices are sufficiently large . 1 Introduction The linear least squares -LRB- LLS -RRB- problem is the minimization of the residual min x2IRn kAx ? bk2 -LRB- 1 -RRB- where A 2 IRm?n and b 2 IRm are given , and the subscript denotes the ordinary Euclidean 2 -LCB- norm . Such problems typically arise in evaluating unknown parameters x1 ; x2 ; : : : ; xn of a linear model to fit measured data . Each row of A represents the values of the independent variables in an experiment , and x b A = n m m Figure 1 : Ax = b. the corresponding row of b represents the value of the dependent variable for that particular experiment . The measured values may be imprecise because of various sources of error , and consequently the number of experiments conducted exceeds the number of unknown parameters . Thus it is natural to assume that m AE n . In this case the linear system Ax = b is overdetermined . An overdetermined system usually has no exact solution , and the alternative is the minimization of the residual over a suitable norm , such as -LRB- 1 -RRB- . A further simplifying assumption is that the columns of A are linearly independent : i.e. it has full column rank . There are two main methods to solve -LRB- 1 -RRB- that use orthogonal updates : Givens -LRB- or fast-Givens -RRB- rotations , and Householder reflectors . Both use the fact that kAx ? bk2 = kQA ? Qbk2 , when Q is an orthogonal matrix , and through a series of premultiplications -LRB- whose product we denote by QT -RRB- reduce A to QTA = R n m ? n -LRB- 2 -RRB- where R is n ? n upper triangular . This is the QR factorization of A . Once the reduction to upper triangular form for A as in -LRB- 2 -RRB- is accomplished , x can be obtained by back substitution by solving Rx = c where QTb = c d n m ? n -LRB- 3 -RRB- It is well known that both methods are numerically stable , and are preferred over the solution of the normal equations for LLS problems -LSB- 7 , 8 -RSB- , -LSB- 14 -RSB- . hile the number of additions for Givens and Householder methods are the same for the QR factorization , the number of multiplications and square roots in the Householder method is fewer than the Givens method -LSB- 7 , 8 -RSB- . Furthermore , if fast-Givens transformations are used to reduce the number of multiplications of Givens transformations , then periodic monitoring and scaling of the row multipliers are necessary . This makes the Householder method the sequential algorithm of choice for dense QR , and consequently for LLS problems . In a parallel setting , however , this advantage is offset by the higher communication requirements of the Householder reduction algorithm . This is because each annihilation requires access to not only an entire row , but also an entire column , and for m AE n there does not seem to be a straightforward way of overlapping communication with annihilation , irrespective of how the matrix elements are allocated to the processors . In this paper , we consider a parallel implementation of the fast-Givens reduction for LLS formulated as in -LRB- 1 -RRB- with m AE n on a cluster of workstations , and compare our results with the Householder based ScaLAPACK QR factorization run in the same environment . In our tests , the output is QTA = R and QTb , and back substitution step is not performed as it is identical for both algorithms . The experiments were conducted using PVM -LSB- 3 -RSB- on a cluster of Sun SPARCStation LX workstations connected over an Ethernet LAN , for matrices of three different sizes . The implementation of the LLS minimization algorithm using Givens rotations takes maximum advantage of parallelism due to its ability to hide communication costs , since computations can take place while messages are in transit . In this case , however , it turns out to be more problematic to make Householder reflectors take equally significant advantage of parallelism due to the di culty of hiding communication costs . The outline of this paper is as follows : first we present an overview of Givens and fast-Givens transformations in Section 2 , and Householder transformations in Section 3 . Various aspects of these methods including applications and more detailed analyses of their properties can be found in -LSB- 7 -RSB- , -LSB- 8 -RSB- , -LSB- 9 -RSB- , -LSB- 12 -RSB- , -LSB- 14 -RSB- , -LSB- 15 -RSB- . In Section 4 we present our distributed memory implementation of the Givens reduction algorithm for LLS . In Section 5 we present our test results , compare the performance of the two methods , and present our conclusions . ivens transfor ations 2.1 ivens rotations Consider the matrices = c s ? s c A = a1 a2 where a1 and a2 are two row vectors . Then A = ca1 sa2 ? sa1 ca2 : -LRB- 4 -RRB- If the first ? 1 components of a1 and a2 are zero , 1 , then we can introduce an additional zero in the th component of a2 by choosing c and s as c = a1 ; k a21 ; k a22 ; k ; s = a2 ; k a21 ; k a22 ; k : ith this choice c2 s2 = 1 , and c = cos and s = sin for some angle . The matrix is a plane rotation matrix through angle and consequently orthogonal . By embedding into the identity matrix we construct a matrix ij where cij = cos and sij = sin appear in the ith and th rows and columns as shown in -LRB- 5 -RRB- . The matrix ij defines a rotation in the -LRB- i ; -RRB- plane in IRn and it can be used to introduce a zero into the th entry in the th row of A. ij = 66666666666666666666666 1 ... 1 cij sij 1 ... 1 ? sij cij 1 ... 1 77777777777777777777777 -LRB- 5 -RRB- Let rotate -LRB- i ; -RRB- denote the function that makes the -LRB- i ; -RRB- th element of a matrix A zero , using rows ai ? 1 and ai in place of a1 and a2 in -LRB- 4 -RRB- . The sequence of Givens transformations in Figure 2 reduces A 2 IRm?n into upper triangular form . This straightforward algorithm takes approximately 2n2 -LRB- m ? n3 -RRB- = 1 n i = m 1 rotate -LRB- i ; -RRB- Figure 2 : Reduction to upper triangular form -LRB- QR -RRB- by Givens rotations . multiplications , since each rotation requires about 4 -LRB- n ? -RRB- multiplications . The number of multiplications can be reduced by fast-Givens transformations . 2.2 ast - ivens trans or ations Fast-Givens -LRB- or fast-scaled -RRB- transformations allows for each rotation to be performed using about 2 -LRB- n ? -RRB- multiplications . To this end the current matrix is kept in a factored form as A where is an m?m diagonal matrix . -LRB- In the actual implementation is stored as a vector . -RRB- Consider rows a1 and a2 of A as in -LRB- 4 -RRB- . Instead of computing the entries of the new rows in -LRB- 4 -RRB- , we first compute = sc . Then ca1 sa2 ? sa1 ca2 = c c a1 a2 ? a1 a2 This allows savings on the number of multiplications performed by postponing the scalar-vector products in -LRB- 4 -RRB- until the very end . e need to see how should be updated when a new rotation on a row is performed . It su ces to consider only the two rows that are altered . Solving for and in a0 b0 = c s ? s c a b where a , a0 , b , and b0 are row vectors results in the equations a0 = c a s b b0 = ? s a c b For new values , it is possible to choose either = s ; = s or = c ; = c : e choose the former if jsj jcj , and the latter otherwise . These two possibilities result in type 1 and type 2 fast-Givens rotations , and the appropriate choice serves to keep the diagonal elements of as far from as possible -LSB- 8 -RSB- . Each time a row is involved in a rotation , the absolute value of the corresponding term in the diagonal matrix could decrease by a factor of 1 2 . Since a row may be involved in up to 2n rotations , the corresponding diagonal term can change by a factor of as much as 2 ? n . This imposes a limit on the number of columns we can safely have without overflow unless we pay the price of monitoring the growth of by appropriate scaling -LSB- 8 -RSB- . ouse o der re ectors Householder reflectors are orthogonal matrices of the form = ? 2 T where 2 IRm ? 1 is a unit vector . They are used to introduce zeros to more than one entry of a column vector of A simultaneously by a single premultiplication , by a suitable choice of . To make the entries of a vector x 2 IRm ? 1 below its th component while leaving the ones above it unchanged , form the vector = -LRB- 0 ; ? ? ? ; ; xk si n -LRB- xk -RRB- ; xk 1 ; ? ? ? ; xm -RRB- T where = -LRB- x2k ? ? ? x2m -RRB- 1 : The Householder transformation matrix corresponding to is formed by setting = ? 2 T T : is an m ? m orthogonal matrix which is also called an elementary reflection . It can be verified that the vector x has the desired properties . In addition , computing for an arbitrary vector is simple , for = ? 2 T T ; and T is a scalar . Thus we can determine A for given matrix A relatively easily . If j denotes the Householder reflector that fills the subdiagonal entries in column of the current matrix with zeros , then the Householder reduction algorithm for A proceeds as given in Figure 3 . This successively introduces = 1 n j A : = jA Figure 3 : Reduction to upper triangular form -LRB- QR -RRB- by Householder reflectors . zeros in subdiagonal entries of columns of A and reduces A to upper triangular form . The Householder reduction algorithm as described above requires about mn2 ? n3 multiplications . distri uted e or ivens i e entation First we consider basic schedules for parallel implementation of the Givens reduction algorithm . .1 e in or ivens rotations A Givens rotation affects only two rows of A at a time . If successive rotations were to affect only dis oint pairs of rows , then they could be done simultaneously without affecting the final result . Otherwise , a suitable ordering -LRB- schedule -RRB- needs to be specified on the execution of individual Givens rotations that avoids common rows . More formally , suppose -LRB- ; -RRB- is the time step at which the -LRB- ; -RRB- th entry of the matrix is annihilated -LRB- becomes 0 -RRB- , and -LRB- ; -RRB- is the index of the row that is used along with row to annihilate the -LRB- ; -RRB- th entry . Any such pair of functions defined for satisfying the following requirements is an acceptable schedule for the parallel execution of Algorithm 2 : 1 . Concurrent operations act on different rows . In other words , if -LRB- ; -RRB- = -LRB- ; -RRB- , and -LRB- ; -RRB- = -LRB- ; -RRB- , then the sets ; -LRB- ; -RRB- and ; -LRB- ; -RRB- are dis oint . 2 . If -LRB- ; -RRB- = t and -LRB- ; -RRB- = i , then -LRB- ; -RRB- t and -LRB- i ; -RRB- t for all . This ensures that all the previous columns of the two rows involved at time step t have already been annihilated . A particular schedule satisfying these two properties was developed by Sameh and Kuck -LSB- 13 -RSB- , in which -LRB- ; -RRB- = m ? 2 ? 1 ; -LRB- ; -RRB- = ? 1 : As an example , Figure 4 -LRB- a -RRB- gives the Sameh-Kuck annihilation pattern -LRB- ; -RRB- for a 10 ? 10 matrix . Only the subdiagonal entries of the matrix are shown . The numbers indicate the stage at which the corresponding entry is annihilated . If m n , the last annihilation occurs for the -LRB- n 1 ; n -RRB- th element 9 8 10 7 9 11 8 10 12 5 7 9 11 13 4 8 10 12 14 3 5 7 9 11 13 15 2 4 8 10 12 14 1 1 3 5 7 9 11 13 15 17 -LRB- a -RRB- = 1 = 2 = 3 9 8 11 7 10 12 9 12 15 5 8 11 14 17 4 7 10 13 1 18 3 9 12 15 18 21 2 5 8 11 14 17 20 23 1 4 7 10 13 1 19 22 24 -LRB- b -RRB- Figure 4 : -LRB- a -RRB- Sameh-Kuck annihilation pattern , -LRB- b -RRB- Block pattern for = 3 processors , for a 10 ? 10 matrix . at stage m n ? 2 . Thus for an m ? n matrix , approximately m n stages need to be performed . It is clear that given n processors , a single Givens rotation can be performed in small constant time . Therefore the computation time of the overall Givens reduction Algorithm 2 , given n processors is ideally of order of m n . If nm 2 processors are available , then up to m 2 rotations can be performed simultaneously . However for execution on a cluster of workstations , a large number of machines would be needed even for modest values of m and n . The problem of e cient scheduling becomes interesting if the number of available processors is limited . Special cases of this for various architectures were discussed in -LSB- 11 -RSB- , -LSB- 10 -RSB- . In the limited processor case , the work of many processors in the original schedule needs to be assigned to a single processor . On an ideal shared memory computer this distribution could be done without overhead since there would be no communication costs involved . In practical situations however , rows of A need to be distributed across the processors , compatible with the annihilation pattern in Figure 4 -LRB- a -RRB- , so that the overall interprocessor movement of the rows is minimized . Figure 4 -LRB- b -RRB- gives the annihilation pattern used in our implementation of the Givens reduction algorithm when = 3 processors are available for a 10 ? 10 matrix . .2 e a orit e view each as a instead of a processor , since in some instances it may be necessary to create more than one process to run on a physical processor . For the implementation of the algorithm , we create processes , each represented by a distinct identifier in 1 ; 2 ; : : : ; . A block of ad acent rows are assigned to a single process , with each process keeping approximately the same number of rows of A as indicated in 4 -LRB- b -RRB- for = 3 . Each process annihilates entries beginning with the first column of the matrix . In each column , annihilation starts with the last row in the block of rows assigned to the process . Annihilation of the entries in row ai is performed using row ai ? 1 . Note that in order to annihilate an entry in the first row of its block , process has to access the last row of process ? 1 . In addition , process can not begin to annihilate an entry in its last row until it has received the modified version of it from process 1 . High level steps of the algorithm executed by each process 2 1 ; 2 ; : : : ; are given in Figure 5 . The function rotate -LRB- ? ; ? -RRB- used in Figure 5 operates in the same manner as the one mentioned earlier , except that it also modifies the corresponding elements of the vector b . In order not to clutter up the algorithm description , we assume that whenever a message is to be sent to or received from a process whose number is not in the range 1 ; 2 ; : : : ; , no action is taken . : A 2 IRm?n and b 2 IRm : QTA = R and QT b : Process is assigned the block of rows indexed m -LRB- ? 1 -RRB- 1 -LRB- first -RRB- through m -LRB- last -RRB- : Send last row to process 1 : -LRB- = 1 min -LRB- last ? 1 ; n -RRB- -RRB- -LRB- a -RRB- Get back modified last row from process 1 -LRB- b -RRB- has more than a single row i. rotate -LRB- ast ; -RRB- ii . Send last row to process 1 -LRB- c -RRB- rotate -LRB- i ; -RRB- for all s interior rows with index i -LRB- d -RRB- index of first row i. Receive last row of process ? 1 ii . rotate -LRB- irst ; -RRB- iii . Send process ? 1 s modified last row back to it iv . has only one row send it to process 1 -LRB- e -RRB- Scale entries of corresponding to the block : Multiply partial matrix by diagonal elements and output result . Figure 5 : Main steps of the distributed memory Givens algorithm . Next we give an informal ustification of the correctness of this algorithm : First of all each row is assigned to exactly one process . e can argue that if each process executes all the statements , the result obtained will be the desired one . Subsequently we can show that all the statements will indeed be executed . The main calculation occurs in Step 3 . For each value of , the first row , interior rows -LRB- whose indices are between first and last -RRB- , and last row are annihilated in column . Besides , when -LRB- b -RRB- is executed , the process already has its last row from the next process , received in -LRB- a -RRB- . hen modifies its first row in -LRB- d -RRB- -LRB- ii -RRB- , it has already received the last row of process ? 1 in step -LRB- d -RRB- -LRB- i -RRB- . Step 3 -LRB- c -RRB- ensures that only , and all , subdiagonal elements are annihilated . Since varies over all the required columns , the reduced matrix is upper triangular . In Step 3 -LRB- e -RRB- , the diagonal elements of corresponding to the rows assigned to are scaled . To show that that all the steps are actually executed we need to make sure that the required messages are actually sent by the responsible processes . In Step 2 , each process sends its last row . Therefore , each process will have the last row of the previous process . In particular , process will have the last row of process ? 1 and will be able to execute Step 3 . Note that it does not need to execute Step 3 -LRB- a -RRB- . returns ? 1 s last row in -LRB- d -RRB- -LRB- iii -RRB- . Thus , ? 1 in turn can complete its execution for this value of . In general , a process needs the last row of ? 1 after annihilating column ? 1 and its last row after process 1 has used it in order to annihilate column . Step -LRB- b -RRB- -LRB- ii -RRB- ensures the former , and step -LRB- d -RRB- -LRB- iii -RRB- the latter . Thus , eventually all processes execute to completion . Finally , Step 4 is evident . . i e o e it To consider the time taken for computation we need to consider only Step 3 . Let us assume m AE n to simplify the analysis , for otherwise equal subdivision of rows to processes does not result in near equal loads . For each , rotate -LRB- i ; -RRB- requires about 2 -LRB- n ? -RRB- multiplications using fast-Givens rotations . This is performed for at most m rows . Thus , Step 3 requires about 2m -LRB- n ? -RRB- multiplications . Summing this over all gives mn2 multiplication steps for each process . However the processes first have to wait in order to start , and also for the messages needed for intermediate computations . The initial wait is only for one column , and so is of the order of mn and does not add to the higher order term for computation . The total number of messages sent is 2 n and each message consists of at most n floating point numbers that make up a row of A . If 1 is the fixed startup cost of sending and receiving a message relative to a multiplication , and 2 is the relative cost of sending a floating point number across the network , then the time complexity of the algorithm is no worse than mn2 2 1 n 2 2 n2 : This expression is an upper bound since it does not take into account computation communication overlap or communication communication overlap . The latter should play an important role in a communication network such as a grid or a hypercube , when multiple messages can be sent simultaneously from sources to destinations . o arison it ouse o der for Block-partitioned QR factorization algorithm using Householder reflectors is implemented in the LA - PACK -LSB- 1 , 2 -RSB- , which is a software library for performing dense and banded linear algebra computations on vector machines and shared memory computers . LAPACK makes use of block-partitioned algorithms to utilize fast matrix-vector and matrix-matrix operations on data that reside in higher levels in hierarchical memories . An extension of the LAPACK to distributed memory concurrent computers is the ScaLAPACK library -LSB- 5 , -RSB- . ScaLAPACK uses block-cyclic data distribution to processors as its primary data decomposition method for matrices to improve overall performance and scalability . The characteristics and the performance of various ScaLAPACK factorization routines , including QR factorization on the Intel family of parallel computes is reported in -LSB- -RSB- . ScaLAPACK makes use of the LAPACK Householder transformations for QR factorization . Householder reduction is more di cult to implement e ciently on a distributed memory system because each annihilation requires access to not only an entire row , but also an entire column . Consequently , irrespective of how one allocates the matrix elements to the processors , interprocess communication at each step of the annihilation is necessary . Since we have to compute the norm of a column at each step , dividing rows among processors would involve extensive of inter-process communication at each step ust for this computation . On the other hand , in LLS problems with m AE n , it is not possible to take advantage of parallelism by using columns either , since the number of columns is not significant compared to the number of rows . In other words , the annihilation pattern for the elements of matrix A for a distributed memory implementation of Householder reduction essentially reflect the pattern of the sequential algorithm . The advantage of parallelism comes mainly from processors making parallel updates on their local data using annihilating reflectors received from other processors . .1 est at or The parallel fast Givens algorithm was compared with the QR factorization routine of ScaLAPACK . PVM version 3.3.7 was used for message passing in the fast Givens algorithm . ScaLAPACK version 1.1 , was used to test the ScaLAPACK algorithm , using the PVM version of BLACS message passing . The tests were conducted on a cluster of Sun SPARCStation LX workstations connected over an Ethernet LAN , for matrices of three different sizes , using matrices from -LSB- 1 -RSB- and the parallel double precision matrix generator of ScaLAPACK . The sizes of the matrices used for the test were 1000 ? 10 , 2000 ? 50 , and 5000 ? 50 . The tests were performed on up to 20 processors . ScaLAPACK allows the user to choose the processor grid structure and the block size . ue to the high communication cost involved in the Ethernet , it was found that having one column of processors gave the best results for a fixed number of processors . Therefore , results are reported only for this situation . It was found that bigger block sizes are better for a PVM implementation . In accordance with this , the block size was taken to be at least as high as the number of rows . The measure of time was taken to be the wall clock time for the actual calculations , ignoring the time taken for generating the test matrix and for the output of the factors . At least four experiments were performed for each value of the parameter set , and the average of these is reported in Figures , 7 , and 8 . The datasets labeled and correspond to two different scaling mechanisms used in the fast-Givens implementation as described below . .2 a in o In the fast-Givens method the diagonal matrix needs to be periodically scaled to avoid its elements from becoming too small . In the annihilation of each column , the absolute value of the elements may be reduced by up to half . After each annihilation , we check to ensure that this value is :5 . If not , we multiply it by 2 and divide each element of the corresponding row by 2 . In our initial implementation of the fast-Givens transformations , we performed these operations using floating point arithmetic . The results are reported as in Figures , 7 , and 8 . Since division and multiplication by 2 are shifts and can be performed by changing only the exponents involved , in the later version of the implementation we took advantage of this by using the library function to perform integer operations on the exponents . The resulting algorithm has significantly reduced sequential running time over . However as the number of processors increases , the computational costs of scaling become less important and and behave similarly . . est res ts It was found that the sequential version of the QR factorization using Householder reflections of ScaLA - PACK was much faster than the fast-Givens algorithm on a single processor . This could be partly due to the innate nature of the algorithm and also possibly to a difference in the quality of the compilers in optimization , since the fast Givens algorithm was written in whereas the Householder algorithm was in R RA . It was found that for the smaller 1000 ? 10 matrix , the sequential Householder algorithm was much faster than its parallel version for 20 , processors tested , probably due to the high communication overhead . Similarly for the parallel Givens algorithm , while there was a slight speedup with increasing , it was not significant for the smaller matrix -LRB- Figure -RRB- . For the medium size 2000 ? 50 matrix , moderate speedup was obtained using the Householder algorithm for a small number of processors , substantial speedup was obtained using the Givens algorithm across the whole range of processors tested . These results are shown in Figure 7 . For the 5000 ? 50 case shown in Figure 8 , the Householder algorithm outperformed the fast-Givens implementation for small number of processors only . After about = , the Givens implementation performed better . The performance of the algorithms can be explained if we observe that both algorithms have comparable number of floating point operations , and the number of messages sent is also about the same . However , much of the communication cost can be hidden in the fast-Givens algorithm , since computations can be performed while communication is taking place . Therefore the observed communication cost is approximately 2n messages , as opposed to 2 n . It does not seem possible to hide the communication cost in the Householder algorithm . This may account for its poor speedup when the communication network used is slow . . on sions an t re or Givens and Householder transformations were implemented on a cluster of workstations using PVM for the solution of LLS problems . Some of the experimental results are conclusive : the parallel algorithm for fast-Givens transformations can significantly reduce the time complexity for an m?n coe cient matrix with m AE n . It appears that the Givens transformation is better suited to distributed memory machines with significant communication costs than the Householder transformation , at least when dealing with large matrices . Furthermore , the analysis giving the time complexity of the parallel algorithms can be expected to be valid even when implemented in different environments . e intend to generalize the implementation of the parallel fast-Givens algorithm so that a row of processors is used to perform updates of the rows in parallel by using a rectangular array of processors . e can also adapt the block-cyclic data distribution scheme of ScaLAPACK to the Givens case . In place of a cluster of workstations , we plan to conduct our next tests on a parallel computer -LRB- Meiko CS-2 -RRB- which has a fast interconnection network . In this setup , the communication costs incurred are expected to be much lower than for the Ethernet delays that we have observed . It will also be possible to to determine the sizes of the matrices for which the communication hiding ability of the Givens algorithm gives a higher speedup than the Householder algorithm . eferences -LSB- 1 -RSB- Anderson , E. , . Bai , C. Bischof , . emmel , . . ongarra , . uCroz , A. Greenbaum , S. Hammarling , A. McKenney , and . Sorensen , LAPACK : A Portable Linear Algebra Library for HighPerformance Computers , in , pp. 1 -LCB- 10 , IEEE Press , 1990 . -LSB- 2 -RSB- Anderson , E. , . Bai , . emmel , . . ongarra , . uCroz , A. Greenbaum , S. Hammarling , A. McKenney , S. Ostrouchov , and . Sorensen , , SIAM Press , Philadelphia , PA , 1992 . -LSB- 3 -RSB- Beguelin , A , . . ongarra , G.A. Geist , R. Manchek , and V.S. Sunderam , A users guide to PVM parallel virtual machine , ORNL TM1182 , 1991 . -LSB- 4 -RSB- Bertsekas , . P. , and . N. Tsitsiklis , , Prentice Hall , Englewood Cliffs , N , 1989 . -LSB- 5 -RSB- Choi , . , . . ongarra , R. Pozo , and . . alker , A Scalable Linear Algebra Library for istributed Memory Concurrent Computers , In -RRB- . IEEE Computer Society Press , Los Alamitos , CA , 1992 . -LSB- -RSB- Choi , . , . . ongarra , S. Ostrouchov , A.P. Petitet , . . alker , R.C. haley , The esign and Implementation of the ScaLAPACK L , R , and Cholesky Factorization Routines , Oak Ridge National Laboratory , TM-12470 , September 1994 . -LSB- 7 -RSB- Golub , H. G. , and . M. Ortega , , Academic Press , Inc. , San iego , 1993 . -LSB- 8 -RSB- Golub , H. G. , and C. F. Van Loan , , 2nd Edition , The ohns Hopkins niversity Press , Baltimore , 1990 . -LSB- 9 -RSB- Hamming , R. . , , 2nd Edition , over Publications , Inc. , New ork , 198 . -LSB- 10 -RSB- Kowalik , . , S. Kumar , and E. Kamgnia , An Implementation of the fast-Givens Transformations on a MIM Computer , , -LRB- -RRB- . -LSB- 11 -RSB- Lord , R. , . Kowalik , and S. Kumar , Solving Linear Algebraic Equations on a MIM Computer , , pp. 205 -LCB- 210 . -LSB- 12 -RSB- Parlett , B. N. , , Prentice-Hall , Englewood Cliffs , N , 1980 . -LSB- 13 -RSB- Sameh , A. , and . Kuck , On Stable Parallel Linear System Solvers , 1978 , 25 , pp. 81 -LCB- 91 . -LSB- 14 -RSB- ilkinson , . H , , Oxford niversity Press , Oxford , 19 5 . -LSB- 15 -RSB- Ortega , . M. , and R.G. Voigt , , SIAM , Philadelphia , 1985 . -LSB- 1 -RSB- Gregory , T. , and . L. Karney , , ileyInterscience , New ork , 19 9 . Householder Givens-1 Givens-2 Figure : Comparison of Givens and Householder reductions for LLS : m = 1000 ; n = 10 . Householder Givens-1 Givens-2 Figure 7 : Comparison of Givens and Householder reductions for LLS : m = 2000 ; n = 50 . Householder Givens-1 Givens-2 Figure 8 : Comparison of Givens and Householder reductions for LLS : m = 5000 ; n = 50 .

O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O B I O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O

givens rotation
linear least squares
parallel algorithm

householder reflection
workstation cluster