Joint Sleep Scheduling and Mode Assignment in Wireless Cyber-Physical Systems
Chun Jason Xue , Guoliang Xing , Zhaohui Yuan , Zili Shao and Edwin Sha City University of Hong Kong, Email: jasonxue,
[email protected] Michigan State University, Email:
[email protected] Polytechnical University of Hong Kong, Email:
[email protected] University of Texas at Dallas, Email:
[email protected]
Abstract Designing cyber-physical systems with high efficiency, adaptability, autonomy, reliability and usability is a challenging task. In this paper, we focus on minimizing networkwide energy consumption for real-time applications in wireless cyber-physical systems. While a lot of work has been done to manage energy consumption on single processor real-time systems, little work has been done in network-wide energy consumption management for real-time applications. Existing work on network-wide energy minimization assumes that the underlying network is always connected, which is not consistent with the practice in which wireless nodes often turn off their network interfaces in a sleep schedule to reduce energy consumption. This paper jointly consider the radio sleep scheduling of wireless nodes and the execution modes of processors. Based on different wireless network topologies, different schemes are proposed to minimize energy consumption while guaranteeing the timing constraint and precedence constraint. When the precedence graph is a tree, optimal result on energy management is achieved. The experiments show that our approach significantly reduces total energy consumption compared with the previous work.
1. Introduction Cyber-Physical Systems (CPS) are integrations of computation with physical processes, e.g., automated traffic control, robotic surgery, autonomous collision avoidance, and zeronet energy buildings. These systems are often comprised of computation nodes connected wirelessly and collaborating in finishing a set of real-time tasks. Designing cyber-physical systems with high efficiency, adaptability, autonomy, reliability and usability is a challenging task. In this paper, we focus on minimizing network-wide energy consumption for real-time applications in wireless cyber-physical systems. Reducing energy consumption for stand alone systems has been extensively studied. By reducing processor supply voltage and clock frequency, we can reduce energy consumption at the cost of performance. Various embedded processors such as Intel XScale processor [1], and AMD’s mobile processor with AMD PowerNow! technology [2] are
all able to effectively reduce dynamic power consumption by supply voltage scaling. To reduce CPU energy consumption on single processor architecture with independent tasks, dynamic voltage scaling (DVS) solutions are first proposed in [3], [4]. Supply voltage and clock frequency are typically scaled down to achieve energy reduction with performance trade off. For networked embedded systems, it is important to consider energy reduction for all the nodes in the network. Some work has been done in this area to consider CPU energy for each nodes. In [5], slack distribution schemes are introduced for scheduling distributed real-time embedded systems while considering admission control and service demands. In [6], static slack is assigned based on the degree of parallelism in the schedule. While the above work consider CPUs in the network embedded systems, little work has been done to consider network-wide energy minimization in wireless embedded systems. Besides CPU, radio is another major source of power expenditure in wireless cyber-physical systems. An effective approach to conserve radio power is to schedule radios to be turned off when not in use. A number of sleep scheduling schemes have been implemented in practice [7], [8], [9]. Sleep scheduling introduces new challenges for networked embedded applications. For example, it is not suitable to simply assume that the underlying network is always ready. The execution of distributed real-time tasks thus must be jointly scheduled with the radio activity of nodes in the network. When a computation node finishes execution, the wireless radio of the next node in the task execution chain may still be in sleep mode. Communication can only take place when both nodes’ wireless radios wake up. Scheduling real-time tasks incognizant of radio status may lead to not only more energy consumption but also deadline misses. At the same time, most of the current sleep scheduling schemes are unaware of the computation status and often lead to unnecessary wakeups which waste energy. In [10], network-wide energy consumption was studied with the consideration of both CPUs and wireless radios, where a general network topology was given an sleep scheduling was fixed and given as input. In this paper, we propose solutions to minimize network-wide energy consumption for real-time tasks with precedence constraints executing on wireless embedded systems. Based on different
network topology, we propose static energy management schemes to minimize energy consumption while guaranteeing the timing constraint and precedence constraint. Optimal solutions are proposed in this paper for static energy management when the given task precedence graph is a tree. Sleep scheduling was conducted together with mode assignments. The experiments show that our approach reduces total energy consumption significantly compared with the previous work. The remainder of this paper is organized as follows. Section 2 introduces basic concepts and definitions. Theorems and algorithms are proposed in Section 3. Experimental results and concluding remarks are provided in Section 4 and 5, respectively.
2. Models 2.1. Task model In this paper, we consider a set of tasks with precedence constraints and sharing a common period. The precedence constraints and communication cost between tasks within an application are represented by a directed acyclic graph (DAG), , where vertexes represent tasks and edges represent dependencies between tasks. An example task graph is shown in Figure 1.
A
B
C
D
Frequency
Power
400 MHz
411 mW
300 MHz
283 mW
200 MHz
175 mW
2.3. Network model
In this paper, we consider a single-hop networked embedded system with nodes, which are connected by a wireless network. Besides CPU, another major source of power dissipation of networked embedded systems is wireless radio. According to several empirical studies [11], wireless radios working in idle listening state consume similar amount of power as in transmitting state. Therefore, an effective radio power conservation approach is to schedule radios to sleep when they are not actively transmitting. In this paper, we assume the radios of all the nodes in the wireless network operate according to their sleep schedules. The sleep schedule of the radio of each node will be determined jointly with the mode assignment in our proposed techniques to minimize network-wide energy consumption. In our network model, two nodes can communicate only when both radios are on simultaneously. In this paper, we assume that every time a radio wakes up, it wakes up for a small fixed time . A radio may wake up one or several times during a period. Fig. 2 illustrates the sleep schedules of three nodes. In this scheduling scheme, the sender and receiver of a communication task always wake up at the same time. We note that there also exists a class of ondemand sleep scheduling schemes [12] in which the sender and receiver wake up at different times and synchronize before the communication. Compared with such a sleeping scheme, the synchronous sleeping scheme is more suitable for wireless real-time systems [13]. In particular, by staging the on time of different nodes, communication collisions in the synchronous sleeping schedule can be largely avoided. This is critical for real-time systems that require guarantees on communication delay.
α
(a)
(b) R1
Figure 1. (a) An example task graph. (b) Xscale PXA255 power spec.
Communicate
R2 Communicate
R3
2.2. CPU Power model
discrete operating We assume each node supports modes. Each operating mode has different energy consumptions and different execution times. Each mode can have a different frequency level. For example, Intel Xscale PXA255 processor can operate in 3 different frequency levels, 200MHz, 300MHz, and 400MHz. As shown in Figure 1(b), when operating in different frequency levels, PXA255 has different power requirements. We use operating mode instead of frequency because it is more general. For example, each mode can also have its own body bias setting to manage leakage power.
Period p
Figure 2. The sleep schedules of three nodes. We note that the sleep scheduling model assumed in this paper is very general. This model is consistent with several synchronous sleep scheduling schemes such as the ones used by S-MAC [8] and 802.11 Power Saving Mode (PSM) [7].
2.4. Problem Formulation We formulate the network-wide energy minimization problem as follows:
Input: A task graph , where is the task set and is the set of dependencies between tasks; Operating mode for each node , where is the number of modes, is the execution time for mode and is the energy consumption for mode ; Radio wakeup time ; A time constraint , which is the deadline of completion of all the tasks. Output: The sleep schedule of each node’s radio and the mode assignment of each node so that the network-wide energy is minimized while the deadline is met. For each node , the energy consumed is composed of two parts:
where is the energy of CPU execution of node and is the energy consumed by node ’s radio. The objective then is to minimize:
$
! "#! %'&
In this paper, we assume the energy consumed by a node’s radio is proportional to the radio wake up time. We also assume that task mapping to computation nodes and task scheduling have been performed previously with a feasible schedule. The main focus of this paper is to jointly assign operating modes and wireless network sleep time to reduce the total energy consumption of the input schedule without violating the deadline and precedence constraints. We note that the power consumption of CPU and radio are comparable in several wireless embedded system platforms, which poses the need to jointly minimize the total energy as a whole. For example, on the sensor network platform Mic2 motes [14], ATMEL ATmega128L CPU’s average power is 8mA, and CC1000 radio’s idle power is 10mA. Hence, it is important to jointly consider CPU and radio’s power consumption.
3. Joint Sleep Scheduling and Mode Assignment In this section, we propose two joint sleep scheduling and mode assignment algorithms based on different wireless network topologies. When the given task dependency graph is a tree, an algorithm is presented to give the optimal solution. This algorithm is efficient in practice though rigorously speaking it is pseudo polynomial. To solve the general problem, a generic algorithm is proposed for general DAG task graph.
3.1. An Efficient Algorithm for Trees
(*) +,.--0/ +132
, is proposed in An efficient algorithm, this section. It gives optimal solution when the given task graph is a tree. We call a root node to be a node without any
parent and a leaf node to be a node without any child. A post-ordering for a tree is a linear ordering of all its nodes such that if there is an edge in the tree, then appears before in the ordering. For example, in Figure 1(a), both A,B,C,D and B,A,C,D are post-ordering for the given tree. The pseudo polynomial algorithm for trees, , is shown in Algorithm 3.1. Following the post-ordering in Step 1, we can get for each node by setting the minimum execution time for each node and computing the longest path from any leaf node to . In Step 2, basically, we select the minimum energy cost from all possible energy costs caused by adding into the subtree. In the following, we prove Algorithm gives the optimal solution when the given task graph is a tree. Theorem 3.1: ( ) obtained by Algorithm is the minimum system cost of the subtree ended on with total execution time . Proof: By induction. Basic Step: When , because the computation of follows the post-ordering, must have no parent node. Thus, . and , so if , where . Thus, When , Theorem 3.1 is true. Induction Step: We need to show that for , if is the minimum system cost of the subtree ended on , then is the minimum system cost of the subtree ended on . According to the post-ordering, the computation of for each parent node of has been finished before computing . From Step 3, gets the summation of the minimum system cost of all parent nodes of because they can be allocated and executed simultaneously within time . The minimum system cost is selected from all possible system costs caused by adding into the subtree ended on . So is the minimum system cost of the subtree ended on . Therefore, Theorem 3.1 is true for any ( ).
(*) +,--8/ +132
1+9 ;: @? ACB EDFGDH (*) +,--8/ +132 4 D A I 4 & > ? AJB > &K ? ACB ML >ON ?AVACB U ML ? J A B ; : & & 1+9 QPORS =T DWXD Q U > ? ACB 4 > ;Y'&J? ACB Y'& 4 ? ACB > 4 ;YZ& > ;YZ& ? AJB >\[ Y'&] K ? AJB 4 ;Y'& A 4 Y'& 4 Y'& > ;Y';& Y'? AJ& B 4 ED^D_H K ? AJB has no parent node and > ;From K? ACB Step > a`b? AC4,B if> 4 hasWonlyL ifone4 parent c` node 4 . Thus, we ; K ? C A B do not really need to compute > in these cases. Using
these simplified methods, an example is shown in Figure 3 for the given tree in Figure 1(a). Assume that there are 2 different modes, and . The post-ordering node set of the given tree and the corresponding execution times and execution costs are shown in Figure 3(a) and Figure 3(b) respectively. The computation procedure using Algorithm is shown in Figure 3(c) when the timing constraint is time units. In Figure 3(c), the mode assignments are recorded below . Node has two parent nodes, and , so a pseudo node is added and . When , all possible system costs caused by adding computing considering network wake up time are computed and the minimum cost is selected. The minimum cost and
d
4ji 4ji K ? ACB > 4
fe
(*) +,--0/ +1g2
h > ? ACB &4 4jk >Vi K? ACB l> & ? ACB >mk ? ACB >mn ? h B o
u1
u2
j= X 1[j]
3 4 5 6 7 1 1 1 1 1
m1 m2 m2 m2 m2 m2 m2
X 2[j]
u3
12 21 4 4
6 5
4 1 1 1 1
m1 m1 m1 m2 m2 m2 m2
X3’[j] u4
5 2 2 2 2
r1,r2
(a)
r3
m1 m2 T1 E1 T2 E2
X 3[j]
− − 9 8 7 5 5 m1 m1 m2 m1 m1
u1 1
2
2
1
u2 1
4
4
1
r3
u3 1
3
3
1
r4
u4 1
2
2
1
X4[j]
− − − − 11 10 9
m1 m1 m1
(b) (c)
I
Figure 3. An example for a tree with 2 operating modes and .
d5Q4 n . The assignment for the tree is V5 4 & V 5 4 k ef5 4 i and? dB 5 4 n , which is obtained by tracing how to reach >Vn h . complexity of Algorithm (*) +,--0/ +132 is The Z , where is the number of nodes, is the given time constraint, and is the number of modes. When equals ( is a constant) which is the general case in practice, Algorithm (*) +,--0/ +132 is polynomial.
the assignment is
3.2. An Efficient Algorithm for DAGs
(*) +,.--0/ V,
An efficient algorithm, , is proposed in this section. It is a greedy heuristic solution when the given task graph is a generic DAG. Details of algorithm are shown in Algorithm 3.2. Each execution node is initialized with the slowest running mode, which gives the longest execution time and the least energy consumption. Radio of each node is woken up as soon as the computation of the node finishes. The corresponding node will wake up its radio to receive the message at the same time. If the deadline is met, then the sleep scheduling and mode assignment are completed. While the deadline is not met, we choose one node to increment its energy consumption mode by one level to reduce the total execution time. How to judiciously choose a node during each step is the key of algorithm. We define a variable, , for each node ,
(*) +,--8/ V,
*( ) +,.--0/ V, is the energy difference for node ’s inwhere cremental mode change, and is the total execution time
Algorithm 3.1 Algorithm for Tree (JointAssignTree) Require: nodes with executing modes, a tree, and the timing constraint . Ensure: An optimal assignment for the tree. and let 1. Post-order be the post-ordering node set. For each node , let where is the execution time of node for executing mode ; and where is the energy cost of node for executing mode . 2. Associate an array to each node and let store the minimum energy cost of the subtree ended on with total execution time . For , . 3. For to , compute by:
H
=4 & 4 k ; 4 4 4 Y' & 1 e @ 4 > ? AC B 4 D A D A D ? C A B > N _ IL H !"# \ > ;K ? A ? ACB B A TI