Parallel and Distributed Simulation Hardware Platforms Simulation Fundamentals

Parallel and Distributed Simulation Hardware Platforms Simulation Fundamentals

Outline • Hardware Platforms – Parallel computers – Distributed computers • Simulation Fundamentals – State – Time flow mechanisms

Parallel and Distributed Computers • Parallel computers (tightly coupled processors) – Shared memory multiprocessors – Distributed memory multicomputers • Distributed computers (loosely coupled processors) – Networked workstations Parallel Computers Distributed Computers Physical extent Machine room Building, city, global Processors Homogeneous Often heterogeneous Comm. Network Custom switch Commercial LAN / WAN Comm. Latency A few to tens of (small messages) microseconds hundreds of microseconds to seconds

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

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

Outline • Hardware Platforms – Parallel computers – Distributed computers • Simulation Fundamentals – State – Time flow mechanisms

Simulation Fundamentals A computer simulation is a computer program that models the behavior of a physical system over time. • Program variables (state variables) represent the current state of the physical system • Simulation program modifies state variables to model the evolution of the physical system over time.

Time • • physical system: the actual or imagined system being modeled simulation: a system that emulates the behavior of a physical system main() {. . . double clock; . . . } physical system simulation • physical time: time in the physical system – Noon, December 31, 1999 to noon January 1, 2000 • simulation time: representation of physical time within the simulation – floating point values in interval [0. 0, 24. 0] • wallclock time: time during the execution of the simulation, usually output from a hardware clock – 9: 00 to 9: 15 AM on September 10, 1999

Simulation Time Simulation time is defined as a totally ordered set of values where each value represents an instant of time in the physical system being modeled. For any two values of simulation time T 1 representing instant P 1, and T 2 representing P 2: • Correct ordering of time instants – If T 1 < T 2, then P 1 occurs before P 2 – 9. 0 represents 9 PM, 10. 5 represents 10: 30 PM • Correct representation of time durations – T 2 - T 1 = k (P 2 - P 1) for some constant k – 1. 0 in simulation time represents 1 hour of physical time

Paced vs. Unpaced Execution Modes of execution • As-fast-as-possible execution (unpaced): no fixed relationship necessarily exists between advances in simulation time and advances in wallclock time • Real-time execution (paced): each advance in simulation time is paced to occur in synchrony with an equivalent advance in wallclock time • Scaled real-time execution (paced): each advance in simulation time is paced to occur in synchrony with S * an equivalent advance in wallclock time (e. g. , 2 x wallclock time) Simulation Time = W 2 S(W) = T 0 + S * (W - W 0) W = wallclock time; S = scale factor W 0 (T 0) = wallclock (simulation) time at start of simulation (assume simulation and wallclock time use same time units)

Simulation Taxonomy computer simulation discrete models event driven continuous models timestepped • Continuous time simulation – State changes occur continuously across time – Typically, behavior described by differential equations • Discrete time simulation – State changes only occur at discrete time instants – Time stepped: time advances by fixed time increments – Event stepped: time advances occur with irregular increments

Time Stepped vs. Event Stepped state variables Goal: compute state of system over simulation time stepped execution simulation time event driven execution

Time Stepped Execution (Paced) While (simulation not completed) { Wait Until (W 2 S(wallclock time) ≥ current simulation time) Compute state of simulation at end of this time step Advance simulation time to next time step }

Summary • Hardware Platforms – Tightly coupled multiprocessors: fast communication – Networked workstations: larger message latencies • Important to distinguish among simulation time, wallclock time, and time in the physical system • Paced execution (e. g. , immersive virtual environments) vs. unpaced execution (e. g. , simulations to analyze systems) • Continuous and discrete simulation use different execution paradigms, time advance mechanisms – Time stepped vs. event stepped – Here, focus on discrete event simulations
- Slides: 14