Parallel Algorithms & Distributed Computing

# Parallel Algorithms & Distributed Computing

## Parallel Algorithms & Distributed Computing

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Parallel Algorithms & Distributed Computing Matt Stimmel Matt White

2. The Goal: 1 Gigapixel

3. How?

4. How?

5. We’ll use the Hebrew Slaves! The Plan

6. + = Benford 6100 Brick Mold Hebrew Slave Brick The Process

7. Yeah, this is pretty slow. Re-evaluation

8. We’ll use MORE Hebrew Slaves! Re-evaluation

9. + = + = + = + = + = + = The Revised Process Enough bricks for a pyramid! Lots of Benford 6100 Brick Molds Lots of Hebrew Slaves

10. Thus Parallel Algorithms were born

11. Job Process In computers Result

16. 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

17. 1 Parallel (1 – Parallel) + Sequential Speedup = Amdahl's Law

18. Or, as a 5th grader would say, “How many times faster it goes” 1 Parallel (1 – Parallel) + Sequential Speedup = Amdahl's Law

19. Amdahl's Law http://en.wikipedia.org/wiki/File:AmdahlsLaw.svg

20. = = - Process Process Process Process = = Why Distributed Computing?

21. Well the surrounding countries have slaves they’re not using… The Plan

22. + = 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

23. 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

24. Internet Not My = Internet = - Process Process Process Process Internet = Internet = Why Distributed Computing?

25. Design

26. Server Client Control Data FractalGen ImageCombiner Storage The Big Picture

27. 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

28. 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

29. 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

30. 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

31. 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

32. How is the task divided into separate jobs?

33. Breaking up Jobs: Method A

34. Breaking up Jobs: Method B

35. Overlays

36. Method A: Since B didn’t work

37. Client 1 Client 2 Client 3 Client 4 We now send a square to each client

38. The clients return separate images of the fractal.

39. Run the image combiner.

40. Final Output

41. Server Client Control Data FractalGen ImageCombiner Storage The Big Picture

42. Science

43. 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

44. Experiment: Run the system, splitting job into varying numbers of sub-tasks and varying the number of processors available. Science, Step 2

45. Control: Run the system using one client. Science, Step 3

46. Major Dramatic Question: Is ≥ 1? Sequential Parallel Playwrighting, Step 1

47. Data

48. Data