Clock Synchronization (Time Management) Deadlock Avoidance Using Null Messages.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Parallel Discrete Event Simulation Richard Fujimoto Communications of the ACM, Oct
Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
Global States.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Lecture 8: Asynchronous Network Algorithms
Parallel and Distributed Simulation Global Virtual Time - Part 2.
Time Warp: Global Control Distributed Snapshots and Fossil Collection.
Parallel and Distributed Simulation
Previously… Processes –Process States –Context Switching –Process Queues Threads –Thread Mappings Scheduling –FCFS –SJF –Priority scheduling –Round Robin.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Parallel and Distributed Simulation Time Warp: Basic Algorithm.
Parallel and Distributed Simulation Lookahead Deadlock Detection & Recovery.
Lookahead. Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead.
Other Optimistic Mechanism, Memory Management. Outline Dynamic Memory Allocation Error Handling Event Retraction Lazy Cancellation Lazy Re-Evaluation.
Parallel and Distributed Simulation Time Warp: Other Mechanisms.
Time Management in the High Level Architecture. Outline Overview of time management services Time constrained and time regulating federates Related object.
1 A Practical Efficiency Criterion For The Null Message Algorithm András Varga 1, Y. Ahmet Şekerciuğlu 2, Gregory K. Egan 2 1 Omnest Global, Inc. 2 CTIE,
Causality & Global States. P1 P2 P Physical Time 4 6 Include(obj1 ) obj1.method() P2 has obj1 Causality violation occurs when order.
Ordering and Consistent Cuts Presented By Biswanath Panda.
1: Operating Systems Overview
What Mum Never Told Me about Parallel Simulation K arim Djemame Informatics Research Lab. & School of Computing University of Leeds.
Concurrency CS 510: Programming Languages David Walker.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
OPERATING SYSTEM OVERVIEW
Discrete Event Simulation Event-Oriented Simulations By Syed S. Rizvi.
Parallel Simulations on High-Performance Clusters C.D. Pham RESAM laboratory Univ. Lyon 1, France
Parallel and Distributed Simulation Object-Oriented Simulation.
Building Parallel Time-Constrained HLA Federates: A Case Study with the Parsec Parallel Simulation Language Winter Simulation Conference (WSC’98), Washington.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Christopher D. Carothers
Parallel and Distributed Simulation FDK Software.
Synchronous Algorithms I Barrier Synchronizations and Computing LBTS.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
 What is an operating system? What is an operating system?  Where does the OS fit in? Where does the OS fit in?  Services provided by an OS Services.
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Hardware Supported Time Synchronization in Multi-Core Architectures 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan,
Parallel and Distributed Simulation Hardware Platforms Simulation Fundamentals.
1 A Mutual Exclusion Algorithm for Ad Hoc Mobile networks Presentation by Sanjeev Verma For COEN th Nov, 2003 J. E. Walter, J. L. Welch and N. Vaidya.
Chapter 101 Multiprocessor and Real- Time Scheduling Chapter 10.
Parallel and Distributed Simulation Memory Management & Other Optimistic Protocols.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Parallel and Distributed Simulation Process Oriented Simulation.
Shuman Guo CSc 8320 Advanced Operating Systems
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
Distributed simulation with MPI in ns-3 Joshua Pelkey and Dr. George Riley Wns3 March 25, 2011.
Dr. Anis Koubâa CS433 Modeling and Simulation
CS433 Modeling and Simulation Lecture 09 – Part 02 Discrete Events Simulation Dr. Anis Koubâa 27 Dec 2008 Al-Imam.
Parallel and Distributed Simulation Process Oriented Simulation.
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
Parallel and Distributed Simulation Deadlock Detection & Recovery: Performance Barrier Mechanisms.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
Parallel and Distributed Simulation Deadlock Detection & Recovery.
Simulation Modeling & Simulation 33.  Simulation: It is a numerical technique for conducting experiments with certain types of mathematical models.
Distributed Systems Lecture 6 Global states and snapshots 1.
Introduction to Simulation What is a simulation? A system that represents or emulates the behavior of another system over time; a computer simulation is.
Process Management Deadlocks.
PDES Introduction The Time Warp Mechanism
Parallel and Distributed Simulation
ADVANTAGES OF SIMULATION
Parallel and Distributed Simulation Techniques
PDES: Time Warp Mechanism Computing Global Virtual Time
CPSC 531: System Modeling and Simulation
Parallel and Distributed Simulation
Timewarp Elias Muche.
Parallel and Distributed Simulation
Parallel Discrete-Event Simulations
Parallel Exact Stochastic Simulation in Biochemical Systems
Presentation transcript:

Clock Synchronization (Time Management) Deadlock Avoidance Using Null Messages

Outline Parallel / Distributed Computers Air Traffic Network Example Parallel Discrete Event Simulation –Logical processes & time stamped messages –Local causality constraint and the synchronization problem Chandy/Misra/Bryant Null Message Algorithm –Ground rules –An algorithm that doesn’t work –Deadlock avoidance using null messages

Parallel and Distributed Computers Parallel computers (tightly coupled processors) –Shared memory multiprocessors –Distributed memory multicomputers Distributed computers (loosely coupled processors) –Networked workstations Parallel ComputersDistributed Computers Physical extentMachine roomBuilding, city, global ProcessorsHomogeneousOften heterogeneousComm. NetworkCustom switchCommercial LAN / WAN Comm. Latency (small messages) A few to tens of microseconds hundreds of microseconds to seconds

Shared Memory Multiprocessors CPU cache interconnection network memory I/O devices... Many examples: Sun, Dell, SGI, etc. { shared int i; L … Lock (L) i = i + 1; Unlock (L) … } Processor 1 { shared int i, L … Lock (L) i = i + 1; Unlock (L) … } Processor 2 programming model: shared variables; synchronization via locks

Distributed Memory Multicomputers CPU cache Interconnection network memory... communications controller CPU cache memory communications controller Examples: IBM SP {int i; … Send (2, &i, sizeof(int)) … } Processor 1 {int j; … Receive (&j, sizeof(int)); … } Processor 2 programming model: no shared variables; message passing

Event-Oriented Simulation state variables Integer: InTheAir; Integer: OnTheGround; Boolean: RunwayFree; Event handler procedures Simulation application Arrival Event { … } Landed Event { … } Departure Event { … } Pending Event List (PEL) 9:00 9:16 10:10 Now = 8:45 Simulation executive Event processing loop While (simulation not finished) E = smallest time stamp event in PEL Remove E from PEL Now := time stamp of E call event handler procedure

Parallel Discrete Event Simulation Extend example to model a network of airports –Encapsulate each airport simulator in a logical process –Logical processes can schedule events (send messages) for other logical processes More generally... Physical system –Collection of interacting physical processes (airports) Simulation –Collection of logical processes (LPs) –Each LP models a physical process –Interactions between physical processes modeled by scheduling events between LPs

Parallel Discrete Event Simulation Example all interactions between LPs must be via messages (no shared state) SFO JFK ORD physical processinteractions among physical processes Physical system logical processtime stamped event (message) ORD SFO JFK arrival 10:00 Simulation

LP Simulation Example Arrival Event: InTheAir := InTheAir+1; If (RunwayFree) RunwayFree:=FALSE; Schedule Landed event Now+R; Now: current simulation time InTheAir: number of aircraft landing or waiting to land OnTheGround: number of landed aircraft RunwayFree: Boolean, true if runway available Landed Event: InTheAir:=InTheAir-1; OnTheGround:=OnTheGround+1; Schedule Departure event Now + G; If (InTheAir>0) Schedule Landed event Now+R; Else RunwayFree := TRUE; Departure Event (D = delay to reach another airport): OnTheGround := OnTheGround - 1; Schedule Arrival Event another airport

logical process ORD SFOJFK arrival 10:00 Approach to Parallel/Distributed Execution LP paradigm appears well suited to concurrent execution Map LPs to different processors –Multiple LPs per processor OK time stamped event (message) Communication via message passing –All interactions via messages –No shared state variables

The “Rub” Golden rule for each process: “Thou shalt process incoming messages in time stamp order” (local causality constraint) Safe to process? ORD SFO JFK arrival 10:00

The Synchronization Problem Synchronization Problem: An algorithm is needed to ensure each LP processes events in time stamp order Observation: ignoring events with the same time stamp, adherence to the local causality constraint is sufficient to ensure that the parallel simulation will produce exactly the same results as a sequential execution where all events across all LPs are processed in time stamp order.

Synchronization Algorithms Conservative synchronization: avoid violating the local causality constraint (wait until it’s safe) –deadlock avoidance using null messages (Chandy/Misra/Bryant) –deadlock detection and recovery –synchronous algorithms (e.g., execute in “rounds”) Optimistic synchronization: allow violations of local causality to occur, but detect them at runtime and recover using a rollback mechanism –Time Warp (Jefferson) –numerous other approaches

Outline Parallel / Distributed Computers Air Traffic Network Example Parallel Discrete Event Simulation –Logical processes –Local causality constraint Chandy/Misra/Bryant Null Message Algorithm –Ground rules –An algorithm that doesn’t work –Deadlock avoidance using null messages

Chandy/Misra/Bryant “Null Message” Algorithm Assumptions logical processes (LPs) exchanging time stamped events (messages) static network topology, no dynamic creation of LPs messages sent on each link are sent in time stamp order network provides reliable delivery, preserves order Goal: Ensure LP processes events in time stamp order JFKSFO ORD JFK logical process one FIFO queue per incoming link Observation: The above assumptions imply the time stamp of the last message received on a link is a lower bound on the time stamp (LBTS) of subsequent messages received on that link

A Simple Conservative Algorithm Observation: Algorithm A is prone to deadlock! Algorithm A (executed by each LP): Goal: Ensure events are processed in time stamp order: WHILE (simulation is not over) wait until each FIFO contains at least one message remove smallest time stamped event from its FIFO process that event END-LOOP JFK logical process ORD SFO wait till message is received from SFO process time stamp 2 event process time stamp 4 event process time stamp 5 event

Deadlock Example A cycle of LPs forms where each is waiting on the next LP in the cycle. No LP can advance; the simulation is deadlocked. 98 JFK (waiting on ORD) 7 ORD (waiting on SFO) SFO (waiting on JFK) 15 10

Deadlock Avoidance Using Null Messages Break deadlock: each LP send “null” messages indicating a lower bound on the time stamp of future messages. 98 JFK (waiting on ORD) ORD (waiting on SFO) SFO (waiting on JFK) Assume minimum delay between airports is 3 units of time JFK initially at time 5 8 JFK sends null message to SFO with time stamp 8 11 SFO sends null message to ORD with time stamp 11 7 ORD may now process message with time stamp 7

Deadlock Avoidance Using Null Messages Null Message Algorithm (executed by each LP): Goal: Ensure events are processed in time stamp order and avoid deadlock WHILE (simulation is not over) wait until each FIFO contains at least one message remove smallest time stamped event from its FIFO process that event send null messages to neighboring LPs with time stamp indicating a lower bound on future messages sent to that LP (current time plus lookahead) END-LOOP The null message algorithm relies on a “lookahead” ability.

Summary Parallel Discrete Event Simulation –Collection of sequential simulators (LPs) possibly running on different processors –Logical processes communicating exclusively by exchanging messages Chandy/Misra/Bryant Null Message Algorithm –Null messages: Lower bound on the time stamp of future messages the LP will send –Null messages avoid deadlock