our ideas of graph search technique reported

Similar documents
Abstract DETECTING TERMINATION OF DISTRIBUTED COMPUTATIONS USING MARKERS

Formal Specification and Analysis of Termination Detection by Weight-throwing Protocol

AN EFFICIENT DEADLOCK DETECTION AND RESOLUTION ALGORITHM FOR GENERALIZED DEADLOCKS. Wei Lu, Chengkai Yu, Weiwei Xing, Xiaoping Che and Yong Yang

RECENTLY, researches on gigabit wireless personal area

Splitter Placement in All-Optical WDM Networks

Inst: Chris Davison

Speed-up of Parallel Processing of Divisible Loads on k-dimensional Meshes and Tori

Node 1. m1 5 m7. token

The alternator. Mohamed G. Gouda F. Furman Haddix

Distributed Snapshots: Determining Global States of Distributed Systems

Conflict-Free Sorting Algorithms under Single-Channel and Multi-Channel Broadcast Communication Models***

Verification of Bakery algorithm variants for two processes

ARELAY network consists of a pair of source and destination

An Anonymous Self-Stabilizing Algorithm For 1-Maximal Matching in Trees

K 4,4 e Has No Finite Planar Cover

Bindel, Fall 2016 Matrix Computations (CS 6210) Notes for

Embedding Large Complete Binary Trees in Hypercubes with Load Balancing

Fault-Tolerant Wormhole Routing Algorithms in Meshes in the Presence of Concave Faults

Multipliers: etc. c loo IO Digits: 2 3 ; 7 ones plus 7x l= 7 3 tens plus 3x lo= 30 2 one hundreds 2 x 100 = 200 Total 237

Cardinality of Sets MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Cardinality of Sets Fall / 15

Multiway Blockwise In-place Merging

An Efficient Silent Self-Stabilizing Algorithm for 1-Maximal Matching in Anonymous Network

Expectation and Maximization Algorithm for Estimating Parameters of a Simple Partial Erasure Model

Fault-Tolerant Routing Algorithm in Meshes with Solid Faults

in this web service Cambridge University Press

Deduction and Logic Implementation of the Fractal Scan Algorithm

Hashing Techniques. Material based on slides by George Bebis

NTHU Rain Removal Project

On the interconnection of message passing systems

Multiplying and Dividing by Powers of 10

I. Introduction. India; 2 Assistant Professor, Department of Electronics & Communication Engineering, SRIT, Jabalpur (M.P.

A Fitness Function to Find Feasible Sequences of Method Calls for Evolutionary Testing of Object-Oriented Programs

Discrete Optimization. Lecture Notes 2

CHAPTER 2. Graphs. 1. Introduction to Graphs and Graph Isomorphism

Treewidth and graph minors

Twiddle Factor Transformation for Pipelined FFT Processing

Computing with Infinitely Many Processes under assumptions on concurrency and participation -M.Merritt&G.Taubenfeld. Dean Christakos & Deva Seetharam

A Connection between Network Coding and. Convolutional Codes

Propagated Timestamps: A Scheme for The Stabilization of Maximum Flow Routing Protocols

DIVIDE AND CONQUER ALGORITHMS ANALYSIS WITH RECURRENCE EQUATIONS

T consists of finding an efficient implementation of access,

Chordal deletion is fixed-parameter tractable

More about The Competition

Optimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of C

On combining chase-2 and sum-product algorithms for LDPC codes

Clustering Using Graph Connectivity

Double Patterning-Aware Detailed Routing with Mask Usage Balancing

Chapter 2. Data Representation in Computer Systems

Binary Search. Roland Backhouse February 5th, 2001

Min-Cost Multicast Networks in Euclidean Space

ARITHMETIC operations based on residue number systems

Byzantine Consensus in Directed Graphs

Concurrent Small Shared. A New Solution to Lamport's Programming Problem Using Variables

Lecture 15 Binary Search Trees

LOW-DENSITY PARITY-CHECK (LDPC) codes [1] can

ALGORITHMS EXAMINATION Department of Computer Science New York University December 17, 2007

On the Finiteness of the Recursive Chromatic Number

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

CS521 \ Notes for the Final Exam

Search Algorithms for Discrete Optimization Problems

A Synchronization Algorithm for Distributed Systems

THE orthogonal frequency-division multiplex (OFDM)

Coverability Graph and Fairness

AsmL Specification and Verification of Lamport s Bakery Algorithm

Verification on Port Connections

Design and Analysis of Algorithms Prof. Madhavan Mukund Chennai Mathematical Institute. Week 02 Module 06 Lecture - 14 Merge Sort: Analysis

Studying Graph Connectivity

COP Programming Assignment #7

State-Based Synchronization Protocol in Sensor Networks

Sorting and Selection

Deadlocks in Distributed Systems: Request Models and Definitions

6. Hoare Logic and Weakest Preconditions

Asynchronous Models. Chapter Asynchronous Processes States, Inputs, and Outputs

T Reactive Systems: Kripke Structures and Automata

Matching and Factor-Critical Property in 3-Dominating-Critical Graphs

Increasing Parallelism of Loops with the Loop Distribution Technique

Introduction to Programming, Aug-Dec 2006

The Markov Reformulation Theorem

Research Issues and Challenges for Multiple Digital Signatures

Arbee L.P. Chen ( 陳良弼 )

Course Modelling of Concurrent Systems Summer Semester 2016 University of Duisburg-Essen

Bisection Debugging. 1 Introduction. Thomas Gross. Carnegie Mellon University. Preliminary version

1 Static-to-Dynamic Transformations

On the Hardness of Counting the Solutions of SPARQL Queries

A Quota Transfer Protocol for Upstream Transmissions in Wireless Mesh Networks

CSMA/CD protocol for time-constrained. communication on bus networks and

New Mexico Tech Hyd 510

Chapter 4: Sorting. Spring 2014 Sorting Fun 1

A Formula Diamond Encoding Data Hiding Scheme

A FORWARDING CACHE VLAN PROTOCOL (FCVP) IN WIRELESS NETWORKS

CS 31: Introduction to Computer Systems. 03: Binary Arithmetic January 29

Investigating F# as a development tool for distributed multi-agent systems

Announcements! P1 part 1 due next Tuesday P1 part 2 due next Friday

Blind Signature Scheme Based on Elliptic Curve Cryptography

1 Dijkstra s Algorithm

Carry Select Adder with High Speed and Power Efficiency

Imelda C. Go, South Carolina Department of Education, Columbia, SC

Course Modelling of Concurrent Systems Summer Semester 2016 University of Duisburg-Essen

Algorithms for Euclidean TSP

We have used both of the last two claims in previous algorithms and therefore their proof is omitted.

Transcription:

DETECTING TERMINATION OF DISTRIBUTED COMPUTATIONS BY EXTERNAL AGENTS ABSTMCT This paper presents an algorithm for detecting termination of distributed computations by an auxiliary controlling agent. The algorithm assigns a weight to each active process and to each message in transit. The controlling agent has a weight, too. The algorithm maintains an invariant that the sum of all the weights related to a computation is equal to one. The controlling agent concludes the termination when its weight equals one. A space-efficient scheme is proposed to encode the weights such that an active process can send a very lar e number of messages without running out o f the weight. 1. Introduction. The termination detection problem for distributed computations has attracted considerable interest [1-6,8-9,111 over the past years since the works of Dijkstra and Scholten [a], and Francez [4]. In our discussion, a distributed computation consists of a set of processes, which communicate with one another via message passing. Each process may be either active or idle. An active process may become idle at any time. Only active processes may send messages to others; and, an idle process can only be reactivated by receiving a message. The computation is This work is supported in part by ATC, ERSO, Industrial Technology Institute of the Republic of China under the Contract SF-C-010-1, and the National Science Council of the Republic of China under the Contract NS C 77-0408-EO0 7-07. Shing-Tsaan Huang Institute of Computer Science National Tsing-Hua University HsinChu, Taiwan (30043)) R.O.C. said to be terminated iff all the processes are idle and there is no message in transit. This paper presents an algorithm for the termination detection problem under the following assumptions. A controlling agent monitors the computation. A logical communication channel exists between each process pair and between the controlling agent and each of the processes. Messages from a sender to a receiver are correctly received by the receiver in an order not necessary the same as the sending order. Message delay is arbitrary but finite. The presented algorithm can be easily extended to work on distributed systems with dynamic nature [8,10] in the sense that the processes may be created, destroyed, or migrated from one processing element to another. The algorithm is modified from the algorithm by Rokusawa, Ichiyoshi, Chikayama, and Nakashima [lo] by applying our ideas of graph search technique reported in [7]. Adopting the weighted throw counting scheme used in their algorithm, our algorith~n assigns a weight to each active process and to each message in transit. The controlling agent maintains a weight, too. For each weight W, we let 0 < W < 1. The a1 orithm maintains an invariant that the sum o! all the weights related to the computation is equal to one. The controlling agent concludes termination if its weight equals one. A space-efficient scheme is proposed to encode the weights such that an active process can send a large number of messages without running out of the weight, and hence avoid requiring additional weight from the controlling agent. CH2706-0/89/0000/0079$01.00 0 1989 IEEE 19

We have organized the rest of the paper as follows. The algorithm and its correctness are discussed in Section 2. Then, the encoding'scheme is presented in Section 3. Historic remarks of the works in [7,10] are provided in Section 4. Finally, a summary is given in Section 5. 2. The algorithm and its correctness. Besides the messages for the computation, which we call basic messages, there are messages from the processes to the controlling agent for the purpose of termination detection which are called control messages. The controlling agent and each of the processes maintain a variable W for its weight. Basic messages are denoted as and control messages are denoted as 3;q, where DW is a parameter of the weight. At the beginning, all the processes are idle with their weights having value zero, and the weight of the controlling agent equals one. The computation starts when the controlling agent sends a basic message to one of the processes. The algorithm consists of the following rules. In the rules, we assume that a weight is infinitely divisible. The implementation of such weights is discussed in the next section. R1: The controlling agent or an active process may send a basic message to one of the processes, say p, at any time by doing: Derive W1 and W2 such that ( W1 + W2 = W), ( W1 > 0), and (W2 > 0); Let W:= W1; Send a i(dw:= W2) to p. R2: Upon receiving a B(DW), a process p does: Let W:= W+DW; R3: R4: (If p is idle, p is reactivated.) An active process may become idle at any time by doing: Send a C(DW:= W) to the controlling agent; Let W:= 0; (The process becomes idle.) Upon receiving a c(dw), the controlling agent does: Let W:= W+ OW; If W = 1, the computation is terminated. The correctness reasoning of the algorithm is as follows. Let us define the following sets first. A the set of all the Ws on active processes. B: the set of all the Ws on basic messages in transit. C. the set of all the Ws on control messages in transit. Also, let us denote the Won the controlling agent as Wc. The following P1 and P2 are invariants. W= 1. pl: Wc + %E (A U BU c) P2:V WE(AUBUC), W>O. Hence, wc = 1 LbY P1) WE(AUBUc) [ZGy = 4) W=O The computation is terminated. That is, the algorithm never detects a false termination. Further, AUB)=(b [by P1) 80

Wc + EWE c W= 1 (Message delay is finite.) Eventually, Wc = 1. That is, the algorithm detects every true termination in finite time. We have presented an algorithm for the termination detection on distributed computations. With the assumption that a weight is infinitely divisible, the algorithm can be easily extended to work on distributed systems with dynamic nature. In a dynamic system, an active process may spawn another active process or migrate from one processing element to another. We can let an active process create another active process by splitting its weight into two parts, keeping one part as its new weight, and assigning the other part as the weight of the spawned process. Migration of the processes won't cause any problem provided that only active processes are allowed to migrate. However, the maximum number of co-existing active processes is bounded in an actual implementation. We shall readdress this further after the implementation of the weights is discussed. 3. The implementation of the weights. In this section, we present a space-efficient scheme to encode the weights. Except Wc, the weight on the controlling agent, all the other weight Wis encoded in a small number of bits, yet it behaves as if it were infinitely divisible. We may represent the Was a binar number in an unbounded array of bits wit the binary point before the first bit. That is, the array (100...) has a binary value 0.100... or a decimal value 0.5. By doing this, W1 and W2 in rule R1 are always available. For example, let W= (00100...), we can have W1 = (00010...) and W2 = (00010...). The computation may start when the controlling agent lets its Wc := (100...) and sends a basic message B(DW := (loo...)) to one of the 3: processes. The termination is detected when Wc has a carry from the addition in rule R4. In this way, at the beginnin one bit is sufficient to encode the weig fi t. As the computation proceeds, we may need more bits to encode the weights, and the number of bits needed might not be affordable for the processes to maintain or the messages to carry. In the following, we present a spaceefficient scheme to handle this problem. In the scheme, the controlling agent preserves an array of a sufficiently large number of bits to encode Wc. The array is evenly divided into window slots. Each other weight W on an active process or on any message in transit is represented by (...)i, where (...) is a window of bits and the subscript i is its corresponding slot number. For each W= (...)i, it is assumed that all the bits in windows other than slot i have value 0. This is similar to a floating-point encoding scheme, in which the number of leading zeros is stored rather than the zero's themselves. When an active process has weight W = (0... Ol)* and wants to send a basic message, it can slide the window to the right one slot position, or let i := i + 1, and then split its weight into two non-zero parts, keeping one part as its new weight and sending the other as the weight of the message. For example, a process can split (O...O1)o into (l...ll)l and (O...O1)l, then keep (l...ll)l as its new weight and assign (O...O1)l as the weight of the message. An active process may have two weights according to rule R2, one from itself and the other from a received basic message. If the sum of the two weights can not be fitted into a single window slot, we let the process keep the window with smaller slot number and send the other to the controlling agent. For example, when an active process having weight = (...)3 receives another weight = (...)l, we let it keep the weight and send (...)3 to the controlling agent. 81

The above scheme makes possible for each process to maintain only a few bits, and each message to carry the same number of bits. For example, let H be the array size of Wc and h be the window size. If h = 16, and H = 1024h, we need 26 bits to represent the W, among them 10 bits are for the slot number because 21 = 1024, and 16 bits are for the window itself. Only the weight Wc of the controlling agent then needs 1024 16-bit computer words. When an active process has its slot number reaching the upper limit, it can split its weight into two parts, keep one part as its new wei ht and send the other as a request for supply o B weight to the controlling agent. The weight on a request message can be of the form (0... 01)$ Upon receiving such a request with weight (O...O1)i, the controlling agent then sends a supply of weight (0... 01) with j 1 < i, to the requester, or postpones the sending of the supply until it is able to do so. When an active process receives a supply, the situation is similar to what described in the paragraph before the last paragraph, and similar actions can be followed by the process. When an idle process receives a supply, it simply rebounds the weight to the controlling agent. By enlarging H, the requests for supply of weight can be eliminated. In a dynamic system, the fact that Wc is bounded by H also has its effects on the maximum number of active processes that can co-exist at any time. With H = 2, for example, the maximum number of co-existing active processes is 4 because in such a case, the minimum possible weight for each active process is binary value 0.01 and the sum of their weights is equal to one. We have presented a space-e ficient scheme to encode the weights. This scheme maintains a very large resource pool in the controlling agent which is shared by all the processes with each having only a small amount of memory space. This ideas should be interesting to the community of researchers studying resource sharing problems. 4. IIistoric Remarks. The presented algorithm applies the ideas of the graph searching technique reported in [7] on the weighted throw counting scheme discussed in [lo]. In searching a graph with logical edges, the searching can start from a root with a weight of one. The root sends a token T(DW := 1/ I NSI) to each of its neighbors. We use NS to denote the set of the neighbors of a node. Upon receiving a token T(DW) for the first time, a node sends a token T(DW := DW/(INSI-l)) to each of its neighbors except the one from which the token is received. For a revisited token T(DW), a node sends a T(DW) to the root. A sink node, a node with only one neighbor, sends a to the root upon receiving a token qzj. The root detects the termination of the searching when the sum of the weights on all the returned tokens equals one. This search technique assumes that a weight is infinitely divisible. Although different formulation and terminology are used, the termination detection dealt with in the algorithm reported in [lo] is similar to the one.discussed in this paper. However, in [lo], the weights are integer numbers; since no special encoding scheme is used, each activated process almost always needs to request for supply of weight. As discussed in (101, let us have the following weight assignment strategy: Assign a fixed weight 21 to a basic message if the weight of the sender is more than twice of that; otherwise assign half of its weight. Then, an active process which is reactivated by receiving a basic message with a weight of 2 10 can only send 10 basic messages. In our proposed scheme, however, by sliding the window to the right, the effect is receiving a supply of a very large weight from the controlling agent. For instance, let H = 1024h, and h = 16. Then, by sliding the window one slot position, a process can send an additional 2 16 basic messages. The computation can go into a depth of 1024 levels without any request messages, and hence, the processes are free 82

from experiencing any delays waiting for supply messages. The memory cost for each process and message is 26 bits only. The major disadvantage of the scheme is that in rule R2 the sum of the two weights may not be able to be fitted into a single window of bits, hence an extra control message is needed. However, the advantage of the freedom of the processes from waiting for supply messages should be regarded as more important. Further, in some applications, sending basic messages to an active process can be avoided. For example, in the discussed graph searching computation, a process (node) goes active upon receiving the token, and goes idle immediately after sending out the tokens to its neighbors; therefore, no token is sent to an active process. 5. summary. We have presented a termination detection algorithm for distributed computations and. proposed a space-efficient encoding scheme to implement the ideas that logically a weight can be infinitely divisible. The algorithm is modified from the one proposed by Rokusawa, et al. [lo], and borrows the ideas from our other article [7]. Using our encoding scheme, each process and message need a small number of bits to encode the weight, and the processes can almost be free from the delays waiting for supply of weights from the controlling agent. Since a termination detection algorithm should do the best to avoid bothering the computation, having an active process waiting for control messages is not desirable. And, the detecting delay, the period from the computation terminates until the controlling agent detects the termination, should be kept as less as possible. Further, the number of control messages sent should be as small as possible. The presented algorithm is almost optimal in these aspects. With a large enough H, the processes won't receive any control messages. It takes only one message delay, from the latest idled process to the controlling agent, to detect the termination. And, for every basic message, at most one control message is required for the case that the sum of the weights in rule R2 can not be fitted into a single window of bits. Finally, only one control message is needed for each idleness of the processes. ACKNOWLEDGMENT The author would like to thank the anonymous referees for their helpful comments and suggestions. References Dijkstra, E. W., Feijen, W. H. J., and van Gasteren, A. J. M. Derivation of a Termination Detection Algorithm for Distributed Computations. In form. Processing Lett., Vol. 16, pp. 217-219, June 1983. Dijkstra, E. W. and Scholten, C. S. Termination Detection for Distributed Computations. In form. Processing Lett., Vol. 11, pp. 14, Aug. 1980. Eriksen, 0. A Termination Detection Protocol and Its Formal Verification. J. Parallel and D.istributed Computing 5, pp. 82-91, 1988. Francez, N. Distributed Termination. ACM Trans. Program. Lung. Syst., Vol. 2, pp. 42-55, Jan. 1980. Francez, N. and Rodeh, M. Achieving Distributed Termination without Freezing. IEEE Trans. Sojtware Engrg., Vol. 8, pp. 287-292, Mar. 1982. Huang, S-T. A Fully Distributed Termination Detection Scheme. Inform. Processing Lett. Vol. 29, pp. 13-18, Sept. 1988. -. A distributed deadlock detection algorithm for CSP style programs. TR-H7601, Inst. of Computer Science, Tsing-Hua University, Feb. 1987, submitted for publication, under revision. Lai, T-H. Termination Detection for Dynamically Distributed Systems with Non-fi r s t-in-fi rs t-ou t Communication. J. Parallel and Distributed Computing 3, pp. 577-599, 1986. Ftana, S. P. A Distributed Solution to the Distributed Termination Problem. 83

Inform. Processing Lett., Vol. 17, pp. 4346, July 1983. [lo] Rokusawa, K., Ichiyoshi, N., Chikayama, T. and Nakashima, H. An efficient termination detection and abortion algorithm for distributed processing systems. Proc. 1988 Int'l Conj Parallel Processing, pp. 18-22, 1988. [ll] Topor, R. W. Termination Detection for Distributed Computations. Inform. Processing Lett., Vol. 18, pp. 33-36, Jan. 1984.