Distributed Object Computing Laboratory Washington University St. Louis, MO Rate-Monotonic Analysis in the C++ Type System Morgan Deters Model-Driven Embedded.

Slides:



Advertisements
Similar presentations
Multi-core Computing Lecture 3 MADALGO Summer School 2012 Algorithms for Modern Parallel and Distributed Models Phillip B. Gibbons Intel Labs Pittsburgh.
Advertisements

PRESENTED BY MATTHEW GRAF AND LEE MIROWITZ Linked Lists.
Containers CMPS Reusable containers Simple data structures in almost all nontrivial programs Examples: vectors, linked lists, stacks, queues, binary.
§3 Dynamic Programming Use a table instead of recursion 1. Fibonacci Numbers: F(N) = F(N – 1) + F(N – 2) int Fib( int N ) { if ( N
Templates in C++. Generic Programming Programming/developing algorithms with the abstraction of types The uses of the abstract type define the necessary.
C++ Programming Languages
INF 212 ANALYSIS OF PROG. LANGS Type Systems Instructors: Crista Lopes Copyright © Instructors.
Praveen Yedlapalli Emre Kultursay Mahmut Kandemir The Pennsylvania State University.
Task Allocation and Scheduling n Problem: How to assign tasks to processors and to schedule them in such a way that deadlines are met n Our initial focus:
Reseach in DistriNet (department of computer science, K.U.Leuven) General overview and focus on embedded systems task-force.
Automated Analysis and Code Generation for Domain-Specific Models George Edwards Center for Systems and Software Engineering University of Southern California.
Introduction to Java Kiyeol Ryu Java Programming Language.
Scheduling for Embedded Real-Time Systems Amit Mahajan and Haibo.
Encapsulation by Subprograms and Type Definitions
An Agent-Oriented Approach to the Integration of Information Sources Michael Christoffel Institute for Program Structures and Data Organization, University.
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
CSE 332: C++ Algorithms II From Last Time: Search with Generic Iterators Third generalization: separate iterator type parameter We arrive at the find algorithm.
E81 CSE 532S: Advanced Multi-Paradigm Software Development Chris Gill Department of Computer Science Washington University, St. Louis
German National Research Center for Information Technology Research Institute for Computer Architecture and Software Technology German National Research.
STL Standard Template Library ● Good reference book: – The C++ Standard Library ● A Tutorial and Reference ● by Nicolai M. Josuttis ● 1999 – Addison Wesley.
Sumant Tambe, et. al LEESA DSPD 2008 An Embedded Declarative Language for Hierarchical Object Structure Traversal Sumant Tambe* Aniruddha Gokhale Vanderbilt.
Stacks & Recursion. Stack pushpop LIFO list - only top element is visible top.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
Christopher Gill and Nanbor Wang Department of Computer Science and Engineering Washington University, St. Louis Monday May.
October 8, 2015 Research Sponsored by NASA Applying Reflective Middleware Techniques to Optimize a QoS-enabled CORBA Component Model Implementation Nanbor.
Composing Adaptive Software Authors Philip K. McKinley, Seyed Masoud Sadjadi, Eric P. Kasten, Betty H.C. Cheng Presented by Ana Rodriguez June 21, 2006.
Compiler Support for Profiling C++ Template Metaprograms József Mihalicza, Norbert Pataki, Zoltán Porkoláb Eötvös Loránd University Faculty of Informatics.
C++ Template Metaprogramming Why, When and How? Zoltán Porkoláb Dept. of Programming Languages and Compilers, Faculty of Informatics Eötvös.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAM DESIGN WITH C++ Templates.
Programming Language Support for Generic Libraries Jeremy Siek and Walid Taha Abstract The generic programming methodology is revolutionizing the way we.
Copyright 2005 Eric Niebler xpressive: Library Design on the Edge or, How I Learned to Stop Worrying and Love Template Meta- Programming.
GPCE'04, Vancouver 1 Towards a General Template Introspection Library in C++ István Zólyomi, Zoltán Porkoláb Department of Programming Languages and Compilers.
Meta IFL 2007 Freiburg1 Meta - Towards a Functional-Style Interface for C++ Template Metaprograms * Ádám Sipos, Zoltán Porkoláb, Norbert Pataki, Viktória.
C# 2.0 and Future Directions Anders Hejlsberg Technical Fellow Microsoft Corporation.
Handling Mixed-Criticality in SoC- based Real-Time Embedded Systems Rodolfo Pellizzoni, Patrick Meredith, Min-Young Nam, Mu Sun, Marco Caccamo, Lui Sha.
Implementing Subprograms What actions must take place when subprograms are called and when they terminate? –calling a subprogram has several associated.
Lecture 3 Classes, Structs, Enums Passing by reference and value Arrays.
Slide 1 Linked Data Structures. Slide 2 Learning Objectives  Nodes and Linked Lists  Creating, searching  Linked List Applications  Stacks, queues.
Standard Template Library The Standard Template Library was recently added to standard C++. –The STL contains generic template classes. –The STL permits.
CSE 332: C++ template examples Concepts and Models Templates impose requirements on type parameters –Types that are plugged in must meet those requirements.
Laboratory of Model Driven Engineering for Embedded Systems An Execution Framework for MARTE-based Models UML&AADL’2008 workshop Belfast, Northern Ireland.
Overview of C++ Templates
MDD approach for the Design of Context-Aware Applications.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAM DESIGN WITH C++ Templates.
CrossCheckSimulation Results Conclusions References Model Instrumentation Modeling with CUTS Property Specification SPRUCE Challenge Problem Checking Model.
GYTE - Bilgisayar Mühendisliği Bölümü Bilgisayar Mühendisliği Bölümü GYTE - Bilgisayar Mühendisliği Bölümü AN ARCHITECTURE FOR NEXT GENERATION MIDDLEWARE.
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
High-level Interfaces for Scalable Data Mining Ruoming Jin Gagan Agrawal Department of Computer and Information Sciences Ohio State University.
CSE 332: C++ template examples Today: Using Class and Function Templates Two examples –Function template for printing different types –Class template for.
M.Sc. Seminar - Keren Lenz Supervisor - Dr. Yossi Gil July 1 st 2007 Simple and Safe SQL Queries with C++ Templates A RA R AT -
A Generative Programming Approach for Adaptive Middleware Venkita Subramonian & Chris Gill Distributed Object Computing Group Washington University, St.
Collection and storage of provenance data Jakub Wach Master of Science Thesis Faculty of Electrical Engineering, Automatics, Computer Science and Electronics.
Michael J. Voss and Rudolf Eigenmann PPoPP, ‘01 (Presented by Kanad Sinha)
CSE 332: C++ templates and generic programming II Review: Concepts and Models Templates impose requirements on type parameters –Types that are plugged.
Template Metaprogramming in C++ Giuseppe Attardi and Haoyuan Li Dipartimento di Informatica Università di Pisa.
DGrid: A Library of Large-Scale Distributed Spatial Data Structures Pieter Hooimeijer,
The Structuring of Systems Using Upcalls By David D. Clark Presented by Samuel Moffatt.
5th MaCS Debrecen On the Turing-Completeness of Generative Metaprograms Zoltán Porkoláb, István Zólyomi Dept. of Programming.
1 Data Structures CSCI 132, Spring 2016 Notes_ 5 Stacks.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Abstract Data Types Queues Dale Roberts, Lecturer
Introduction to Generic Programming in C++
Cpt S 122 – Data Structures Abstract Data Types
Computer Science 4 Mr. Gerb
Data Structures and Algorithms
when it needs to be done at compile-time
An Evolution of QoS Context Propagation in
Data Structures and Algorithms
Chapter 7 –Implementation Issues
Abstract Data Types Stacks CSCI 240
Presentation transcript:

Distributed Object Computing Laboratory Washington University St. Louis, MO Rate-Monotonic Analysis in the C++ Type System Morgan Deters Model-Driven Embedded Systems 27 May 2003 Research funded by DARPA under contract F C-1697 Christopher Gill Ron Cytron

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 1 27 May 2003 Overview Context C++ template metaprograms Rate-Monotonic Analysis (RMA) RMA with Templates Extensions to the Core Approach Future Directions Concluding Remarks

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 2 27 May 2003 A Brief History Structured Programming Objects Middleware Components Modeling Separation of concerns Reflection/MOP Generative (configurational) Domain-Specific Languages (DSLs) GO TO

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 3 27 May 2003 C++ Templates template class list_node { T data; list_node * next; public: void add(T data); void remove(T data); /*... */ }; list_node node1; list_node node2; //... C++ templates/generics  reusable data structures

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 4 27 May 2003 C++ Templates template class list { public: void add(string data) { Guard lock; // perform the operation... } }; // in a single-threaded context list my_list; my_list.add("unsynchronized"); // in a multithreaded context list other_list; other_list.add("synchronized"); C++ templates/generics  reusable data structures  code specialization method inlining

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 5 27 May 2003 C++ Template Metaprogramming template struct fib { enum { a = fib ::value, b = fib ::value, value = a + b }; }; template <> struct fib { enum { value = 0 }; }; template <> struct fib { enum { value = 1 }; }; C++ templates/generics  reusable data structures  code specialization method inlining  metaprogramming constant computation template instantiation int i = fib ::value; cout << "The 6th Fibonacci " "number is " << i;

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 6 27 May 2003 Rate-Monotonic Analysis (RMA) Fixed-priority static scheduling  Priorities inversely proportional to period Given a set of m independent tasks (C i,T i ) The task set is feasible if [Liu & Layland 1973] C i – cost for task i T i – period for task i C i – cost for task i T i – period for task i C i /T i ≤ m(2 1/m – 1) Σ i

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 7 27 May 2003 Improved Feasibility Test Given a set of m independent tasks (C i,T i ) The task set is feasible if and only if [Lehoczky, Sha, & Ding 1987] C i – cost for task i T i – period for task i C i – cost for task i T i – period for task i A i, 1 ≤ i ≤ m where R = { (k,l) | 1 ≤ k ≤ i, 1 ≤ l ≤ T i /T k } min Σ (C j /(l T k )) l T k /T j ≤ 1 (k,l) ε Rj = 1 i

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 8 27 May 2003 RMA Template Metaprogram Perform feasibility test during compilation Determine best task set for stated requirements  Track and include dependencies Tasks become generic programming concepts Metaprogram is “reflective” on tasks Uses Alexandrescu’s typelists  compile-time variable-length linked lists of types

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters 9 27 May 2003 Concept: Task struct my_task { typedef TYPELIST_1(another_task) dependencies; typedef my_cheap_task cheaper_alternative; static const int importance = 1000; static const bool droppable = false; static const int cost = 100; static const int period = 600; static const int start = 50; static const int deadline = 500; static void do_task(const context_object& context) { // perform the work of the task } };

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 RMA Feasibility at Compile-Time struct taskA { enum { cost = 5, period = 10, /*... */ }; struct taskB { enum { cost = 5, period = 15, /*... */ }; typedef TYPELIST_2(taskA,taskB) mytasks; int main() { typedef Schedule my_schedule; STATIC_CHECK(my_schedule::feasible, Schedule_Infeasible); my_schedule::schedule(); /*... */ return 0; } No runtime cost Specialized

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 RMA Computation Details Given a set of m independent tasks (C i,T i ) The task set is feasible if and only if A i, 1 ≤ i ≤ m where R = { (k,l) | 1 ≤ k ≤ i, 1 ≤ l ≤ T i /T k } min Σ (C j /(l T k )) l T k /T j ≤ 1 (k,l) ε Rj = 1 i Typelist s.t. Σ C j t /T j ≤ t j = 1 i t ε { (k,l) | 1 ≤ k ≤ i, 1 ≤ l ≤ T i /T k } E check_i support template sum_j support template get_t support template Top-level Schedule template instantiation

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Example: The check_i template template <class Head, class Tail, int m, int i> struct check_i, m, i> { enum { task_result = task_feasible, i>::Result, Result = task_result && check_i, m, i+1>::Result }; }; template struct check_i, m, m> { enum { Result = task_feasible, m>::Result }; }; Base of recursion foreach i = 1..m

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Using Tasks Also can specify dependencies & alternatives Could collect information for dynamic scheduling  Adaptation transitions typedef Schedule sched; sched::schedule(); Compile-time type error if task set infeasible Provides generic, no-overhead interface to a threading API

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Getting More from the Compiler Task dependence τ 1 requires { τ 2, τ 3 } Task alternation { τ 1,..., τ i,..., τ m } → { τ 1,..., τ i ´,..., τ m } Powerful combinations  feasibility space search  make this feasible!

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Verification at Runtime Check that analysis results still hold on execution platform Distribution soundness Feedback loop Application cost estimates profiling production code

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Adaptation at Runtime typedef TYPELIST_3(user_task, idle_task, power_monitor_task) normalSet; typedef TYPELIST_2(low_power_user_task, low_power_idle_task) lowPowerSet; void power_monitor_task::do_task(const context_object&) { if(power() <= threshold) { taskSet = new Adaptation_Traits ::adapt_to; } }; template <> class Adaptation_Traits { typedef lowPowerSet adapt_to; };

Washington University in St. Louis MDES 2003 Rate-Monotonic Analysis in the C++ Type SystemMorgan Deters May 2003 Remarks Bound to C++ “Configuration negotiation” within C++  Program specialization  Automatic program reconfiguration Related work And into the future...  Assist dynamic schedulers  Pre-compute adaptation transitions

Morgan Deters Thanks ! Department of Computer Science Washington University Box #1045 St. Louis, MO USA Christopher Gill Ron Cytron