80 likes | 149 Views
Application Paradigms: Parallel Discrete Event Simulations CS433 Spring 2001. Laxmikant Kale. Physical Simulations: continued. Physical simulations: Structured or unstructured grids, possibly with adaptive refinements Equations/Solvers Particles. Solvers for Linear Equations.
E N D
Application Paradigms: Parallel Discrete Event SimulationsCS433Spring 2001 Laxmikant Kale
Physical Simulations: continued • Physical simulations: • Structured or unstructured grids, possibly with adaptive refinements • Equations/Solvers • Particles
Solvers for Linear Equations • In many situations in physical simulations, you need to solve systems of linear equations • Arise naturally in discretizations of partial differential equations • Implicit time steps • Variables: • Are associated with points or regions in space • Typically, sparse systems: • because each equations connects “nearby” variables • Traditionally represented by Matrices • But, for sparse systems “physical” representations are better • Opinion: The “sparse matrix” data structure as an intermediate abstraction is unnecessary and a hindrance in some cases for effective parallelization
Solvers • Direct: • parallel operations: broadcasting the pivot row • Iterative: • Communication needed between variables connected by an equation • Again, physical proximity: near-neighbor communication • Reductions for convergence • Complex iterative schemes: • Preconditioners • Multigrid solvers
Particles • Examples: • atoms (molecular dynamics), stars (astrophysics), • Aluminum particles in burning gasses (Rocket) • Vortices (Fluid flow) • Typical decompositions: • Rectangular Cells • Quad/Oct trees, ORB cells • Interactions: • Particle-particle interactions • Within a cutoff distance • All to all (N-squared) • Special algorithms: Barnes-Hut, Multipole: O(N log N) • Harder to parallelize • Particle-mesh interactions: • PPPM
Discrete event simulation • Physical simulations: • What we studied earlier: every part of the system advances uniformly in time, in synch • Not appropriate in many systems: • Events happen asynchronously, and components respond • Digital Circuits: Only need to attend to places where the signal changes, • The rest stay the same • Traffic in a city
Discrete Event Simulation • Event Queue based simulation • Single event queue • Each event with a time-stamp • Queue prioritized by timestamps • Scheduler loop: • Select the event with earliest timestamp • process it (access objects, post new events) • Causality ensured
PDES:Parallel Discrete Event Simulation • How to parallelize: • Queue is a sequential bottleneck (and not just the access time) • (1) process all events with the same timestamp • But there may not be enough • Process all that can be processed safely • Process events in approximate timestamp order • If some “object” notices it has processed events in non-causal order • Roll back