Time Warp State Saving and Simultaneous Events. Outline State Saving Techniques –Copy State Saving –Infrequent State Saving –Incremental State Saving.

Slides:



Advertisements
Similar presentations
Garbage collection David Walker CS 320. Where are we? Last time: A survey of common garbage collection techniques –Manual memory management –Reference.
Advertisements

Parallel Discrete Event Simulation Richard Fujimoto Communications of the ACM, Oct
Parallel and Distributed Simulation Global Virtual Time - Part 2.
Time Warp: Global Control Distributed Snapshots and Fossil Collection.
Parallel and Distributed Simulation Time Warp: Basic Algorithm.
Lookahead. Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead.
Optimistic Parallel Discrete Event Simulation Based on Multi-core Platform and its Performance Analysis Nianle Su, Hongtao Hou, Feng Yang, Qun Li and Weiping.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Programming Types of Testing.
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.
Parallel Programming Laboratory1 Fault Tolerance in Charm++ Sayantan Chakravorty.
Parallel and Distributed Simulation Time Warp: State Saving.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Chapter 16 Control Unit Operation No HW problems on this chapter. It is important to understand this material on the architecture of computer control units,
Rollback by Reverse Computation Kevin Hamlen CS717: Fault-Tolerant Computing.
Quick Review of May 1 material Concurrent Execution and Serializability –inconsistent concurrent schedules –transaction conflicts serializable == conflict.
Transaction Management and Concurrency Control
CS-550 (M.Soneru): Recovery [SaS] 1 Recovery. CS-550 (M.Soneru): Recovery [SaS] 2 Recovery Computer system recovery: –Restore the system to a normal operational.
Efficient Optimistic Parallel Simulations Using Reverse Computation Chris Carothers Department of Computer Science Rensselaer Polytechnic Institute Kalyan.
3.5 Interprocess Communication
Internet Networking Spring 2003
Chapter 16 Control Unit Implemntation. A Basic Computer Model.
Parallel and Distributed Simulation Object-Oriented Simulation.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Recursion A recursive function is a function that calls itself either directly or indirectly through another function. The problems that can be solved.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
July 16, 2015ICS 5411 Coping With System Failure Chapter 17 of GUW.
 Explore the principles of cost-volume-profit relationships  Perform a basic what-if analysis  Use Goal Seek to calculate a solution  Create a one-variable.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
 Mechanism for restoring a database quickly and accurately after loss or damage  RESPONSIBILITY OF ?????  Recovery facilities: Backup Facilities Backup.
Backup and Recovery Part 1.
A Survey of Rollback-Recovery Protocols in Message-Passing Systems M. Elnozahy, L. Alvisi, Y. Wang, D. Johnson Carnegie Mellon University Presented by:
Time Warp OS1 Time Warp Operating System Presenter: Munehiro Fukuda.
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,
Capture and Replay Often used for regression test development –Tool used to capture interactions with the system under test. –Inputs must be captured;
Copyright © 2007, Oracle. All rights reserved. Managing Concurrent Requests.
CHAPTER 02 Recursion Compiled by: Dr. Mohammad Omar Alhawarat.
Functions and an Introduction to Recursion.  Recursive function ◦ A function that calls itself, either directly, or indirectly (through another function)
© 2003, Carla Ellis Simulation Techniques Overview Simulation environments emulation exec- driven sim trace- driven sim stochastic sim Workload parameters.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Parallel and Distributed Simulation Memory Management & Other Optimistic Protocols.
Concurrency Server accesses data on behalf of client – series of operations is a transaction – transactions are atomic Several clients may invoke transactions.
Edited by Malak Abdullah Jordan University of Science and Technology Data Structures Using C++ 2E Chapter 6 Recursion.
1 Control Unit Operation and Microprogramming Chap 16 & 17 of CO&A Dr. Farag.
Parallel and Distributed Simulation Time Parallel Simulation.
5/13/99 Ashish Sabharwal1 Pipelining and Hazards n Hazards occur because –Don’t have enough resources (ALU’s, memory,…) Structural Hazard –Need a value.
Parallel and Distributed Simulation Deadlock Detection & Recovery: Performance Barrier Mechanisms.
chap10 Chapter 10 Recursion chap10 2 Recursive Function recursive function The recursive function is a kind of function that calls.
Compiling code and Computation into Biochemical Reactions Presenter : Chi-Yun Cheng.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
PDES Introduction The Time Warp Mechanism

Database Recovery Techniques
Processes and threads.
“Language Mechanism for Synchronization”
Parallel and Distributed Simulation Techniques
PDES: Time Warp Mechanism Computing Global Virtual Time
CIS 321 Data Communications & Networking
Flow and Error Control.
Timewarp Elias Muche.
EEC 688/788 Secure and Dependable Computing
Chapter 10 Transaction Management and Concurrency Control
Process Description and Control
Parallel and Distributed Simulation
Interrupt handling Explain how interrupts are used to obtain processor time and how processing of interrupted jobs may later be resumed, (typical.
Parallel Exact Stochastic Simulation in Biochemical Systems
Presentation transcript:

Time Warp State Saving and Simultaneous Events

Outline State Saving Techniques –Copy State Saving –Infrequent State Saving –Incremental State Saving –Reverse Computation Simultaneous Events

Copy State Save Checkpoint all modifiable state variables of the LP prior to processing each event Rollback: copy checkpointed state to LP state variables 18 straggler message State Queue X: 0 Y: 0 Z: 0 X: 1 Y: 2 Z: 3 X: 4 Y: 2 Z: 3 restore state processed event unprocessed event snapshot of LP state Input Queue X:=1 Y:=2 Z:=3 21 X:=4 35 X:=5 Z:= LP State Variables X: 0 Y: 0 Z: 0 X: 1 Y: 2 Z: 3 X: 4 Y: 2 Z: 3 X: 5 Y: 2 Z: 9 X: 1 Y: 2 Z: 3 Resume normal processing of events

Copy State Saving Drawbacks Forward execution slowed by checkpointing –Must state save even if no rollbacks occur –Inefficient if most of the state variables are not modified by each event Consumes large amount of memory Copy state saving is only practical for LPs that do not have a large state vector Largely transparent to the simulation application (only need locations of LP state variables)

Infrequent State Saving Checkpoint LP periodically, e.g., every Nth event Rollback to time T: May not have saved state at time T –Roll back to most recent checkpointed state prior to simulation time T –Execute forward (“coast forward”) to time T Coast forward phase –Only needed to recreate state of LP at simulation time T –Coast forward execution identical to the original execution –Must “turn off” message sends during coast forward, or else rollback to T could cause new messages with time stamp < T, and roll backs to times earlier than T Could lead to rollbacks earlier than GVT rollback Coast forward Roll back to last saved state Checkpoint every third event

Infrequent State Saving Example straggler message causes rollback processed event unprocessed event saved state anti-message 41 Input Queue (event list) Output Queue (anti-messages) State Queue send anti-message 3. Roll back to simulation time 12 Restore state of LP to that prior to processing time stamp 12 event Do not send anti-message with time stamp LP State 4. Coast forward: reprocess event with time stamp Coast forward: reprocess event with time stamp21, don’t resend time stamp 24 message 6. Process straggler, continue normal event processing 26

Infrequent State Saving: Pros and Cons Reduces time required for state saving Reduces memory requirements Increases time required to roll back LP Increases complexity of Time Warp executive Largely transparent to the simulation application (only need locations of LP state variables and frequency parameter)

Incremental State Saving Only state save variables modified by an event –Generate “change log” with each event indicating previous value of state variable before it was modified Rollback –Scan change log in reverse order, restoring old values of state variables

Incremental State Save Example Before modifying a state variable, save current version in state queue Rollback: Scan state queue from back, restoring old values 18 straggler message State Queue X: 0 Y: 0 Z: 0 X: 1X: 4 Z: 3 restore state processed event unprocessed event snapshot of LP state Input Queue X:=1 Y:=2 Z:=3 21 X:=4 35 X:=5 Z:=9 LP State Variables X: 0 Y: 0 Z: 0 X: 1 Y: 2 Z: 3 X: 4 Y: 2 Z: 3 X: 5 Y: 2 Z: Resume forward execution starting with time stamp 18 event X: 4 Y: 2 Z: 3 X := 4 Z := 3 X: 1 Y: 2 Z: 3 X := 1

Incremental State Saving Must log addresses of modified variables in addition to state More efficient than copy state save if most state variables are not modified by each event Can be used in addition to copy state save Implementation –Manual insertion of state save primitives –Compiler Support: compiler inserts checkpoint primitives –Executable editing: modify executable to insert checkpoint primitives –Overload assignment operator

Approaches to Checkpointing

Reverse Computation Rather than state save, recompute prior state –For each event computation, need inverse computation –Instrument forward execution to enable reverse execution Advantages –Reduce overhead in forward computation path –Reduce memory requements Disadvantages –Tedious to do by hand, requires automation

RC - Example: ATM Multiplexer if( qlen < B ) qlen++ delays[qle n]++ else lost++ N Original if( b == 1 ) --delays[qlen] --qlen else --lost Reverse if( qlen < B ) b = 1 qlen++ delays[qlen ]++ else b = 0 lost++ Forward State Size B+2 words State Size 1 bit B on cell arrival...

Outline State Saving Techniques –Copy State Saving –Infrequent State Saving –Incremental State Saving –Reverse Computation Simultaneous Events

Issues Zero lookahead: An LP has zero lookahead if it can schedule an event with time stamp equal to the current simulation time of the LP Simultaneous events: events containing the same time stamp; in what order should they be processed? Repeatability: An execution mechanism (e.g., Time Warp) is repeatable if repeated executions produce exactly the same results –Often a requirement –Simplifies debugging

Zero Lookahead and Simultaneous Events Time Warp: Do simultaneous event cause rollback? A possible rule: If an LP processes an event at simulation time T and then receives a new event with time stamp T, roll back the event that has already been processed. processed event unprocessed event LP 1 12 LP 2 12 Rollback! 12 Cancel Message Cancel Message 12 Reprocess Event! If an event can roll back another event on which it depends, unending rollback cycles may occur.

Wide Virtual Time (WVT) Tie breaking field can be viewed as low precision bits of time stamp Time definition applies to all simulation time values (e.g., current time of an LP) time valuetie breaking fields Time stamp Approach Application uses time value field to indicate “time when the event occurs” Tie breaking field used to order simultaneous events (events with same time value)

Non-zero lookahead events: Age=1 Zero lookahead events: Age = Current Age + 1 An Approach Using WVT Application specified ordering of events: time value Time stamp: priority Application specified priority field Avoid rollback cycles: age Age field to order dependent zero lookahead events Repeatable execution LP ID ID field identifying LP that scheduled the event Sequence number indicating # of events scheduled by LP Seq # Constraint on zero lookahead events

WVT Example Avoid rollback cycles despite zero lookahead events processed event unprocessed event LP LP No Rollback!

Summary Copy State Saving –Efficient if LP state small –Can be made transparent to application Infrequent state saving –Must turn off message sending during coast forward –Reduced memory requirements –less time for state saving –Increased rollback cost Incremental State Saving –Preferred approach if large state vectors –Means to simplify usage required Reverse computation –Efficient, requires automation Zero lookahead and simultaneous events –Can lead to unending rollbacks –Wide Virtual Time provides one solution