DOC PREVIEW
Berkeley COMPSCI C267 - Lecture 8: Sources of Parallelism and Locality in Simulation

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

9/24/2001CS267, Yelick 19/24/2001 CS267, Yelick 1CS 267: Applications of Parallel ComputersLecture 8:Sources of Parallelism and Locality in SimulationKathy Yelickhttp://www-inst.eecs.berkeley.edu/~cs2679/24/2001 CS267, Yelick 2Parallelism and Locality in Simulation• Real world problems have parallelism and locality:• Many objects operate independently of others.• Objects often depend much more on nearby than distant objects.• Dependence on distant objects can often be simplified.• Scientific models may introduce more parallelism:• When a continuous problem is discretized, temporal domain dependencies are generally limited to adjacent time steps.• Far-field effects may be ignored or approximated in many cases.• Many problems exhibit parallelism at multiple levels• Example: circuits can be simulated at many levels, and within each there may be parallelism within and between subcircuits.9/24/2001 CS267, Yelick 3Example: Circuit Simulation • Circuits are simulated at many different levelsExamplesPrimitivesLevelElectrons, siliconDevice levelSpiceResistors, capacitors, etc.Circuit levelCosmosIdeal transistorSwitch levelThorGate, flip-flop, memory cellGate LevelVHDLRegister, counter, MUXRegister Transfer Level (RTL)VIRAM-pFunctional unitsCycle levelSimOS, SPIMInstructionsInstruction level9/24/2001 CS267, Yelick 4Basic Kinds of Simulation• Discrete event systems:• Examples: “Game of Life,” logic level circuit simulation. • Particle systems:• Examples: billiard balls, semiconductor device simulation, galaxies.• Lumped variables depending on continuous parameters:• ODEs, e.g., circuit simulation (Spice), structural mechanics, chemical kinetics.• Continuous variables depending on continuous parameters:• PDEs, e.g., heat, elasticity, electrostatics.• A given phenomenon can be modeled at multiple levels.• Many simulations combine more than one of these techniques.9/24/2001 CS267, Yelick 5Outline• Discrete event systems• Time and space are discrete• Particle systems• Important special case of lumped systems• Ordinary Differential Equations (ODEs)• Lumped systems• Location/entities are discrete, time is continuous• Partial Different Equations (PDEs)• Time and space are continuous• Next lecturediscretecontinuous9/24/2001 CS267, Yelick 6Discrete Event Systems9/24/2001CS267, Yelick 29/24/2001 CS267, Yelick 7Discrete Event Systems• Systems are represented as:• finite set of variables.• the set of all variable values at a given time is called the state.• each variable is updated by computing a transition functiondepending on the other variables.• System may be:• synchronous: at each discrete timestep evaluate all transition functions; also called a finite state machine.• asynchronous: transition functions are evaluated only if the inputs change, based on an “event” from another part of the system; also called event driven simulation.• Example: The “game of life:”• Also known as Sharks and Fish #3: http://www.cs.berkeley.edu/~demmel/cs267/Sharks_and_Fish/• Space divided into cells, rules govern cell contents at each step9/24/2001 CS267, Yelick 8Parallelism in Sharks and Fish (Recap)• The simulation is synchronous• use two copies of the grid (old and new).• the value of each new grid cell depends only on 9 cells (itself plus 8 neighbors) in old grid.• simulation proceeds in timesteps-- each cell is updated at every step.• Easy to parallelize by dividing physical domain• Locality is achieved by using large patches of the ocean• Only boundary values from neighboring patches are needed.P4P1 P2 P3P5 P6P7 P8 P9Repeatcompute locally to update local systembarrier()exchange state info with neighborsuntil done simulating9/24/2001 CS267, Yelick 9Synchronous Circuit Simulation• Circuit is a graph made up of subcircuits connected by wires• Component simulations need to interact if they share a wire.• Data structure is irregular (graph) of subcircuits.• Parallel algorithm is timing-driven or synchronous:• Evaluate all components at every timestep (determined by known circuit delay)• Graph partitioning assigns subgraphs to processors (NP-complete)• Determines parallelism and locality.• Attempts to evenly distribute subgraphs to nodes (load balance).• Attempts to minimize edge crossing (minimize communication).edge crossings = 6edge crossings = 109/24/2001 CS267, Yelick 10Asynchronous Simulation• Synchronous simulations may waste time:• Simulate even when the inputs do not change,.• Asynchronous simulations update only when an event arrives from another component:• No global time steps, but individual events contain time stamp.• Example: Game of life in loosely connected ponds (don’t simulate empty ponds).• Example: Circuit simulation with delays (events are gates changing).• Example: Traffic simulation (events are cars changing lanes, etc.).• Asynchronous is more efficient, but harder to parallelize• In MPI, events are naturally implemented as messages, but how do you know when to execute a “receive”?9/24/2001 CS267, Yelick 11Scheduling Asynchronous Circuit Simulation• Conservative:• Only simulate up to (and including) the minimum time stamp of inputs.• May need deadlock detection if there are cycles in graph, or else “null messages”.• Example: Pthor circuit simulator in Splash1 from Stanford.• Speculative (or Optimistic):• Assume no new inputs will arrive and keep simulating.• May need to backup if assumption wrong.• Example: Timewarp [D. Jefferson], Parswec [Wen,Yelick].• Optimizing load balance and locality is difficult:• Locality means putting tightly coupled subcircuit on one processor.• Since “active” part of circuit likely to be in a tightly coupledsubcircuit, this may be bad for load balance.9/24/2001 CS267, Yelick 12Summary of Discrete Even Simulations• Model of the world is discrete• Both time and space• Approach• Decompose domain, i.e., set of objects• Run each component ahead using• Synchronous: communicate at end of each timestep• Asynchronous: communicate on-demand– Conservative scheduling – wait for inputs– Speculative scheduling – assume no inputs, roll back if necessary9/24/2001CS267, Yelick 39/24/2001 CS267, Yelick 13Particle Systems9/24/2001 CS267, Yelick 14Particle Systems• A particle system has • a finite number of particles.• moving in space according to Newton’s Laws (i.e. F = ma).•


View Full Document

Berkeley COMPSCI C267 - Lecture 8: Sources of Parallelism and Locality in Simulation

Documents in this Course
Lecture 4

Lecture 4

52 pages

Split-C

Split-C

5 pages

Lecture 5

Lecture 5

40 pages

Load more
Download Lecture 8: Sources of Parallelism and Locality in Simulation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture 8: Sources of Parallelism and Locality in Simulation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture 8: Sources of Parallelism and Locality in Simulation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?