Fine-Grain Parallelism
Total Page:16
File Type:pdf, Size:1020Kb
Fine-Grain Parallelism An Investigative Study into the merits of Graphical Programming and a Fine - grain Execution Model A Major Qualifying Project Report Submitted to the Faculty of WORCESTER POLYTECHNIC INSTITUTE In partial fulfillment of the requirements for the Degree of Bachelor of Science By Erik Archambault John Hogeboom Joshua Montgomery Christopher Pardy Christopher Smith Brian Tate Advised By: Professor Craig E. Wills Professor Hugh C. Lauer March 2010 MQP-CEW-1002 Abstract Computer hardware is at the beginning of the multi-core revolution. While hardware at the commodity level is capable of running concurrent software, most software does not take advantage of this fact because parallel software development is difficult. This project addressed potential remedies to these difficulties by investigating graphical programming and fine-grain parallelism. A prototype system taking advantage of both of these concepts was implemented and evaluated in terms of real-world applications. i | P a g e Contents Abstract .......................................................................................................................................................... i Executive Summary ....................................................................................................................................... 1 1 Introduction .......................................................................................................................................... 2 2 Background ........................................................................................................................................... 4 2.1 Parallelism ..................................................................................................................................... 4 2.1.1 Examples of Parallel Computations ...................................................................................... 4 2.1.2 History of Parallel Abstractions ............................................................................................. 5 2.1.3 Problems with Parallelism ..................................................................................................... 6 2.1.4 Performance Increases due to Parallelism............................................................................ 8 2.2 Dataflow Language Overview ....................................................................................................... 9 2.2.1 Binary Modular Dataflow Machine ....................................................................................... 9 2.2.2 Pro-graph .............................................................................................................................. 9 2.2.3 Oz ........................................................................................................................................ 10 2.2.4 Simulink ............................................................................................................................... 10 2.2.5 SISAL .................................................................................................................................... 10 2.2.6 VHDL .................................................................................................................................... 10 2.2.7 PureData ............................................................................................................................. 10 2.2.8 OpenWire ............................................................................................................................ 10 2.2.9 Max ..................................................................................................................................... 11 2.2.10 Cantata ................................................................................................................................ 11 2.2.11 jMax..................................................................................................................................... 11 2.2.12 Lucid .................................................................................................................................... 11 2.3 Dataflow Languages in Depth ..................................................................................................... 11 2.3.1 LabVIEW .............................................................................................................................. 11 2.3.2 Mozart ................................................................................................................................. 12 2.3.3 SISAL .................................................................................................................................... 14 2.4 Related Work .............................................................................................................................. 17 2.5 Summary ..................................................................................................................................... 17 3 Design .................................................................................................................................................. 18 3.1 Architectural Vision ..................................................................................................................... 18 3.2 Fine-grain Parallelism .................................................................................................................. 19 ii | P a g e 3.3 Representation of Fine-grained Parallelism ................................................................................ 20 3.4 Summary ..................................................................................................................................... 24 4 Graphical Front-End ............................................................................................................................ 25 4.1 Introduction ................................................................................................................................ 25 4.1.1 Graphical Programming’s Appeal ....................................................................................... 25 4.1.2 Dia ....................................................................................................................................... 25 4.2 Design .......................................................................................................................................... 25 4.2.1 Shape Design ....................................................................................................................... 25 4.2.2 Loops ................................................................................................................................... 26 4.2.3 Designing Functions ............................................................................................................ 26 4.3 Implementation .......................................................................................................................... 27 4.3.1 Initial Implementation ........................................................................................................ 27 4.3.2 Revisions ............................................................................................................................. 29 4.3.3 Implementing Loops ........................................................................................................... 30 4.3.4 Implementing Constants ..................................................................................................... 31 4.4 Known Design and Implementation Concerns............................................................................ 31 4.5 Evaluation ................................................................................................................................... 32 4.5.1 Installation .......................................................................................................................... 32 4.5.2 Using the Interface .............................................................................................................. 32 4.6 Summary ..................................................................................................................................... 36 5 Runtime Implementation .................................................................................................................... 37 5.1.1 Threading ............................................................................................................................ 37 5.1.2 Memory ............................................................................................................................... 38 5.1.3 Summary of Solution ........................................................................................................... 40 5.1.4 Code Example ...................................................................................................................... 41 5.2 Summary ..................................................................................................................................... 42 6 Code Generation ................................................................................................................................. 43 6.1 Parsing Phase .............................................................................................................................. 43 6.1.1 IF1 Background...................................................................................................................