A Software Framework for Embedded Multi-Core Systems.ppt

2,162 views
2,007 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,162
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
74
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Consequences Thread creation and destruction overhead is negated Better performance and better system stability
  • Consequences Fork/Join parallelism is among the simplest and most effective design techniques for obtaining good parallel performance Fork/join algorithms are nearly always recursive, repeatedly splitting subtasks until they are small enough to solve using simple, short sequential methods
  • I don’t know whether the performance evaluation results are needed or not
  • Apparatus Framework based framework
  • A Software Framework for Embedded Multi-Core Systems.ppt

    1. 1. A Software Framework for Embedded Multi-Core Systems Taehyo Song Real-Time Operating Systems Laboratory, Seoul National University, Korea 2008-09-29
    2. 2. Outline <ul><li>Introduction </li></ul><ul><li>Problem Definition and Solution Overview </li></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><li>Experimental Evaluation (not yet done) </li></ul><ul><li>Conclusion </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    3. 3. Motivation (1) <ul><li>Multi-core systems are spreading to embedded area </li></ul><ul><ul><li>Hard to achieve higher clock rate because of the heat and power consumption problems </li></ul></ul><ul><ul><li>Power is very important factor in embedded systems </li></ul></ul><ul><li>Introduction </li></ul>Multi-core performance and power scenario <ul><li>Performance and power </li></ul><ul><ul><li>Standard single-core processor over-clocked 20% </li></ul></ul><ul><ul><li>Standard single-core processor </li></ul></ul><ul><ul><li>Dual-core processor each core under-clocked 20% </li></ul></ul>
    4. 4. Motivation (2) <ul><li>Developer need to be prepared </li></ul><ul><ul><li>Can’t take advantages from previous method </li></ul></ul><ul><ul><li>Use multi-threading technology to take advantages </li></ul></ul><ul><ul><ul><li>Steep learning curve to learn multi-threaded programming </li></ul></ul></ul><ul><ul><ul><li>Leading to deadlock and complex debugging scenarios </li></ul></ul></ul><ul><ul><ul><li>Lengthy development time </li></ul></ul></ul><ul><li>Introduction </li></ul>Gap between two classes of software developers
    5. 5. Outline <ul><li>Introduction </li></ul><ul><li>Problem Definition and Solution Overview </li></ul><ul><ul><li>Problems </li></ul></ul><ul><ul><li>Problem Definitions </li></ul></ul><ul><ul><li>Solution Overview </li></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><li>Experimental Evaluation </li></ul><ul><li>Conclusion </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    6. 6. Problems (1) <ul><li>Existing technologies such as OMP, MPI, TBB support to develop parallel software </li></ul><ul><ul><li>Cannot apply to embedded system since it has resource restrictions </li></ul></ul><ul><ul><li>Limitations of the automatic parallelization [1] </li></ul></ul><ul><li>Problem Definition and Solution Overview </li></ul>[1] Zhao-Hui Du, Chu-Cheow Lim, Xiao-Feng Li et al., “A Cost-Driven Compilation Framework for Speculative Parallelization of Sequential Programs, PLDI, 2004 Basic compilation Current best compilation Enabling optimization
    7. 7. Problems (2) <ul><li>Parallel design patterns can help developers </li></ul><ul><ul><li>Learning design patterns and particularly applying them is not an easy task [2] </li></ul></ul><ul><ul><li>Conversion from patterns to codes for implementation is not that straight forward and without proper guidance and coaching this process could create problems [3] </li></ul></ul><ul><li>Problem Definition and Solution Overview </li></ul>[1] Masita Abdul Jalil, Shahrul Azman Mohd Noah, “The Difficulties of Using Design Patterns among Novices: An Exploratory Study”, 2007 [2] Ó Cinnéide, M. & Tynan R., “A Problem-Based Approach to Teaching Design Patterns”, 2004.
    8. 8. Problem Definition <ul><li>How to develop embedded software that is running on multi-core system easily and effectively in terms of development time and performance respectively </li></ul><ul><li>Problem Definition and Solution Overview </li></ul>
    9. 9. Solution Overview <ul><li>Efficient use of design patterns by using framework </li></ul><ul><ul><li>Reconstruct existing parallel design patterns to suit for framework and add to the framework </li></ul></ul><ul><li>Problem Definition and Solution Overview </li></ul>
    10. 10. Outline <ul><li>Introduction </li></ul><ul><li>Problem Definition and Solution Overview </li></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><ul><li>Embedded System Framework </li></ul></ul><ul><ul><li>Overview of the Apparatus Framework </li></ul></ul><ul><ul><li>Analysis the Apparatus Framework </li></ul></ul><ul><ul><li>Proposed Framework </li></ul></ul><ul><li>Experimental Evaluation </li></ul><ul><li>Conclusion </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    11. 11. Proposal Framework <ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><ul><li>Modify modules of Apparatus Framework to suit for multi-core System </li></ul></ul><ul><ul><li>Improve existing parallel design patterns and reconstruct it to suit for framework, add to Apparatus Framework </li></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul>Hardware BSP eCos OSE RTOS Linux uC/OS Kernel Pattern Multi-Core Pattern RT_STL Application
    12. 12. Analysis of Apparatus Framework (1) <ul><li>Several features are applicable for multi-thread programming </li></ul><ul><ul><li>Inter-task Communication </li></ul></ul><ul><ul><ul><li>Communication between tasks is generally performed by asynchronous communication </li></ul></ul></ul><ul><ul><li>Messages </li></ul></ul><ul><ul><ul><li>A task reads messages and reacts according to the type and content of this message </li></ul></ul></ul><ul><ul><li>Resource Protection </li></ul></ul><ul><ul><ul><li>A set of mechanisms to serialize access to shared resources is provided: semaphores, mutexes, monitors and guards </li></ul></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul>
    13. 13. Analysis of Apparatus Framework (2) <ul><li>Apparatus Framework is not designed for multi-core systems </li></ul><ul><ul><li>Modules are not thread safe </li></ul></ul><ul><ul><ul><li>Queue, State Machine, Device Accessing, Communication etc. </li></ul></ul></ul><ul><ul><li>Pattern service does not provide patterns that are used for multi-core systems </li></ul></ul><ul><ul><ul><li>Task parallelization patterns </li></ul></ul></ul><ul><ul><ul><li>Data parallelization patterns </li></ul></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul>
    14. 14. Thread Safety Modules <ul><li>Com, Device, RT-STL and Pattern modules are unsafe under concurrent operations </li></ul><ul><ul><li>Attempting concurrent modifications could corrupt them </li></ul></ul><ul><li>Solution </li></ul><ul><ul><li>wrap a lock around container accesses </li></ul></ul><ul><ul><li>It does not cause any overhead when single thread is used since lock can be removed at development time using configuration tool </li></ul></ul><ul><li>Modules Modification of Apparatus Framework </li></ul>
    15. 15. Types of Parallelization <ul><li>Parallelization generally falls between two poles </li></ul><ul><ul><li>Task Parallelization </li></ul></ul><ul><ul><ul><li>Task parallelization refers to the alternative scenario where several nodes may execute different algorithms on the same data source, or alternatively on several data sources [4] </li></ul></ul></ul><ul><ul><li>Data Parallelization </li></ul></ul><ul><ul><ul><li>Data parallelization refers to a given data source being processed using the same technique on each node in the parallel architecture [5] </li></ul></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>[4] Akram Hameed, “Parallelization of the AAE algorithm”, 2007 [5] Wilkinson, B, Allen M , “Parallel programming: techniques and applications using networked workstations and parallel computers”, Prentice-Hall, 1998
    16. 16. Task Parallelization Patterns <ul><li>Task Parallel Model </li></ul><ul><ul><li>The program is split into a number of tasks </li></ul></ul><ul><ul><li>Each task is assigned to a specific core </li></ul></ul><ul><li>Patterns </li></ul><ul><ul><li>Thread Pool </li></ul></ul><ul><ul><li>Fork/Join Pattern </li></ul></ul><ul><ul><li>Pipeline Pattern </li></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    17. 17. Thread Pool Pattern (1) <ul><li>Thread Pool </li></ul><ul><ul><li>Allocate number of threads to thread pool </li></ul></ul><ul><ul><ul><li>A number of N threads are created to perform a number of M tasks ( N << M ) </li></ul></ul></ul><ul><ul><ul><li>A thread completes its task, it will request the next task from the queue until all tasks have been completed </li></ul></ul></ul><ul><ul><ul><li>The thread can then terminate, or sleep until there are new tasks available </li></ul></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    18. 18. <ul><li>Conceptual Diagram </li></ul>Thread Pool Pattern (2) <ul><li>Parallel Design Patterns to Framework </li></ul>Task 1 Task Task Task Task Task K Task M Task 5 Task Queue Thread Pool Completed Tasks Task Task Task Task Thread
    19. 19. Thread Pool Pattern (3) <ul><li>Hot Spot </li></ul><ul><ul><li>Tasks that will be assigned to thread </li></ul></ul><ul><ul><li>Scheduling policy of threads </li></ul></ul><ul><li>Class Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>…
    20. 20. Fork/Join Pattern (1) <ul><li>Fork/Join </li></ul><ul><ul><li>A main task forks off some number of other tasks that then continue in parallel to accomplish some portion of the overall work </li></ul></ul><ul><ul><ul><li>The fork operation starts a new parallel fork/join subtask </li></ul></ul></ul><ul><ul><ul><li>The join operation causes the current task not to proceed until the forked subtask has completed </li></ul></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    21. 21. Fork/Join Pattern (2) <ul><li>Conceptual Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>Task Thread Task Task 1 Task 2.1 Task 2.2 Task Thread 1 Thread 2 Fork Join
    22. 22. Fork/Join Pattern (3) <ul><li>Hot Spot </li></ul><ul><ul><li>Tasks that will be processed concurrently </li></ul></ul><ul><li>Class Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    23. 23. Pipeline Pattern (1) <ul><li>Pipeline </li></ul><ul><ul><li>Execute tasks or group of tasks in regular sequence when the execution order of tasks is regular, one-way and static </li></ul></ul><ul><ul><ul><li>Enables the decomposition of a repetitive sequential process into a succession of distinguishable sub-processes </li></ul></ul></ul><ul><ul><ul><li>Each of processes can be efficiently executed on a distinct processing element or elements which operate concurrently </li></ul></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    24. 24. Pipeline Pattern (2) <ul><li>Conceptual Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>Input Data Client Task Data
    25. 25. Pipeline Pattern (3) <ul><li>Hot Spot </li></ul><ul><ul><li>Set of tasks that will be processed serially or concurrently </li></ul></ul><ul><li>Class Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    26. 26. Data Parallelization Patterns <ul><li>Data Parallel Model </li></ul><ul><ul><li>Data is distributed over the cores </li></ul></ul><ul><ul><li>Each core works on a different part of the same data structure </li></ul></ul><ul><li>Patterns </li></ul><ul><ul><li>SPMD Pattern </li></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    27. 27. SPMD Pattern (1) <ul><li>Single Program, Multiple Data </li></ul><ul><ul><li>The same program is executed on different cores, over distinct data sets </li></ul></ul><ul><ul><li>Each task is characterized by the data over which the common code is executed </li></ul></ul><ul><li>Parallel Design Patterns to Framework </li></ul>
    28. 28. SPMD Pattern (2) <ul><li>Conceptual Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>Input Data Client Thread 1 Thread 2 Thread 3 Thread 4 Data Task Thread
    29. 29. SPMD Pattern (3) <ul><li>Hot Spot </li></ul><ul><ul><li>Task to be executed in separate threads </li></ul></ul><ul><ul><li>Load balancing policy </li></ul></ul><ul><li>Class Diagram </li></ul><ul><li>Parallel Design Patterns to Framework </li></ul>…
    30. 30. Outline <ul><li>Introduction </li></ul><ul><li>Problem Definition and Solution Overview </li></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><li>Experimental Evaluation </li></ul><ul><li>Conclusion </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    31. 31. Experimental Evaluation <ul><li>Remaining this part as a future work </li></ul><ul><li>Comparison results will be given </li></ul><ul><ul><li>Using framework and NOT using framework </li></ul></ul><ul><ul><ul><li>Throughput time when developing application that has same functionalities </li></ul></ul></ul><ul><ul><ul><li>Comparing with LOC (Lines-Of-Code) </li></ul></ul></ul><ul><li>Case-study is needed for evaluation </li></ul><ul><li>Experimental Evaluation </li></ul>
    32. 32. Outline <ul><li>Introduction </li></ul><ul><li>Problem Definition and Solution Overview </li></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul><ul><li>Experimental Evaluation </li></ul><ul><li>Conclusion </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    33. 33. Conclusion <ul><li>New software framework for embedded multi-core systems </li></ul><ul><li>Framework provides parallel features for multi-core systems </li></ul><ul><li>Experimental evaluation will be given </li></ul><ul><ul><li>Show that using new software framework gives good results </li></ul></ul><ul><li>Conclusion </li></ul>
    34. 34. References <ul><li>Ralph E. Johnson, “Frameworks=(Components+Patterns)”, 1997 </li></ul><ul><li>Bruce Powel Douglass, “Real-Time Design Patterns: Robust Scalable Architecture for Real-Time Systems”, 2002 </li></ul><ul><li>Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill, “Patterns for Parallel Programming”, 2004 </li></ul><ul><li>Max Domeika, “Software Development for Embedded Multi-Core Systems”, 2008 </li></ul><ul><li>A.Pastino, C.C.Ribeiro, N.Rodriguez, “Developing SPMD Applications with Load Balancing”, 2003 </li></ul><ul><li>Michael A. Bender, Jeremy T. Fineman, Seth Gilbert et al., “On-the-Fly Maintenance of Series-Parallel Relationships in Fork-Join Multithreaded Programs”, 2004 </li></ul><ul><li>A Software Framework for Embedded Multi-Core Systems </li></ul>
    35. 36. Motivation (3) <ul><li>Challenges in Software Development </li></ul><ul><ul><li>Software developers should use multi-threading technology to take advantages of multi-core processor </li></ul></ul><ul><ul><li>Multi-threaded programming is difficult </li></ul></ul><ul><ul><ul><li>Steep learning curve to learn multi-threaded programming </li></ul></ul></ul><ul><ul><ul><li>Leading to deadlock and complex debugging scenarios </li></ul></ul></ul><ul><ul><ul><li>Lengthy development time </li></ul></ul></ul><ul><li>Introduction </li></ul>
    36. 37. Related Works <ul><li>Timothy G. Mattson, Beverly A. Sanders, Berna L. Massingill, “Patterns for Parallel Programming”, Addison-Wesley, 2004 </li></ul><ul><li>Ozalp Babaoglu, Geoffrey Canright, Andreas Deutsch et al., “Design Patterns from Biology for Distributed Computing”, ACM Transactions on Autonomous and Adaptive Systems, 2006 </li></ul><ul><li>David A. Bader, Varun Kanade and Kamesh Madduri, ” SWARM: A Parallel Programming Framework for Multicore Processors”, Parallel and Distributed Processing Symposium, 2007 </li></ul><ul><li>Introduction </li></ul>
    37. 38. Embedded System Frameworks <ul><li>Embedded system frameworks are designed to support embedded systems with limited resources </li></ul><ul><ul><li>Apparatus Framework </li></ul></ul><ul><ul><li>Android Framework </li></ul></ul><ul><ul><li>.NET Micro Framework </li></ul></ul><ul><ul><li>Etc. </li></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul>Apparatus Framework Android Framework .NET Micro Framework Hardware BSP Kernel Pattern RT_STL Application eCos OSE RTOS Linux uC/OS
    38. 39. Overview of the Apparatus Framework <ul><li>Introduction </li></ul><ul><ul><li>An object-oriented software framework written in C++ for embedded applications </li></ul></ul><ul><ul><li>Provides RT-OS abstraction, simulation facilities, device and communication concepts, design pattern and more </li></ul></ul><ul><li>Benefits </li></ul><ul><ul><li>Leverages the starting point for embedded software development and shortens development time </li></ul></ul><ul><ul><li>Projects get a proofed platform to build on it and the development team can soon focus on the real application features </li></ul></ul><ul><li>Framework for Embedded Multi-Core Systems </li></ul>

    ×