520 likes | 687 Views
Parallel Algorithms & Distributed Computing. Matt Stimmel Matt White. The Goal: 1 Gigapixel. How?. How?. Imhotep , How are we going to make all these bricks?. The Plan. We’ll use the Hebrew Slaves!. The Plan. +. =. Benford 6100 Brick Mold. Hebrew Slave. Brick. The Process.
E N D
Parallel Algorithms & Distributed Computing Matt Stimmel Matt White
Imhotep, How are we going to make all these bricks? The Plan
We’ll use the Hebrew Slaves! The Plan
+ = Benford 6100 Brick Mold Hebrew Slave Brick The Process
Yeah, this is pretty slow. Re-evaluation
We’ll use MORE Hebrew Slaves! Re-evaluation
+ = + = + = + = + = + = The Revised Process Enough bricks for a pyramid! Lots of Benford 6100 Brick Molds Lots of Hebrew Slaves
Job Process In computers Result
Job Sub-task Sub-result Sub-task Sub-result Process Process Process Process Sub-task Sub-result Sub-task Sub-result Faster! Result
Job Sub-task Sub-result Sub-task Sub-result Process Process Process Process Sub-task Sub-result Sub-task Sub-result What happens here? Result
Job Sub-task Sub-result Sub-task Sub-result Combine Process Process Process Process Split Sub-task Sub-result Sub-task Sub-result Ah Ha! Result
Job Sub-task Sub-result Sub-task Sub-result Combine Process Process Process Process Split Sub-task Sub-result Sub-task Sub-result Sequential! Result
Job Sub-task Sub-result Sub-task Sub-result Process Sub-result Sub-task Process Combine Split Process Sub-task Sub-result Process Sequential Parallel Sequential So, Really, we have… Result
1 Parallel (1 – Parallel) + Sequential Speedup = Amdahl's Law
Or, as a 5th grader would say, “How many times faster it goes” 1 Parallel (1 – Parallel) + Sequential Speedup = Amdahl's Law
Amdahl's Law http://en.wikipedia.org/wiki/File:AmdahlsLaw.svg
= = - Process Process Process Process = = Why Distributed Computing?
Well the surrounding countries have slaves they’re not using… The Plan
+ = Slaves from Egypt Egypt’s Benford 6100 Brick Molds + = + = Slaves from Mars Space Brickmakers + = Slaves from ChickenLand Avian Brickmakers + = The Revised Process: Cheap Enough bricks for a pyramid! Robot Slaves Brick Factory
Job Internet Internet Sub-task Sub-result Internet Internet Sub-task Sub-result Combine Process Process Process Process Split Internet Internet Sub-task Sub-result Internet Internet Sub-task Sub-result Distributed Computing Result
Internet Not My = Internet = - Process Process Process Process Internet = Internet = Why Distributed Computing?
Server Client Control Data FractalGen ImageCombiner Storage The Big Picture
Functions: • Manages Connections to Clients • Allows the user to input task parameters. • Divides job into sub-tasks • Displays information about currently running job Server • Challenges: • Job division • Must divide into a perfect square number of Jobs • Resolution • Problems occur when the resolution isn’t an integer multiple of the number of jobs. • Networking • Treated client connections as a Finite State Machine for file transfers. Didn’t work. • About 1 in 100 transfers failed. Server
Functions: • Manages Connection to server • Receives server-generated command line for job • Executes FractalGen on cue • Informs server upon completion Client • Challenges: • Maintaining a graceful disconnect • Aforementioned file transfer Client
Functions: • Render the fractal • Specified by the command line • Save the fractal to the disk • Challenges: • How do you draw a Mandelbrot fractal anyway? • Z = Z2 + C • Command Line Parsing • Generating large images: • Limit is approx. 8000x8000 due to graphics hardware • Shader Implementation • Downloaded, then made attempts at optimization. • Iteration count • Shader Model 3 gives a greater instruction cound allowing form more iterations. • Shader Model 2 has greater compatibility, but cannot render as many iterations. • Client computer must have a GPU capable of running at least DirectX 9 or else FractalGen will not work. FractalGen FractalGen
Functions: • Merge images back together • Challenges: • Finding .bmp files • Memory Allocation • Estimates demanded efficient heap usage • A lot of pointers, a lot of pointer math • Working with Bitmaps • Multiple color modes – how many bits is a pixel? • “Upside Down” errors • Running over a network ImageCombiner Image Combiner
Overview of Technologies Used Server • C# • .NET • Multithreaded • C# • .NET • Multithreaded Client • C# • .NET • XNA • HLSL • Shader Model 3.0 FractalGen • C++ • OOP • Memory Allocation ImageCombiner
Client 1 Client 2 Client 3 Client 4 We now send a square to each client
Server Client Control Data FractalGen ImageCombiner Storage The Big Picture
Hypothesis: Using a parallel implementation and multiple processors, we will be able to increase performance over the same implementation on a single processor. Science, Step 1
Experiment: Run the system, splitting job into varying numbers of sub-tasks and varying the number of processors available. Science, Step 2
Control: Run the system using one client. Science, Step 3
Major Dramatic Question: Is ≥ 1? Sequential Parallel Playwrighting, Step 1