390 likes | 532 Vues
Interactive Parallel & Distributed Simulation. Outline. Introduction to Parallel and distributed simulation (basic concepts) Methods in Interactive PADS Overview Approaches Conclusion, current state, future work. Time-stepped : time advances by fixed time increments
E N D
Interactive Parallel & Distributed Simulation Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Outline • Introduction to Parallel and distributed simulation (basic concepts) • Methods in Interactive PADS • Overview • Approaches • Conclusion, current state, future work Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Time-stepped: time advances by fixed time increments Event driven: time advances occur with irregular increments Area Definition computer simulation discrete models continuous models event driven time- stepped Interactive Parallel and Distributed Simulation - DSS - Jan Klír
As fast as possible Analytical simulations High Performance Computing Community Conservative and Optimistic (Time Warp) synchronization Realtime Virtual environments, hardware-in-the-loop Defense M&S community SIMNET -> DIS -> HLA Distributed Simulation Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Conservative Synchronization events ready to be processed LP 1 events not ready to be processed LP 2 LP 3 LP 4 T Simulation Time T+L • L – Lookahead – Any message sent by a LP must have timestamp at least T + L • Necessary to allow concurrent processing of events with different time stamps • Relies on model props, complicates the model development Interactive Parallel and Distributed Simulation - DSS - Jan Klír
processed events LP 1 unprocessed events LP 2 LP 3 rollback LP 4 T Simulation Time Optimistic Synchronization • LP processes events without checking if an event in its past could later arrive • If an event arrives in the LPs past (straggler message), the computation is rolled back Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Optimistic Synchronizationlocal control mechanism Input Queue (event list) processed event unprocessed event saved state anti-message 12 21 35 State Queue 12 12 Output Queue (anti-messages) straggler message arrives in the past, causing rollback • LP processes events in time order like sequential simulator • The state before processed events must be saved, the messages sent to other LPs must be also saved • When a message arrives in the past (straggler message), the rollback is initiated Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Optimistic Synchronizationconcepts and notions • State saving – various algorithms (Copy SS, Periodic SS, Incremental SS, …) • Anti messages • In case of rollback are sent to destination LPs • If LP gets anti message, the corresponding waiting event is removed from the queue (annihilation) Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Optimistic Synchronizationconcepts and notions • Global virtual time • Minimum timestamp of any unprocessed message or anti-message in the whole system • Used to reclaim memory used by SS and output queues (fossil collection) • Also serves to commit blocking I/O operations • Synchronous X Asynchronous GVT computation • Wide spectrum of GVT algorithms exist today, the selection depends on application. The algorithms are non-trivial in distributed environments. Interactive Parallel and Distributed Simulation - DSS - Jan Klír
PADS Conclusion • Conservative or Optimistic approach • Optimistic much more used than conservative • Next part: Interactive methods based on PADS Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Interactive simulation Methods in Interactive PADS Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Interactive simulation - outline • Introduction – applications & requirements • Description of Interactive PADS approaches • Multiple path exploration • Input / output • Variable resolution modeling • Summary, open issues, current state Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Applications of Interactive Simulation • Decision support - (Air) traffic control, planning, … • Interactive system analysis – Networks, transportation systems, ecological systems, logistics, battlefield, … • Virtual environments – Training simulators, medicine (virtual surgery), … Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Requirementswhat should an interactive simulator support • Exploration of different simulation futures • Rewind to some point and continue with different input • Execute multiple simulations concurrently • Fast input and output • Variable resolution models • Interactive detail level changing Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Multiple Path Exploration • Uses – explore different simulation paths based on different input parameters • Approaches • Multiple sequential simulations with different parameters • Interactive simulation steering with rollback & reexecution • Cloning (Virtual processes) Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Rollback & Reexecution • Input events called ‘steering’ events – modify the simulation path according the input • Special ‘reexecution’ events allow to rewind to the past • Scheduled to the past • The simulation can take a new path by inputting new data via steering events • Suitable for Time Warp simulators that utilize the rollback as a part of the synchronization Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Rollback & Reexecution • Problems • There must be a saved state prior the time of the reexecution event • The available rollback length is limited - due to fossil collection in Time Warp simulators the old saved states are reclaimed as the GVT passes • Some state saving schemes were developed but the rollback is still limited Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Cloning (Virtual Processes) • Multiple simulation futures are computed in parallel • The futures share the computation until they branch with different parameters • Uses the Virtual processes paradigm • All the computed simulations contain virtual processes • All corresponding virtual processes are mapped to a single physical process, until the branch Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Virtual simulation planes VA1 VB1 VC1 A1 B1 1 C1 VA2 VB2 VC2 A2 B2 PA2 PB1 PC1 2 C2 PA1 Virtual Processes 2 virtual simulations, cloned on process A Mapping to phys. processes Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Virtual Processes • Communication • B -> C: message to PC and thus to VC1 and VC2 • B -> A: message to PA1 (VA1) and copied to PA2 (VA2) • A -> B (A1 to B1): PB2 created and message sent to PB1 (VB1) Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Cloning • 3 phases: Both simulations identical; Incremental cloning; Both simulations fully cloned • Cloning rate depends on the amount of communication Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Multiple Path Explorationsummary • Reexecution more interactive, cloning faster (offers more parallelism) • Reexecution - limited rollback length; cloning – all paths must be known before the branch • Open issues • Greater rollback length, merging convergent sim. paths, create new branch point in the past and keep the current path, … Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Input / Output • Purpose: To provide accurate and fast I/O to distributed simulators • Several classes of I/O events: • Blocking X non-blocking • Various types of access to the simulation state • Speed-up: optimistic output Interactive Parallel and Distributed Simulation - DSS - Jan Klír
I/O Events • 3 classes of output events: • Sampling: provide a subset of state information in regular intervals • Notification: occur in predefined transient condition • Queries: require access to arbitrary state in previously unknown time • Input: • Events injected by external entities • Blocking requests for input scheduled by the simulator Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Optimistic Output • Output is often visually rich and computation intensive • Speedup: • Output is non-blocking event • It’s optimistically precomputed and thrown away in case of rollback • Good for faster-than-realtime simulators and computationally intensive output Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Input / Outputconclusion • Open issues • Queries in distributed simulation, over a wide time range • Optimistic output: • Limiting the optimism to save resources • Relationship between optimistic output and the probability of input Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Variable Resolution Modeling • Why use VRM? • Speed-up – execute the focused portion at full detail and the other at a lower d. • Zooming – overview the whole and focus on details to better comprehend the simulated phenomenon • Whole-greater-than-sum-of-parts relationship • Combine different legacy models with diff. detail -> heterogeneous sim. Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Variable Resolution Modelingapproaches • Selective viewing • Simulate only the most detailed model • Calculate the other views from the most detailed model • Aggregation/Disaggregation • One level is executed at one time • When needed, low resolution entity is replaced with a set of high res. entities (disaggregation) and vice versa Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Variable Resolution Modelingapproaches • Concurrent representation • All the entities are in the model concurrently • Only the selected detail level is executed • Other detail levels maintain consistency by transforming the results from the running entities • Existing methods use mix of these approaches Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Multi Representation Entities • Single MRE has multiple detail levels • Communication with other entities at appropriate level • Consistency maintained by C.E. which has a set of mapping functions to convert the state values MRE E1 E2 A Consistency enforcer B1 B1 B1 E3 Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Hooking Transactions • Model designed at multiple detail levels • At the run time, the channel leading to the LRE can be redirected to a HRE to increase the detail (zoom in) • The disaggregated LRE can continue or is stripped completely • Simulation language primitives exist to be used by modelers Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Hooking Transactions LRE 1 LRE 2 LRE 3 HRE 1 Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Hooking Transactions • Consistency: Attribute ghosting • Attributes of the striped entity are calculated from the newly hooked entity • Mapping consistency • The state of the HRE on disaggregation must be properly initialized from the LRE’s state (and vice versa) Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Aggregation / Disaggregation • Used often in the HLA area • Low resolution entities (aircraft patrols) automatically disaggregate to a set of high resolution entities (single aircrafts) when approaching other HREs (ground radars) • HLA is enriched with a set of functions that enable the registration of HREs and LREs, together with transformation functions and disaggregation conditions Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Aggregation / Disaggregation HRE1 LRE 1 LRE 2 LRE 3 HRE2 HRE3 Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Other Approaches • Optimization based MRM • Models at different resolution level provide a set of inputs • Mathematical function describing differences between the outputs is defined • Using mathematical analysis the inputs are calculated so the differences between the outputs are minimized Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Variable Resolution Modelingsummary • VRM – rich area with variety of possible applications • Hooking • Highly interactive • Currently only for sequential simulation • MRE • Solid design • Not widely used (high complexity and demands on modelers) • Aggregation/Disaggregation • Oldest approach, simple • Good for real-time simulation area (HLA) Interactive Parallel and Distributed Simulation - DSS - Jan Klír
Current Stateand future work • Prof. Šafařík - 2 diploma theses to incorporate optimistic and conservative synchronization to J-Sim (C-Sim) • Base on this and incorporate the interactivity as shown in this presentation, trying to overcome the shortcomings of the presented approaches Interactive Parallel and Distributed Simulation - DSS - Jan Klír
The End Questions ??? Some pictures were reproduced from the Parallel and Distributed Simulation course by M. Hybinette, PADS presentations by R. Fujimoto, and from various papers cited in the Methods in Interactive Parallel and Distributed Simulation paper Interactive Parallel and Distributed Simulation - DSS - Jan Klír