150 likes | 173 Views
Parallel Discrete Event Simulation. Richard Fujimoto CACM, Oct. 1990. Still relevant after all these years?. Structure of Discrete Event Simulation. scheduler. eventQ. State var. Event handlers. results. Parallel Discrete Event Simulation. scheduler. eventQ. State var. Event handlers.
E N D
Parallel Discrete Event Simulation Richard FujimotoCACM, Oct. 1990 Still relevant after all these years?
Structure of Discrete Event Simulation scheduler eventQ State var Event handlers results
Parallel Discrete Event Simulation scheduler eventQ State var Event handlers results scheduler eventQ State var Event handlers results
Parallel Discrete Event Simulation scheduler E1 State var scheduler E2 • Assume: • timestamped msg exchanges • partitioned state State var
Parallel Discrete Event Simulation scheduler E3 State var scheduler E4 E2 State var
Parallel Discrete Event Simulation scheduler E3 State var scheduler E4 E2 State var
Causality Problems E3 scheduler E2.5 State var E2 scheduler E4 State var
Conservative vs. Optimistic • Conservative – avoid possibility of causality errors occurring. Only execute “safe” events. • Synchronization mechanism (possibly application-specific) • Optimistic – proceed, detect errors, rollback • Save state to allow rollbacks • Squash event messages
Conservative Approaches • Execute globally smallest timestamped event • No ||ism • Per-process – execute smallest timestamped event s.t. impossible for a new event to show up with lower timestamp • Queue per link • Pick queue with smallest timestamp lower-bound t=2 scheduler E2 t=4 t=5
Conservative Approaches • Execute globally smallest timestamped event • No ||ism • Per-process – execute smallest timestamped event s.t. impossible for a new event to show up with lower timestamp • Queue per link • Pick queue with smallest timestamp lower-bound • If empty - block t=2 scheduler E2 t=1 t=1
Conservative Approaches • Execute globally smallest timestamped event • No ||ism • Per-process – execute smallest timestamped event s.t. impossible for a new event to show up with lower timestamp • Queue per link • Pick queue with smallest timestamp lower-bound • If empty – block • Null messages for deadlock t=2 scheduler E2 4 t=1 3 t=1 Null, 4 Null, 3 - Can explicitly ask for Null msg
Conservative Approaches • Deadlock detection and recovery • Barrier Synchronization • Moving time window – uses knowledge to limit search space (e.g. min timestamp increments) • An event “further away” than n can’t generate a new event that would fall inside the specified window • Lookahead – prediction of future events • Precomputing • Arrival of event at time T+Q+S is invariant to any events occurring in interval [T, T+Q+S] • Conditional vs. definite events
Optimistic Approaches • Detect and recover from causality errors • Time Warp simulations • Event causing rollback is a straggler • Rollback based on periodic state saving • Anti-messages sent to cancel event messages sent elsewhere that should not have happened. • Smallest timestamp is Global Virtual Time (GVT) • Any event with timestamp < GVT is safe
Optimistic Approaches • Lazy Cancellation – do not immediately send anti-messages – wait and see if same messages would be sent when re-evaluation occurs. • If clock goes past anti-message’s time T without original being regenerated, then must send it • Lazy Reevaluation – compares state, if unchanged jump forward over rollback • Time windows – to prevent propagating incorrect execution too far ahead.
Sequentiality when unnecessary Lookahead seems crucial for getting performance. Can exploit ||ism Thrashing? Is rollback too common an occurrence? State saving overhead Conservative vs. Optimistic