Lookahead. Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead.

Slides:



Advertisements
Similar presentations
Parallel Discrete Event Simulation Richard Fujimoto Communications of the ACM, Oct
Advertisements

Time Management in the High Level Architecture Roger McFarlane School of Computer Science McGill University Montréal, Québec CANADA 19 March 2003.
Distributed Systems Major Design Issues Presented by: Christopher Hector CS8320 – Advanced Operating Systems Spring 2007 – Section 2.6 Presentation Dr.
Global States.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
Lecture 8: Asynchronous Network Algorithms
Parallel and Distributed Simulation Global Virtual Time - Part 2.
Time Warp: Global Control Distributed Snapshots and Fossil Collection.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Parallel and Distributed Simulation
Parallel and Distributed Simulation Time Warp: Basic Algorithm.
Parallel and Distributed Simulation Lookahead Deadlock Detection & Recovery.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Distributed Process Management
Time Management in the High Level Architecture. Outline Overview of time management services Time constrained and time regulating federates Related object.
Distributed Systems Spring 2009
CS 582 / CMPE 481 Distributed Systems
What we will cover…  Distributed Coordination 1-1.
Ordering and Consistent Cuts Presented By Biswanath Panda.
Distributed Process Management
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
Parallel Simulations on High-Performance Clusters C.D. Pham RESAM laboratory Univ. Lyon 1, France
Building Parallel Time-Constrained HLA Federates: A Case Study with the Parsec Parallel Simulation Language Winter Simulation Conference (WSC’98), Washington.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Distributed process management: Distributed deadlock
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
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.
Introduction To Time Management Siddharth Misra Background  Distributed Simulation which is nothing but simulation on LAN became a popular tool for.
Parallel and Distributed Simulation FDK Software.
Synchronous Algorithms I Barrier Synchronizations and Computing LBTS.
Hardware Supported Time Synchronization in Multi-Core Architectures 林孟諭 Dept. of Electrical Engineering National Cheng Kung University Tainan, Taiwan,
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.
Parallel and Distributed Simulation Memory Management & Other Optimistic Protocols.
Distributed Virtual Environments Introduction. Outline What are they? DVEs vs. Analytic Simulations DIS –Design principles Example.
Issues with Clocks. Context The tree correction protocol was based on the idea of local detection and correction. Protocols of this type are complex to.
LogP and BSP models. LogP model Common MPP organization: complete machine connected by a network. LogP attempts to capture the characteristics of such.
1 Distributed Process Management Chapter Distributed Global States Operating system cannot know the current state of all process in the distributed.
Winter, 2004CSS490 Synchronization1 Textbook Ch6 Instructor: Munehiro Fukuda These slides were compiled from the textbook, the reference books, and the.
SIMULATION OF A SINGLE-SERVER QUEUEING SYSTEM
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
OPERATING SYSTEMS CS 3530 Summer 2014 Systems and Models Chapter 03.
Building Dependable Distributed Systems, Copyright Wenbing Zhao
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
High Level Architecture Time Management. Time management is a difficult subject There is no real time management in DIS (usually); things happen as packets.
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Chapter pages1 Distributed Process Management Chapter 14.
Efficient Algorithms for Distributed Snapshots and Global Virtual Time Approximation Author: Friedermann Mattern Presented By: Shruthi Koundinya.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
Clock Synchronization (Time Management) Deadlock Avoidance Using Null Messages.
Parallel and Distributed Simulation Deadlock Detection & Recovery: Performance Barrier Mechanisms.
Parallel and Distributed Simulation Deadlock Detection & Recovery.
Distributed Systems Lecture 6 Global states and snapshots 1.
PDES Introduction The Time Warp Mechanism
Parallel and Distributed Simulation
Parallel and Distributed Simulation Techniques
PDES: Time Warp Mechanism Computing Global Virtual Time
Lecture 9: Asynchronous Network Algorithms
CPSC 531: System Modeling and Simulation
Parallel and Distributed Simulation
COT 5611 Operating Systems Design Principles Spring 2012
Timewarp Elias Muche.
Parallel and Distributed Simulation
Prof. Leonardo Mostarda University of Camerino
COT 5611 Operating Systems Design Principles Spring 2014
Parallel Exact Stochastic Simulation in Biochemical Systems
Presentation transcript:

Lookahead

Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead Changing lookahead Avoiding Time Creep

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 minimum transit time between airports) END-LOOP Variation: LP requests null message when FIFO becomes empty Fewer null messages Delay to get time stamp information

The Time Creep Problem Many null messages if minimum flight time is small! 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 JFK: timestamp = 5.5 Null messages: 6.0 SFO: timestamp = ORD: timestamp = JFK: timestamp = SFO: timestamp = 7.5 Five null messages to process a single event! ORD: process time stamp 7 message 7

Livelock Can Occur! 98 JFK (waiting on ORD) 7 ORD (waiting on SFO) SFO (waiting on JFK) Livelock: un-ending cycle of null messages where no LP can advance its simulation time There cannot be a cycle where for each LP in the cycle, an incoming message with time stamp T results in a new message sent to the next LP in the cycle with time stamp T (zero lookahead cycle) Suppose the minimum delay between airports is zero!

Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead Changing lookahead Avoiding Time Creep

Lookahead The null message algorithm relies on a “prediction” ability referred to as lookahead “ORD at simulation time 5, minimum transit time between airports is 3, so the next message sent by ORD must have a time stamp of at least 8” Lookahead is a constraint on LP’s behavior Link lookahead: If an LP is at simulation time T, and an outgoing link has lookahead L i, then any message sent on that link must have a time stamp of at least T+L i LP Lookahead: If an LP is at simulation time T, and has a lookahead of L, then any message sent by that LP must will have a time stamp of at least T+L –Equivalent to link lookahead where the lookahead on each outgoing link is the same

Exploiting Lookahead in Applications T = arrival time of job Q = waiting time in queue S = service time Example: Tandem first-come-first-serve queues “Classical” approach: LP 1 LP 2 arrival event departure event arrival event T T+Q T+Q+S begin service Optimized to exploit lookahead LP 1 LP 2 arrival event arrival event T T+Q T+Q+S The degree to which the program can exploit lookahead is critical for good performance

Lookahead Affects Performance Deadlock Detection and Recovery Algorithm (5 processors) Parallel Simulation of a Central Server Queueing Network mergefork Speedup: Sequential execution time / parallel execution time

Null Message Algorithm: Speed Up toroid topology message density: 4 per LP 1 millisecond computation per event vary time stamp increment distribution ILAR=lookahead / average time stamp increment Conservative algorithms live or die by their lookahead!

Lookahead and the Simulation Model Lookahead is clearly dependent on the simulation model could be derived from physical constraints in the system being modeled, such as minimum simulation time for one entity to affect another (e.g., a weapon fired from a tank requires L units of time to reach another tank, or maximum speed of the tank places lower bound on how soon it can affect another entity) could be derived from characteristics of the simulation entities, such as non- preemptable behavior (e.g., a tank is traveling north at 30 mph, and nothing in the federation model can cause its behavior to change over the next 10 minutes, so all output from the tank simulator can be generated immediately up to time “local clock + 10 minutes”) could be derived from tolerance to temporal inaccuracies (e.g., users cannot perceive temporal difference of 100 milliseconds, so messages may be timestamped 100 milliseconds into the future). simulations may be able to precompute when its next interaction with another simulation will be (e.g., if time until next interaction is stochastic, pre-sample random number generator to determine time of next interaction). Observation: time-stepped simulations implicitly use lookahead; events in current time step are considered independent (and can be processed concurrently), new events are generated for the next time step, or later.

LP A LP B LP C LP D Simulation Time problem: limited concurrency each LP must process events in time stamp order LT A possible message OK to process event not OK to process yet without lookahead Each LP A using logical time declares a lookahead value L; the time stamp of any event generated by the LP must be ≥ LT A + L Lookahead is necessary to allow concurrent processing of events with different time stamps (unless optimistic event processing is used) Why Lookahead is Important possible message OK to process with lookahead LT A +L Lookahead is used in virtually all conservative synchronization protocols Essential to allow concurrent processing of events

Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead Changing lookahead Avoiding Time Creep

Changing Lookahead Values Increasing lookahead –No problem; lookahead can immediately be changed Decreasing lookahead –Previous time stamp guarantees must be honored –Lookahead cannot immediately be decreased If an LP is at simulation time 10 and lookahead is 5, it has promised subsequent messages will have a time stamp of at least 15 If lookahead were immediately set to 1, it could generate a message with time stamp 11 –Lookahead can decrease by k units of simulation time only after the LP has advanced k units of simulation time

Example: Decreasing Lookahead SFO: simulation time = 10, lookahead = 5 Future messages sent on link must have time stamp ≥ 15 SFO: request its lookahead be reduced to 1 LP clock Lookahead Minimum time Stamp of outgoing messages 17

Preventing Time Creep: Next Event Time Information 98 JFK (waiting on ORD) 7 ORD (waiting on SFO) SFO (waiting on JFK) Observation: smallest time stamped event is safe to process Lookahead creep avoided by allowing the synchronization algorithm to immediately advance to (global) time of the next event Synchronization algorithm must know time stamp of LP’s next event Each LP guarantees a logical time T such that if no additional events are delivered to LP with TS < T, all subsequent messages that LP produces have a time stamp at least T+L (L = lookahead)

Summary Null message algorithm –Lookahead creep problem –No zero lookahead cycles allowed Lookahead –Constraint on time stamps of subsequent messages –Has large effect on performance: essential for concurrent processing of events for conservative algorithms –Programs must be coded to exploit lookahead Use time of next event to avoid lookahead creep