Presentation is loading. Please wait.

Presentation is loading. Please wait.

Real-Time Systems, 2009 Fall Project 2: Energy-Efficient Scheduling For Android Environment Advised by Prof. Tei-Wei Kuo TA: Po-Chun Huang ( 黃柏鈞 )

Similar presentations


Presentation on theme: "Real-Time Systems, 2009 Fall Project 2: Energy-Efficient Scheduling For Android Environment Advised by Prof. Tei-Wei Kuo TA: Po-Chun Huang ( 黃柏鈞 )"— Presentation transcript:

1 Real-Time Systems, 2009 Fall Project 2: Energy-Efficient Scheduling For Android Environment Advised by Prof. Tei-Wei Kuo TA: Po-Chun Huang ( 黃柏鈞 )

2 Introduction From the previous assignment, we know how to control the power modes of the backlight device on the Android platform However, it is not trivial to simply turn off the backlight device when we do not need it, for the considerable time and energy overheads on power mode switching Don’t worry; in this assignment we will find a clever way to do this (since it is required ) 2

3 Some Quick Facts Power consumption of T-Mobile G1 Current: mA Configurations of Peripheral Devices Reference: http://rockthearth.blogspot.com/2009/04/power-consumption-of-t-mobile-g1.html 3 !!

4 What Will Be Done in This Assignment? (1/2) We will be given a task set T of periodic tasks t i, for i=1, 2,…, N –All tasks arrive at time point 0 –Tasks are sorted based on their periods (so pi <= pj iff i<j) Each task has a period p i, deadline d i, and several operations x ij (i=1…N; j=1…ni), each of which has the following properties: CD L D H –Luminance u ij : can be C, D L and D H, standing for Computation (no display required), Display in Low light and Display in High light, respectively –Length l ij : l ij =1, 2, …(setting the time unit to 3~4 seconds is a good choice) The requirements of a feasible schedule is those of a conventional hard real- time environment, plus –The operations of the same task must be scheduled in the specified order –During the scheduled time of each operation, the back light device must be adjusted to at least as bright as that specified as required Luminance 4

5 What Will Be Done in This Assignment? (2/2) Energy issues E C E DL E DH –During each time unit, the backlight device at none(C), low light display (DL), and high light display (HL) consumes E C, E DL, and E DH of energy, respectively E DH >E DL >E C >=0Of course we can assume that E DH >E DL >E C >=0 E C =0For simplicity we assume that E C =0 –Additional energy E SW is consumed on power level switching For simplicity, we assume that switching from an arbitrary power level to another demands the same quantity of energy For simplicity, we assume that power level switching happens immediately Compute the feasible schedule with minimal energy consumption!Our goal: Compute the feasible schedule with minimal energy consumption! 5

6 A Sample Input The input will be given to you manually; you can hard-code them in your sources (with clear mark so that I know it’s the input ) T = {t1, t2, t3} –t 1 = (16(p 1 ), 14(d 1 ), ((1, 0(C))(x 11 ), (1, 1(D L ))(x 12 ))) –t 2 = (20(p 2 ), 20(d 2 ), ((1, 2(D H ))(x 21 ), (3, 1)(x 22 ))) –t 3 = (28(p 3 ), 20(d 3 ), ((1, 0)(x 31 ), (1, 1)(x 32 ), (1, 0)(x 33 ))) –E C =0, E DL =1, E DH =5, E SW =12 6

7 Scoring Baseline: RM schedule (30%) Implement then write down your improvement over the RM schedule in reports (70%) –Must provide the intuition and sufficient examples to show why it is better than original RM! –Must output the detailed computed schedule with LogCat! Better if you can prove the bound of energy or time! (30% bonus) Even better if you can compose a demo of your algorithm on the Android emulator! (30% bonus) 7

8 The LogCat Debugging Console 8

9 Open the LogCat Console View Add the LogCat view to menu shortcut: Window -> Customize Perspective -> Shortcuts -> Submenus : Show View -> Categories : Android -> LogCat Open the view: Window -> Show View - > LogCat 9

10 Print Customized Debugging Messages in LogCat Import android.util.Log package in your project Use the static variable Log to keep trace of your target: Log.d("DEBUG", "message"); Please use the message typed “DEBUG” to make them distinguished from system messages! You should print at least the following messages: –If the task set is un-schedulable, simply print “Unschedulable!” –Else, during the time interval [0, LCM(p 1, …, p N )), in each time unit, the light level and the IDs of scheduled operation and its residing task should be printed as: Time XX: Running task XX, operation XX, H(high light)/L(low light)/N(no light) –If nothing is being executed during that time, print: Time XX: Idle, H/L/N –By the end of program, print out a summary message about the total energy consumption statistics, and the number of light level switching, using RM and your algorithms respectively: Total high light time: XX Total low light time: XX Total no light time: XX Total light switching: XX times Total energy consumption of my algorithm: XX –Finally print the degree of improvement: Energy improved by 17% You should include this result of each of the 5 test cases in your report! For the test cases please see the web site. 10

11 Sample Outputs 1 ---- RM ---- –Unschedulable! ---- My program ---- –Unschedulable! ---- Results ---- –Unschedulable! 11

12 Sample Outputs 2 ---- RM -------- RM ---- –Time 0: Running task 1, operation 1, H –Time 1: Running task 2, operation 1, L –…… –Time 48: Running task 1, operation 1, N –Total high light time: 22 –Total low light time: 15 –Total no light time: 11 –Total light switching: 16 times –Total energy consumption: 130 ---- My program -------- My program ---- –Time 0: Running task 1, operation 1, H –Time 1: Running task 1, operation 2, H –…… –Time 48: Running task 2, operation 1, N –Total high light time: 17 –Total low light time: 16 –Total no light time: 15 –Total light switching: 6 times –Total energy consumption: 108 ---- Results -------- Results ---- –Energy improved by 17% 12

13 Hint 1: Modify RM Modify RM to reduce power without sacrificing schedulabilityModify RM to reduce power without sacrificing schedulability 13

14 Hint 2: Idle Time… How about the light mode between scheduled task operations? We know that How about… 14 HH??? HL LH NNN

15 Hint 3: Moving and Swapping Moving: Without violating the deadlines, move the scheduled points of tasks left or right to reduce the idle time Swapping: Without violating the deadlines, swap the scheduled points of tasks to reduce light level switching 15 LHLH LHLH

16 Hint 4: Switching the Power Levels based on the Schedule of Your Solution Thread.sleep lets a thread “sleep” for a specified time period Thread.run executes the thread’s method Thread.join waits for the created thread to finish for its computation results No need to create a thread for each task… 16

17 Submission The deadline of this assignment is 1/7, 23:59 Mail to f95070@csie.ntu.edu.tw with –Title: [RTS Project II] Your-Student-ID Your-Name –Attached files: Project directory compressed into a single file: Your- Student-ID.zip/.tar/.tgz/.7z Report: Your-Student-ID.txt –You will receive a confirmation about your submission in two days; if not, please contact TA immediately –Any questions are welcome through E-mail or face-to-face discussion in R442! 17

18 Q & A? Thank You! 18


Download ppt "Real-Time Systems, 2009 Fall Project 2: Energy-Efficient Scheduling For Android Environment Advised by Prof. Tei-Wei Kuo TA: Po-Chun Huang ( 黃柏鈞 )"

Similar presentations


Ads by Google