Presentation is loading. Please wait.

Presentation is loading. Please wait.

Component-Based Programming with Streams Philip Garcia University of Wisconsin - Madison Johannes Helander Microsoft Research.

Similar presentations


Presentation on theme: "Component-Based Programming with Streams Philip Garcia University of Wisconsin - Madison Johannes Helander Microsoft Research."— Presentation transcript:

1 Component-Based Programming with Streams Philip Garcia University of Wisconsin - Madison Johannes Helander Microsoft Research

2 Component Based Programming Program viewed as a collection of autonomous components Each component performs a single task Components can be combined in various ways to execute different applications Each component can execute simultaneously *

3 Component-based design Overall system design described in XML – Describe individual components – Describe Components interconnection – Describe application as interconnection of components Components – Written in “traditional” languages (C/C++) – Interface with buffer streams – Stream elements accessed using buffer “windows” – System automatically handles concurrency when window is advanced, or changes in size

4 Example Windows

5 Data Windows Virtualize accesses into data buffers that exist between components Dynamically handles concurrency between components Allows array-like access into shared buffers – However, accesses must occur within the defined window – Window can expand, shrink, or advance – Windows can not move backward

6 Example Component

7 Test Benchmark JPEG Encoding Components needed to convert a bitmap into a JPEG

8 Application’s XML Description Source 0 Conv 1 contd….

9 Description continued Conv 0 DCT 1 DCT 0 Quant 1 VQuant 0 Wdrain 0 SestupJPEG

10 JPEG Profile Obtained profiling data in Linux using gprof – Baseline ran under windows using MS VS compiler – Windows execution time (256MB input): 7.33s – Linux execution time (256MB input): 4.05s RoutineExecution Percentage Color Conversion30% Huffman Encoding26% Quantization26% Forward DCT13%

11 “Speedup” over baseline

12 Poor Scaling MMLite Development environment was not designed for windows – Embedded systems development – Windows support was an afterthought added for debugging – Heavy-weight communication primitives Compiler Optimizations ? – Need to obtain a good windows profiling tool – Find performance bottlenecks

13 Multiprocessor Scaling

14 Thoughts on Application Porting Using pre-built buffer streams greatly simplified development Resulting code was much simpler than the original baseline Additional options can be added by swapping out components (rather than setting flags)

15 Questions

16 Specifying Components Each component implements a standard interface. – Initialization – Execution XML file describes system – Lists all components used – Describes communication between components – Specifies Initialization routine *

17 Example Source 0 Encode 0 2 Encode 1 Drain 0 SetupEP

18 How do we define components? Each component written in traditional language – Allows reuse of existing routines and algorithms – Programmers are familiar with environment – Currently only support components written in C – Plan to add support for Hardware-based components

19 System Execution System compiles XML description into C – Initializes each component – Initializes buffer streams/windows – Can run each component as separate thread – Statically or dynamically schedules threads Eventual goal is to allow components to be software or hardware


Download ppt "Component-Based Programming with Streams Philip Garcia University of Wisconsin - Madison Johannes Helander Microsoft Research."

Similar presentations


Ads by Google