Distributed Deadlock Detection for. Distributed Process Networks

Similar documents
Computational Process Networks a model and framework for high-throughput signal processing

Implementation of Process Networks in Java

Computational Process Networks

LabVIEW Based Embedded Design [First Report]

Embedded Systems 8. Identifying, modeling and documenting how data moves around an information system. Dataflow modeling examines

Requirements on the Execution of Kahn Process Networks

Module 16: Distributed System Structures

Optimization of Vertical and Horizontal Beamforming Kernels on the PowerPC G4 Processor with AltiVec Technology

Performance of Multihop Communications Using Logical Topologies on Optical Torus Networks

The Public Shared Objects Run-Time System

Distributed System Chapter 16 Issues in ch 17, ch 18

Performance of DB2 Enterprise-Extended Edition on NT with Virtual Interface Architecture

EE/CSCI 451: Parallel and Distributed Computation

Distributed Systems Exam 1 Review Paul Krzyzanowski. Rutgers University. Fall 2016

Copyright by Gregory Eugene Allen 2011

Copyright. Gregory Eugene Allen

Virtual Machines. 2 Disco: Running Commodity Operating Systems on Scalable Multiprocessors([1])

Overview of Dataflow Languages. Waheed Ahmad

Concurrent Models of Computation

Using Time Division Multiplexing to support Real-time Networking on Ethernet

Midterm II December 4 th, 2006 CS162: Operating Systems and Systems Programming

Dataflow Languages. Languages for Embedded Systems. Prof. Stephen A. Edwards. March Columbia University

Module 16: Distributed System Structures. Operating System Concepts 8 th Edition,

Node Prefetch Prediction in Dataflow Graphs

Deadlock Avoidance for Streaming Applications with Split-Join Structure: Two Case Studies

CHAPTER 2: PROCESS MANAGEMENT

Modelling, Analysis and Scheduling with Dataflow Models

Proceedings of MASPLAS'01 The Mid-Atlantic Student Workshop on Programming Languages and Systems IBM Watson Research Centre April 27, 2001

LAPI on HPS Evaluating Federation

wait with priority An enhanced version of the wait operation accepts an optional priority argument:

HIGH-PERFORMANCE NETWORKING :: USER-LEVEL NETWORKING :: REMOTE DIRECT MEMORY ACCESS

A Scalable Multiprocessor for Real-time Signal Processing

TDP3471 Distributed and Parallel Computing

RTI Performance on Shared Memory and Message Passing Architectures

Embedded Systems 7. Models of computation for embedded systems

The alternator. Mohamed G. Gouda F. Furman Haddix

Distributed Systems Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2016

Large-Scale Network Simulation Scalability and an FPGA-based Network Simulator

A Framework for Real-Time High-Throughput Signal and Image Processing Systems on Workstations

1 Process Coordination

Software Synthesis from Dataflow Models for G and LabVIEW

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Network performance. slide 1 gaius. Network performance

Module 15: Network Structures

Scalable Multi-core Sonar Beamforming with Computational Process Networks

Shared Memory and Distributed Multiprocessing. Bhanu Kapoor, Ph.D. The Saylor Foundation

Chapter 4 NETWORK HARDWARE

Distributed Systems. Pre-Exam 1 Review. Paul Krzyzanowski. Rutgers University. Fall 2015

Does current Internet Transport work over Wireless? Reviewing the status of IETF work in this area

DISTRIBUTED HIGH-SPEED COMPUTING OF MULTIMEDIA DATA

Performance Analysis of WLANs Under Sporadic Traffic

EECS 122: Introduction to Communication Networks Final Exam Solutions

An Integrated Synchronization and Consistency Protocol for the Implementation of a High-Level Parallel Programming Language

ATM in TCP/IP environment: Adaptations and Effectiveness

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

Universal Communication Component on Symbian Series60 Platform

Chapter 6: CPU Scheduling. Operating System Concepts 9 th Edition

Implementation and Analysis of Large Receive Offload in a Virtualized System

PCnet-FAST Buffer Performance White Paper

Network Design Considerations for Grid Computing

Midterm Exam #2 December 4, 2013 CS162 Operating Systems

Interface Automata and Actif Actors

Module 17: "Interconnection Networks" Lecture 37: "Introduction to Routers" Interconnection Networks. Fundamentals. Latency and bandwidth

Hierarchical FSMs with Multiple CMs

A Capabilities Based Communication Model for High-Performance Distributed Applications: The Open HPC++ Approach

User Datagram Protocol (UDP):

Breakpoints and Halting in Distributed Programs

Following are a few basic questions that cover the essentials of OS:

CPU Scheduling. Daniel Mosse. (Most slides are from Sherif Khattab and Silberschatz, Galvin and Gagne 2013)

Network-Adaptive Video Coding and Transmission

Virtual Memory - Overview. Programmers View. Virtual Physical. Virtual Physical. Program has its own virtual memory space.

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads

Department of EECS - University of California at Berkeley EECS122 - Introduction to Communication Networks - Spring 2005 Final: 5/20/2005

G Robert Grimm New York University

Performance and Optimization Issues in Multicore Computing

Designing Next Generation Data-Centers with Advanced Communication Protocols and Systems Services

Client Server & Distributed System. A Basic Introduction

FIRM: A Class of Distributed Scheduling Algorithms for High-speed ATM Switches with Multiple Input Queues

Continuous Real Time Data Transfer with UDP/IP

Using RDMA for Lock Management

Area Limitations on Smart Grid Computer Networks

Embedded Systems 7 BF - ES - 1 -

Commercial Real-time Operating Systems An Introduction. Swaminathan Sivasubramanian Dependable Computing & Networking Laboratory

Double-Take vs. Steeleye DataKeeper Cluster Edition

Introduction to Multiprocessors (Part I) Prof. Cristina Silvano Politecnico di Milano

Fundamental Algorithms for System Modeling, Analysis, and Optimization

Utilizing Linux Kernel Components in K42 K42 Team modified October 2001

The latency of user-to-user, kernel-to-kernel and interrupt-to-interrupt level communication

Quality of Service (QoS)

Operating Systems Fundamentals. What is an Operating System? Focus. Computer System Components. Chapter 1: Introduction

Midterm Exam Amy Murphy 19 March 2003

An Efficient Stream Buffer Mechanism for Dataflow Execution on Heterogeneous Platforms with GPUs

SDL. Jian-Jia Chen (slides are based on Peter Marwedel) TU Dortmund, Informatik 年 10 月 18 日. technische universität dortmund

Estimation of worst case latency of periodic tasks in a real time distributed environment

Overview Computer Networking What is QoS? Queuing discipline and scheduling. Traffic Enforcement. Integrated services

02 - Distributed Systems

OPERATING- SYSTEM CONCEPTS

Network Load Balancing Methods: Experimental Comparisons and Improvement

An Empirical Performance Study of Connection Oriented Time Warp Parallel Simulation

Troubleshooting Transparent Bridging Environments

Transcription:

0 Distributed Deadlock Detection for Distributed Process Networks Alex Olson Embedded Software Systems Abstract The distributed process network (DPN) model allows for greater scalability and performance over a non-distributed process network model. This paper presents a distributed deadlock detection algorithm applicable to process networks. The algorithm efficiently detects both local and global deadlocks. In addition, the deadlock detection algorithm has minimal bandwidth and memory requirements. Lastly, the implementation of a high-performance DPN framework that detects deadlocks is presented. Furthermore, this implementation supports the future addition of dynamic process creation/migration (ability to create/relocate processes at run-time).

0 CONTENTS I Introduction 1 II The Process Network Model 2 II-A Kahn...................................... 2 II-B Parks...................................... 2 II-C Geilen and Basten............................... 3 II-D Allen and Evans................................ 3 III Deadlock Detection 4 III-A Previous Work................................. 4 III-B Mitchell and Merritt s Algorithm....................... 4 IV Distributed Process Network Framework Design 5 V Performance 8 VI Conclusion 9 References 9

1 I. INTRODUCTION There are a variety of approaches for high-performance computing. Many of these rely on exploiting the available parallelism in a computation and are highly effective. One can attempt to find parallelism by examining program code, as done by modern compilers and processors. Another approach is to initially design the computation with parallelism in mind, by starting with a highly parallelizable model. One such model is the Kahn process network (PN) model [1], which consists of concurrent processes communicating over one-way channels. The beauty of the Kahn process network model lies in its simplicity. It guarantees determinism only based upon the flow of data. The process network model is highly suitable for signal processing applications. For targeting desktop computers, several (non-distributed) PN frameworks exist. For these, symmetric-multiprocessor (SMP) workstations can be used to achieve high-performance, as shown in [2]. However, SMP desktops are becoming extremely expensive. Currently, multiple single-cpu workstations may be purchased for the price of a single SMP-workstation, and they offer greater combined performance. Thus, a distributed process network framework (DPN) allows for greater performance at a reduced economic cost over PN implementations running on SMP workstations. Unfortunately, few DPN frameworks exist. Distributing the process network model incurs challenges as channels take on non-zero latencies. Furthermore, the lack of a global clock and shared memory make correct deadlock detection more difficult. The primary objective of this paper is to research and design a highperformance DPN framework that performs distributed deadlock detection. This framework will provide a basis for the future research of dynamic process migration, dynamic load balancing, and other challenges. Deadlock detection is required for process network scheduling algorithms, since artificial deadlocks may be introduced by placing bounds on memory usage [3]. An

2 original contribution of this paper is an algorithm that detects both local and global deadlocks in distributed process networks. Furthermore, this algorithm is also applicable to non-distributed process networks. II. THE PROCESS NETWORK MODEL A. Kahn In 1974, Kahn proposed [1] a determinate model of computation based on data tokens (and their flow). The term token is a general term for any unit of data. He suggested that multiple processes executing concurrently and communicating over unidirectional channels could perform a computation. His channels may be modeled as reliable FIFO queues, but may be unbounded in length. The channels/queues provide a loose coupling between producers (processes emitting tokens) and consumers (processes receiving tokens). Determinism is guaranteed with blocking reads. A process is blocked if it attempts to read more tokens from a channel than are available. Furthermore, a process is not allowed to test a channel for the presence of tokens. Additionally, it may only attempt to read or write to only one channel at a time. This model is determinate in that the sequence of tokens output from any process is only a function of the sequence of tokens arriving at its input(s). Thus, the correctness of a computation under this model is not affected by the rates or order in which processes execute. B. Parks Kahn s assumption of unbounded channel capacities translates into unbounded memory usage when the process network model is implemented on a computer. Since the process network model is Turing complete, one cannot predict memory requirements statically [4]. In 1995, Parks proposed [3] an algorithm for scheduling process networks under bounded channel capacities.

3 He proposed that a process is also blocked if it attempts to write one or more tokens to a channel lacking sufficient available capacity. This has the potential to create, using Parks terminology, artificial deadlock. These deadlocks are artificial in that sense they arise only from placing bounds on channel capacities. These deadlocks would not have occurred in the original Kahn model. Park s algorithm waits until the system reaches global deadlock and then considers all channels to which a blocked process is writing. Of these, the algorithm increases the capacity of the smallest full channel, so the write to that channel can complete. He proves this algorithm finds a set of bounded channel capacities whenever such bounds exist. C. Geilen and Basten Geilen and Basten show [5] that Parks algorithm can be applied when local deadlocks are detected, instead of waiting for detection of global deadlock. Their scheduling algorithm also maintains bounds on channel capacities when such bounds exist. This is significant because not all local deadlocks will eventually cause global deadlock. For example, if a system is composed of two disjoint computations, deadlock in one will not cause deadlock in the other. D. Allen and Evans Allen and Evans combined [2] the process network model with Karp and Miller computation graphs. In the resulting model, known as computational process networks, a process may consume fewer tokens than it reads. For example, if a process attempts to read 32 tokens, and 20 are available, it will be blocked until the channel holds 32 tokens. However, it may consume just 1 token upon reading 32. The remaining 31 tokens will be read again on the next read of 32 tokens. This model is highly useful for many computations, such as FIR filters. It allows memory bandwidth to be halved as this model often eliminates the need to copy tokens from the

4 channel buffer into an application-specific buffer. This model also makes many types of processes memoryless, as their only memory lies in the channel itself. In modern desktop computers, processors run at several times the speed of the memory subsystem. This model is significant as the speed of some computations is bounded by memory bandwidth rather than CPU speed. Artificial deadlock is still possible and either Park s or Geilen and Basten s scheduling algorithms may be applied. III. DEADLOCK DETECTION A. Previous Work Since the process network model is Turing complete, deadlock is only detectable at run-time. Deadlock detection has been implemented in a few non-distributed PN implementations [6], [7], [8], [3]. All of these detect only global deadlock. Few distributed PN (DPN) implementations exist: [9], [10], [11]. Of these, none detect deadlocks. What follows in the next section is an original application of an existing deadlock detection algorithm to distributed process networks. B. Mitchell and Merritt s Algorithm Kahn s specifications for his process network model include that a process may be blocked on at most one other process at a time. Of the many distributed deadlock detection algorithms, we need only consider the set commonly known as single-resource algorithms. This class of algorithms assumes that a process is waiting on at most one other process. An important aspect of these algorithms is they are not concerned with actual management of resources, but only the manner in which a process waits on another process. One very simple algorithm was developed by Mitchell and Merritt [12]. Although they developed this algorithm for distributed databases, this paper shows a novel application of their algorithm to the distributed process network model.

5 In their algorithm, each process contains two labels: a public label and a private label. Here, a label is just an abstraction for a numeric value. Initially, the public labels of all processes are initialized to unique values. Each process s private label is set equal to its corresponding public label. When a process X begins waiting on another process Y, process X sets both its labels to a value greater than the public labels of both X and Y. This step is known as the blocking step and the waiting process, X, is said to be blocked. While some process X is blocked, it periodically polls the public label of the process,y, for which it is waiting. The frequency at which the polling takes place is not important. During this time, if the public label of process Y becomes greater than that of X, X sets only its public label to be equal to that of Y. This action is known as the transmit step. For a cycle of N waiting processes, the transmit step will be invoked at most N 1 times before deadlock is detected. This algorithm also ensures that in a cycle of waiting processes, exactly one process detects deadlock. Furthermore, false deadlock detection is impossible. These two qualities make this algorithm an ideal deadlock detection scheme in the implementation of a PN scheduling algorithm. IV. DISTRIBUTED PROCESS NETWORK FRAMEWORK DESIGN One goal of this project was to create a high-performance distributed process network implementation. This implementation will provide a basis for future exploration of capabilities such as dynamic process migration (relocating processes at run-time) and dynamic load balancing (instantiating/relocating processes at run-time to equalize server load). For performance reasons the C++ language was chosen. Multi-platform source compatibility is achieved through the use of POSIX functions. In my design, each process contains two threads. The first is a computation thread that performs the desired computation, such as an FIR filter, etc. The second thread is a communication

6 thread. This design is similar to the decoupled access/execute processor architecture [13]. The communication thread is responsible for sending/receiving tokens and performing deadlock detection. Relative to each process, two types of channels are defined: incoming channels and outgoing channels. Incoming channels are those from which a process reads tokens. Likewise, outgoing channels are those to which a process writes tokens. For each incoming or outgoing channel on which a process communicates, a shared circular queue exists between the two threads. For incoming channels, this queue represents Kahn s channel queue. For outgoing channels, the outgoing channel queue helps to aggregate small tokens into larger groups before transmission. The TCP protocol is used by each channel for communication as this protocol provides reliable and FIFO transmission of data over networks. In transmitting a single TCP/IP packet over an Ethernet network, there is at least 40 bytes of overhead per packet, due to Ethernet frame headers, IP headers, and TCP headers. Although the outgoing channel queue could be eliminated, this would reduce network bandwidth efficiency to less than 10% if 32 bit integers were used as tokens. This elimination would also increase CPU usage. The Nagle algorithm, present in most TCP implementations, does not provide any performance benefit here. Instead of operating at the token level, all communications is performed at the byte level. Conceptually, a token is a single byte and processes communicate by sending/receiving multiple tokens at a time. When an outgoing channel establishes a connection to a remote process, it first obtains the number of bytes available in the remote process s incoming channel queue and stores this in a variable named remoteavail. When an outgoing channel transmits x bytes of token data, it decrements remoteavail by x. After a process consumes data from its incoming channel queue, it sends a Bytes Consumed message over the TCP link that contains the number of bytes

7 consumed. Upon receiving such a message, the outgoing channel increments its remoteavail by this amount. Thus, remoteavail represents a lower bound on the number of number of bytes available in the queue of the remote process. The computation thread is blocked if it attempts to read more data than is present in an incoming channel s queue or if it attempts to write more than remoteavail bytes on an outgoing channel. The communication thread of each process runs once per 5ms. Thus, if a process consumes 100 bytes in 4ms, one Bytes Consumed message may be sent. This same mechanism also helps to aggregate tokens before transmission. For the transmission of data, a lightweight serialization mechanism has also been implemented. The interface is similar to that of Java, but it is more efficient in terms of CPU usage and bandwidth. C++ classes can be serialized by inheriting from a Serializable class and then defining a method for serialization and one for de-serialization. Platform-dependent byte reordering is also performed on all basic C/C++ data-types. To implement deadlock detection, Mitchell and Merritt s algorithm is used. Since this deadlock detection algorithm does not require any arrays or a list of all processes, as in the case of other deadlock detection algorithms [14], this algorithm is compatible with dynamic process creation/deletion/migration. In this implementation, the label is an ordered pair (count, p) of two integers. Initially each the labels of each process are initialized to (pid, pid) where pid is a globally unique identifier for that process. When the computation thread of process X is blocked waiting on process Y, the label of process X becomes max(x.count, Y.count), X.p). For comparison purposes, the label of process X is greater than the label of process Y if (X.count > Y.count) OR (X.count = Y.count AND X.p > Y.p). To reduce network bandwidth, the deadlock detection algorithm is only activated if a process s computation thread has been (continuously) blocked for a sufficient period of time, currently set at 1 second. Likewise,

8 the same interval is also used for polling in the transmit step of the algorithm. Deadlock detection data and process token data are sent through the same TCP link. When a process becomes blocked on a read or write, it sends a Label Request message. If a process becomes blocked on a read while the needed token data is in transit, the FIFO property of the TCP protocol ensures that the token data will arrive before the label of the remote process. Thus the blocked process will never perform the blocking step of the deadlock detection algorithm if there is data already in transit. Likewise, the same guarantee holds for processes blocked on writes and the arrival of Bytes Consumed messages. An extra optimization that has been implemented is that for an outgoing channel, token data packets are only sent if there is at least one kilobyte of data in the queue. Upon the receipt of a Label Request message, any remaining data is sent before the process s public label. This optimization helps to minimize communication protocol overhead and CPU usage. Experimental tests confirm this DPN implementation detects deadlocks involving all processes blocked on reads, all processes blocked on writes, and artificial deadlocks involving some process blocked on writes and others blocked on reads. In terms of the actual interface to reading and writing tokens, both the regular and computational process network models are supported. The interface for the computational process network style is similar to the implementation of Allen and Evans [2]. V. PERFORMANCE Experimental tests show that this framework is capable of handling up to two million tokens per second on an Athlon 1.6 GHz PC. For single byte tokens, the use of queues in the outgoing channels increased performance by a factor of 20 over the same implementation sending tokens directly. Furthermore, the processing time per token appears to be independent of the token size.

9 Thus the run-time overhead of this framework is negligible if a computation spends significantly more than 0.5µs CPU time per token. In addition, the token aggregation methods described cause the communication protocol overhead to be negligible. VI. CONCLUSION In conclusion, distributing the process network model offers greater performance at reduced economic cost over a non-distributed model. An original deadlock detection scheme for process networks has been presented that detects both local and global deadlock. This scheme is applicable to both distributed as well as non-distributed process network implementations. Lastly, this paper presents a design of a high-performance distributed process network implementation that performs deadlock detection. REFERENCES [1] G. Kahn, The semantics of a simple language for parallel programming, Information Processing, pp. 471 475, 1974. [2] G. Allen and B. Evans, Real-time sonar beamforming on workstations using process networks and POSIX threads, in IEEE Trans. Signal Processing, Mar. 2000, pp. 921 926. [3] T. Parks, Bounded scheduling of process networks, Ph.D. dissertation, University of California at Berkeley, 1995. [Online]. Available: citeseer.ist.psu.edu/parks95bounded.html [4] J. T. Buck, Scheduling dynamic dataflow graphs with bounded memory using the token flow model, Ph.D. dissertation, University of California at Berkeley, 1993. [Online]. Available: citeseer.ist.psu.edu/buck93scheduling.html [5] M. Geilen and T. Basten, Requirements on the execution of Kahn process networks, in Programming Languages and Systems, 12th European Symposium on Programming, vol. 2618. Berlin, Germany: Springer-Verlag, 2003. [Online]. Available: http://www.ics.ele.tue.nl/ mgeilen/publications/esop03.pdf [6] M. Goel, Process networks in Ptolemy II, Master s thesis, University of California at Berkeley, Dec. 1998. [Online]. Available: http://ptolemy.eecs.berkeley.edu/publications/papers/98/pninptolemyii/ [7] B. Vaidyanathan, Artificial deadlock detection and correction in bounded scheduling of process networks, Oct. 1999. [Online]. Available: http://www.ece.utexas.edu/ bevans/courses/ee382c/projects/fall99/index.html [8] R. Stevens, M. Wan, P. Laramie, T. Parks, and E. Lee, Implementation of process networks in Java, Tech. Rep., July 1997, draft. [Online]. Available: http://www.ait.nrl.navy.mil/pgmt/pnpaper.pdf [9] A. Amar, P. Boulet, J.-L. Dekeyser, and F. Theeuwen, Distributed process networks using half FIFO queues in CORBA, INRIA, Tech. Rep. RR-4765, Mar. 2003. [Online]. Available: http://www.inria.fr/rrrt/rr-4765.html [10] T. Parks and D. Roberts, Distributed process networks in Java, in International Workshop on Java for Parallel and Distributed Computing, Nice, France, Apr. 2003. [11] D. W. Julien Vayssière and A. Wendelborn, Distributed process networks, University of Adelaide, Austrailia, Tech. Rep. TR 99-03, Oct. 1999, draft. [Online]. Available: http://www.cs.adelaide.edu.au/ dpn/documents/tr9904.ps [12] D. P. Mitchell and M. J. Merritt, A distributed algorithm for deadlock detection and resolution, in ACM Symposium on Principles of Distributed Computing, 1984, pp. 282 284. [13] J. Smith, Decoupled access/execute computer architectures, in 9th Annual Symposium on Computer Architecture, May 1982, pp. 112 119. [14] K. M. Chandy, J. Misra, and L. M. Hass., Distributed deadlock detection, in ACM Trans. on Comp. Systems, vol. 1, no. 2, May 1983, pp. 144 156.