A Software Framework for Embedded Multi-Core Systems.ppt

  • 1,750 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,750
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
69
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    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

Transcript

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