Abstract:
A system, apparatus, and method are provided which allows for reducing power consumption in dynamic voltage and frequency scaled processors while maintaining performance within specified limits. The method includes determining the off-chip stall cycle in a processor for a specified interval in order to characterize a frequency independent application workload in the processor. This current application workload is then used to predict the application workload in the next interval which is in turn used, in conjunction with a specified performance bound, to compute and schedule a desired frequency and voltage to minimize energy consumption within the performance bound. The apparatus combines the aforementioned method within a larger-scale context that reduces the energy consumption of any given computing system that exports a dynamic voltage and frequency scaling interface. The combination of the apparatus and method form the overall system.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This application claims priority to U.S. Provisional Application Ser. No. 61/028,727 filed Feb. 14, 2008. The complete contents of that application is herein incorporated by reference. 
     
    
     BACKGROUND OF THE INVENTION 
       [0002]    1. Field of the Invention 
         [0003]    This invention pertains generally to reducing power consumption in any computing environment (e.g., embedded computing system, laptop, datacenter server, supercomputer), and more particularly to a system, apparatus, and method for implementing a power- and energy-aware environment and algorithm that automatically and transparently adapts processor voltage and frequency settings to achieve significant power and energy reduction with minimal impact on performance. 
         [0004]    2. Background Description 
         [0005]    The total electricity bill to operate datacenter servers and related infrastructure equipments is estimated to have more than doubled in the United States and worldwide between 2000 and 2005, to $7.2 billion worldwide ($2.7 billion U.S.). Additionally, the high power density of these systems undermines both their availability and reliability. 
         [0006]    Different approaches to improve the energy and power efficiency of computers focus on different levels of abstraction: hardware, systems integration, systems software, middleware, and applications software. One of the systems-level approaches leverages a mechanism called Dynamic Voltage and Frequency Scaling (DVFS) to decrease the voltage and frequency of a DVFS-enabled processor in order to minimize power consumption when it is not doing useful work. However, given that the time to scale voltage and frequency takes on the order of 10,000,000 clock cycles, sophisticated use of DVFS is needed if energy reduction is to be realized within a performance bound. 
         [0007]    The past few years have seen significant research in power-aware computing, which can be broadly categorized along a multitude of dimensions: off-line vs. on-line; trace-based or profile-based scheduling vs. model-based scheduling; and static vs. dynamic. The on-line method can achieve better accuracy than off-line methods and has advantages for system-wide scheduling required for emerging multi-core and many-core environments where a computing system can run one or multiple applications simultaneously. 
         [0008]    Lim (see Lim, M. Y., et al., Adaptive transparent frequency and voltage scaling of communication phases in MNPI programs. In Proceedings of the ACM/IEEE Supercomputing 2006 (SC06), 2006) designed an on-line system that dynamically reduces processor performance during communication phases in Message Passing Interface (MPI) programs. Curtis-Maury (M. Curtis-Maury, M., et al., Online power-performance adaptation of multithreaded programs using hardware event-based prediction. In International Conference on Supercomputing (ICS06), Queensland, Australia, June 2006.) presented a comprehensive framework for autonomic power-performance adaptation of multi-threaded programs using thread throttling. However, since the above are designed for MPI and OpenMP applications, respectively, they have limited application. For power-aware techniques using general workload characterization, Choi and Pedram (Choi, R. and M. Pedram, M., Fine-grained dynamic voltage and frequency scaling for precise energy and performance trade-off based on the ratio of off-chip access to onchip computation times. IEEE transactions on computer-aided design of integrated circuits and systems, 24(1), 2005.), Hsu and Feng (Hsu, C. and Feng, W., A power-aware run-time system for high-performance computing. In Proceedings of the ACM/IEEE Supercomputing 2005 (SC05), 2005.) (β algorithm), and Ge (Ge, R., et al., CPU MISER: A performance-directed, run-time system for power-aware clusters. In International Conference on Parallel Processing, 2007 (ICPP07), 2007.) have established the current state-of-the-art for general computing systems. 
         [0009]    Choi and Pedram proposed a DVFS approach based on the ratio of off-chip access to on-chip computation time that targeted embedded systems. It uses the number of instructions and external memory accesses to compute the ratio of off-chip computation time to on-chip computation time. However, this has limitations since off-chip access time is processor-frequency independent, while on-chip computation time decreases with increased processor frequency. Moreover, this method only considers memory access and ignores thread synchronization in exploring energy-saving opportunities. 
         [0010]    The β algorithm of Hsu and Feng assumes that processor boundedness is indirectly reflected via the MIPS (millions of instructions per second) rate. Since the MIPS rate only approximately reflects processor boundedness and is dependent on processor frequency, it cannot accurately characterize application workload nor can it effectively bound performance loss. Another drawback to the β algorithm is that it is insensitive to workload variation. This compromises the accuracy of its workload characterization and misses potential energy savings. 
         [0011]    CPU MISER of Ge et al. relies on cache-access statistics to provide information about the workload. It also assumes the number of instructions executed approximates the number of on-chip accesses based on heuristics. As such, this approach only accurately characterizes workload on average. 
         [0012]    The Linux on-demand governor is the most widely employed across laptops, desktops and servers. This method is provided in the CPUFreq subsystem of a recent Linux kernel. It dynamically changes CPU (i.e., processor) frequency depending on CPU utilization. Because CPU utilization is misleading in terms of characterizing a program&#39;s workload, this approach cannot efficiently deliver both power savings while controlling performance loss. 
         [0013]    There are significant opportunities to improve workload characterization in order to reduce power consumption in DVFS-enabled processors while maintaining overall performance within specified bounds. This is particularly true for environments with dynamic and variable workloads, for system-wide monitoring and control of multiple processors (cores), and where highly configurable and transplantable solutions are required. 
       SUMMARY OF THE INVENTION 
       [0014]    According to the invention, a system, apparatus, and method are provided which allows for reducing power consumption in dynamic voltage and frequency scaled processors while maintaining performance within specified limits. The method includes determining the off-chip stall cycle in a processor for a specified interval in order to characterize a frequency independent application workload in the processor. This current application workload is then used to predict the application workload in the next interval which is in turn used, in conjunction with a specified performance bound, to compute and schedule a desired frequency and voltage to minimize energy consumption within the performance bound. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]    The present invention will be understood and appreciated more fully from the following detailed description in conjunction with the drawings in which: 
           [0016]      FIG. 1  illustrates the implementation of the methodology with respect to hardware cores; 
           [0017]      FIG. 2  illustrates the effectiveness of an implementation of the present invention in characterizing workload with respect to an alternative off-line method; 
           [0018]      FIG. 3  illustrates the performance of an implementation of the present invention under different performance bounds; 
           [0019]      FIG. 4  illustrates the energy savings of an implementation of the present invention for various performance bounds; 
           [0020]      FIG. 5  illustrates the performance control of an implementation of the present invention in comparison to prior art implementations; 
           [0021]      FIG. 6  illustrates the CPU energy savings of an implementation of the present invention in comparison to prior art implementations; and 
           [0022]      FIG. 7  illustrates overall energy savings of an implementation of the present invention in comparison to prior art implementations. 
       
    
    
     DETAILED DESCRIPTION 
       [0023]    From a power-aware perspective, the behavior of an application can create opportunities for energy savings. Execution phases with memory-intensive activities have been an attractive target for DVFS algorithms because the time for a memory access is independent of how fast the processor is running. When frequent memory or input/output (I/O) accesses dominate a program&#39;s execution time, they limit how fast the program can finish executing. It is this memory wall that provides an opportunity to reduce power and energy consumption while maintaining performance. In cluster computing and grid environments, there are further opportunities for power and energy savings, particularly network or I/O operation as well as network process synchronization as well as I/O synchronization, e.g., traditional collective I/O. During the operation or synchronization, CPUs are either waiting or idling. 
       I—Theoretical Foundation 
       [0024]    In Section A below, we review the theory of how to best control performance and how to derive a parameter λ to characterize application workloads, i.e., quantify application behavior. In Section B, we then present our methodology on how to measure λ using CPU stall cycles due to off-chip activities. 
         [0025]    A. Workload Characterization 
         [0026]    At the systems level, any execution time of a program at CPU frequency f can be divided into two parts. One part is frequency sensitive, and the other is frequency insensitive. Correspondingly, we divide the CPU execution cycles into on-chip cycles C on  and off-chip cycles C off . 
         [0000]        C   on   +C   off   =T ( f )· f    (1) 
         [0027]    C on  is the CPU cycles whose execution is affected by frequency variation while C off  is the CPU cycles whose execution is not affected by frequency variation. 
         [0028]    We define T off  to represent the execution time that is CPU frequency insensitive. 
         [0000]    
       
         
           
             
               
                 
                   
                     T 
                      
                     
                       ( 
                       f 
                       ) 
                     
                   
                   = 
                   
                     
                       
                         C 
                         on 
                       
                       · 
                       
                         1 
                         f 
                       
                     
                     + 
                     
                       T 
                       off 
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0029]    When a program runs at maximum frequency f max , 
         [0000]    
       
         
           
             
               
                 
                   
                     T 
                      
                     
                       ( 
                       
                         f 
                         max 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         C 
                         on 
                       
                       · 
                       
                         1 
                         
                           f 
                           max 
                         
                       
                     
                     + 
                     
                       T 
                       off 
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0030]    T off  in Eq. (3) is the same as in Eq. (2) when executing the same amount of program instructions since T off  is not affected by the change of CPU frequency f. 
         [0031]    To quantify the performance loss, we define a parameter δ that indicates the performance bound in employing DVFS, 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         T 
                          
                         
                           ( 
                           f 
                           ) 
                         
                       
                       - 
                       
                         T 
                          
                         
                           ( 
                           
                             f 
                             max 
                           
                           ) 
                         
                       
                     
                     
                       T 
                        
                       
                         ( 
                         
                           f 
                           max 
                         
                         ) 
                       
                     
                   
                   &lt; 
                   δ 
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0032]    Substituting T(f) and T(fmax) from Eq. (2) and (3), respectively, into Eq. (4), we get 
         [0000]    
       
         
           
             
               
                 
                   C 
                   on 
                 
                 
                   
                     C 
                     on 
                   
                   + 
                   
                     
                       T 
                       off 
                     
                     · 
                     
                       f 
                       max 
                     
                   
                 
               
               · 
               
                 
                   
                     f 
                     max 
                   
                   - 
                   f 
                 
                 f 
               
             
             &lt; 
             δ 
           
         
       
     
         [0033]    The equation can be reformulated as 
         [0000]    
       
         
           
             
               
                 
                   
                     λ 
                     · 
                     
                       
                         
                           f 
                           max 
                         
                         - 
                         f 
                       
                       f 
                     
                   
                   &lt; 
                   δ 
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0034]    where 
         [0000]    
       
         
           
             
               
                 
                   λ 
                   = 
                   
                     
                       C 
                       on 
                     
                     
                       
                         C 
                         on 
                       
                       + 
                       
                         
                           T 
                           off 
                         
                         · 
                         
                           f 
                           max 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0035]    The workload characterization, denoted by λ in Eq. (6), can be reformulated as 
         [0000]    
       
         
           
             
               
                 
                   λ 
                   = 
                   
                     
                       C 
                       on 
                     
                     
                       
                         C 
                         on 
                       
                       + 
                       
                         
                           C 
                           off 
                         
                         · 
                         
                           
                             f 
                             max 
                           
                           f 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0036]    Combining Eq. (1) and (7), we obtain 
         [0000]    
       
         
           
             
               
                 
                   λ 
                   = 
                   
                     
                       
                         
                           f 
                           2 
                         
                          
                         
                           T 
                            
                           
                             ( 
                             f 
                             ) 
                           
                         
                       
                       - 
                       
                         fC 
                         off 
                       
                     
                     
                       
                         
                           f 
                           2 
                         
                          
                         
                           T 
                            
                           
                             ( 
                             f 
                             ) 
                           
                         
                       
                       - 
                       
                         fC 
                         off 
                       
                       + 
                       
                         
                           f 
                           max 
                         
                          
                         
                           C 
                           off 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   8 
                   ) 
                 
               
             
           
         
       
     
         [0037]    where 0≦λ≦1. The value of λ serves two purposes:
   Intrinsic workload characterization. From Eq. (6), the workload characterization λ is a parameter that is independent of the CPU frequency at which the application is running. λonly depends on the application itself. Eq. (7) shows that λ characterizes the percentage of on-chip cycles out of the total CPU cycles at frequency f max . When λ equals to 1, C off  is 0, which means that the program spent all its time on on-chip activities. When λ equals 0, C on  must be 0, which means the program spent all its time on off-chip activities. Eq. (8) gives us a method to quantify the behavior of applications, even if they are not running on frequency f max .   Frequency schedule indicator. In Eq. (5), assuming the required performance constraint δ is constant, running at frequency f is a decreasing function of λ. The larger the λ, the more opportunities that exist for saving energy within the performance constraint. So, λ can direct us to schedule the appropriate frequency for a given workload.   
 
         [0040]    B. Methodology for Measuring CPU Off-Chip Stall Cycles 
         [0041]    In this section, we present our novel methodology for measuring SC off . In order to achieve the desired accuracy, we obtain the CPU stall cycles due to off-chip activities from two aspects: on-chip (SC off   on ) and off-chip (SC off   off ). 
         [0042]    1) Measuring from the On-Chip Perspective: 
         [0000]    
       
      
       SC 
       off 
       on 
       =SC 
       total 
       −SC 
       on 
       ≃SC 
       total 
       −SC 
       branch 
       −SC 
       reorder  
      
     
         [0043]    where SC off   on  is the on-chip measurement of CPU stall cycles due to off-chip activities. For our methodology, we measure SC total  using the CPU&#39;s decoder/dispatch stall cycles and measure SC on  using the sum of the CPU&#39;s decoder stall cycles due to branch misprediction (SC branch ) and full reorder buffer (SC reorder ). These two events are chosen because they dominate CPU stall cycles due to on-chip activities and hardly overlap with each other. There are also other stall cycles contributors such as segment load and serialization, however, our empirical results show that CPU stall cycles contributed by these events are small; thus, we ignore them in our estimation. 
         [0044]    2) Off-Chip Measurement: 
         [0000]        SC   off   off   =N   mem ·τ mem   ·f+T   io   ·f+T   idle   ·f    
         [0045]    where SC off   off  is the off-chip measurement of CPU stall cycles due to off-chip activities. N men  is the number of off-chip memory accesses; τ mem  is the memory-access latency; T io  is the CPU stall time for waiting on I/O completion; and T idle  is the CPU idle time. We use L2 cache misses to emulate the number of off-chip memory accesses and use LMBench [10] to measure the memory-access latency τ mem . T io  and T idle  can be obtained through/proc/stat on Linux systems. 
         [0046]    3) Synthetic Measurement: 
         [0047]    We obtain our final measurement by taking the minimum of on-chip and off-chip measurement of CPU stall cycles due to off-chip activities. 
         [0000]        SC   off =min( SC   off   on   ,SC   off   off ) 
         [0048]    The minimum is used since both measurements over-estimate the number of CPU stall cycles. On the one hand, for on-chip measurement, many events can cause CPU stalls, e.g. branch abortion, serialization, full reorder buffer, but there is no such hardware event that can measure CPU stall cycles due to off-chip activities directly. Moreover, most of the events involve both on-chip activities and off-chip activities. Therefore, an event cannot be simply treated as an event due to on-chip activities or off-chip activities. To exacerbate the problem, the events sometimes overlap with each other. On the other hand, off-chip measurement is also not accurate enough. 
         [0049]    Let us take CPU stall cycles due to off-chip memory accesses as an example. Both off-chip memory accesses and memory latency are hard to determine precisely. The L2 cache misses measured by the hardware counter usually include some due to speculative execution. Additionally, due to CPU prefetching and block transfer, some L2 cache misses will be combined and transferred together. Thus, it is not exactly accurate to measure off-chip memory accesses using L2 cache misses. The actual number of memory accesses will be smaller than the measured value. 
         [0050]    Two facts lead us to combine on-chip and off-chip measurements. For CPU-bound applications, L2 cache misses are smaller and the opportunity for combining and overlapping cache misses is small. Thus, off-chip measurement works better for CPU-bound applications. For non-CPU-bound applications, however, CPU stall cycles due to off-chip activities dominate the total CPU stall cycles. Therefore, on-chip measurement fits non-CPU-bound applications well. 
       II—ECO Algorithm for a Power-Aware Run-Time System 
       [0051]    Based on the theoretical foundation above, we developed a new workload-aware, eco-friendly algorithm called eco. The algorithm consists of multiple components: (1) the high-level algorithm itself that periodically determines whether to scale the frequency and voltage, (2) workload prediction to enable the decision of what to scale the frequency (and voltage) to, and (3) once a frequency is determined, how to schedule and emulate the frequency (and voltage) if the platform does not explicitly support the frequency. We refer to our power-aware, eco-friendly algorithm as eco and its implementation as ecod. The ecod system manages application performance and power consumption in real time based on an accurate measurement of CPU stall cycles due to off-chip activities and does not require application-specific information a priori. 
         [0052]    A. Overview of Algorithm 
         [0053]    The eco algorithm is an interval-based, run-time algorithm, whose execution time is divided into intervals that span the running time of an application program. Within each interval, the algorithm performs the following: 
         [0054]    1) Characterizes the workload for the current interval, as noted in Section I. As stated before, frequent memory and I/O access, network process synchronization, as well as CPU idling constitute the three main opportunities for power-aware computing. However, these three opportunities vary from application to application and change from time to time. In short, the eco algorithm quantifies the application behavior at run time for each interval. 
         [0055]    2) Predicts the workload characterization for the next interval. The eco algorithm predicts the workload for the next interval based on that of previous intervals. It uses the average of a λ window of previous intervals to predict the workload, since we observe that workload tends to be constant for short periods of time. 
         [0056]    3) Schedules the frequency for the next interval. The eco algorithm schedules the CPU frequency based on the predicted workload characterization in order to maintain the performance bound while saving as much energy as possible. However, we must address two problems in frequency scheduling for real systems in this step: (1) CPUs only support discrete frequencies, and (2) CPU frequencies have a lower and upper bound. 
         [0057]    B. Workload Prediction 
         [0058]    Though workloads may vary from application to application, the workloads can still be predictable at some level. For example, we set a window size of L and use the average across the window to predict the λm current interval. The window size cannot be too large so that the DVFS scheduler is reactive to workload variation, but the window size cannot be too small either as it risks significant prediction error. Empirically, we set the window size to be 3 by default in ecod. 
         [0059]    Because there will always exist some error in any workload prediction, we integrate a rectifying mechanism to monitor and control the global performance slowdown. The basic idea is to calculate the workload prediction error in each interval and make some correction in the future scheduling of frequencies to compensate for the prediction error. Initially, the performance bound δ equals a user-defined performance constraint Δ, e.g. 5%. During execution, if the predicted λ is larger than the measured λ, we increase the value of δ for the next interval and vice versa. 
         [0060]    Consider an interval of T(f) in a program execution. Assume λ F  is the predicted workload characterization of the program in an interval. The actual measured workload characterization is denoted as λ m . Let f p  be the frequency based on λ P , which is the frequency the program has been running on and let f m  be the frequency based on λ m , which is the frequency the program should have been running on. 
         [0061]    The error in execution time over the interval is 
         [0000]    
       
         
           
             
               
                 
                   ζ 
                   = 
                   
                     
                       
                         T 
                          
                         
                           ( 
                           
                             f 
                             p 
                           
                           ) 
                         
                       
                       - 
                       
                         T 
                          
                         
                           ( 
                           
                             f 
                             m 
                           
                           ) 
                         
                       
                     
                     = 
                     
                       
                         C 
                         on 
                       
                       · 
                       
                         ( 
                         
                           
                             1 
                             
                               f 
                               p 
                             
                           
                           - 
                           
                             1 
                             
                               f 
                               m 
                             
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   9 
                   ) 
                 
               
             
           
         
       
     
         [0062]    where C out  can be measured directly for current interval. f g  is already known in the current interval and f m  can be obtained after completing this interval via frequency scheduling, i.e., Eq. (10). To compensate for the prediction error, the performance constraint for next interval becomes 
         [0000]    
       
         
           
             δ 
             = 
             
               Δ 
               + 
               
                 ζ 
                 
                   T 
                    
                   
                     ( 
                     f 
                     ) 
                   
                 
               
             
           
         
       
     
         [0063]    where T(f) is the time for next interval, Δ is the standard performance constraint without compensation, and ζ is calculated via Eq. (9). 
         [0064]    C. Frequency Scheduling and Emulation 
         [0065]    Assuming that  λ  is the predicted workload characterization for the current interval, then based on Eq. (5), the ideal frequency for the current interval is 
         [0000]    
       
         
           
             
               
                 
                   
                     f 
                     * 
                   
                   = 
                   
                     
                       
                         λ 
                         _ 
                       
                       · 
                       
                         f 
                         max 
                       
                     
                     
                       
                         λ 
                         _ 
                       
                       + 
                       δ 
                     
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0066]    However, due to the physical constraints of the processor itself, the available frequencies in a real system are bounded. 
         [0067]    Thus, f* needs to be calculated as 
         [0000]    
       
         
           
             
               f 
               * 
             
             = 
             
               max 
               ( 
               
                 
                   f 
                   min 
                 
                 , 
                 
                   
                     
                       λ 
                       _ 
                     
                     · 
                     
                       f 
                       max 
                     
                   
                   
                     
                       λ 
                       _ 
                     
                     + 
                     δ 
                   
                 
               
               ) 
             
           
         
       
     
         [0068]    Finally, the calculated frequency f* may not be directly supported on a real system. So, we apply the method proposed in (Hsu, C. and Feng, W., A power-aware run-time system for high-performance computing. In Proceedings of the ACM/IEEE Supercomputing 2005 (SC05), 2005.) to emulate the calculated frequency f*. 
       D. The Eco Algorithm 
       [0069]    Synthesizing the steps shown above, we design our eco algorithm. The pseudocode for the eco algorithm. 
         [0000]    
       
         
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
           
               
                   
               
             
             
               
                 Hardware: 
               
             
          
           
               
                   
                 n frequencies f 1 , . . . , f n   
               
             
          
           
               
                 Parameters: 
               
             
          
           
               
                   
                 I: time-interval size 
               
               
                   
                 δ: performance bound 
               
               
                   
                 L: prediction window size 
               
             
          
           
               
                 Algorithm: 
               
               
                 Initialize the λ window 
               
               
                 Repeat 
               
             
          
           
               
                   
                 1. Measure CPU stall cycles due to off-chip activities for current 
               
             
          
           
               
                 interval C     off     
               
             
          
           
               
                   
                 2. Compute coefficient λ for current interval 
               
               
                   
                   
               
               
                   
                 
                   
                     
                       
                         λ 
                         = 
                         
                           
                             
                               
                                 f 
                                 2 
                               
                                
                               I 
                             
                             - 
                             
                               f 
                                
                               
                                   
                               
                                
                               
                                 C 
                                 off 
                               
                             
                           
                           
                             
                               
                                 f 
                                 2 
                               
                                
                               I 
                             
                             - 
                             
                               f 
                                
                               
                                   
                               
                                
                               
                                 C 
                                 off 
                               
                             
                             + 
                             
                               
                                 f 
                                 max 
                               
                                
                               
                                 C 
                                 off 
                               
                             
                           
                         
                       
                     
                   
                 
               
               
                   
                   
               
               
                   
                 3. Predict the workload for next interval for all λ in window [0, L] 
               
             
          
           
               
                   
                   λ  = average(λ) 
               
             
          
           
               
                   
                 4. Compute the desired frequency f*   
               
               
                   
                   
               
             
          
           
               
                   
                 
                   
                     
                       
                         
                           f 
                           * 
                         
                         = 
                         
                           max 
                            
                           
                               
                           
                            
                           
                             ( 
                             
                               
                                 f 
                                 min 
                               
                               , 
                               
                                 
                                   
                                     λ 
                                     _ 
                                   
                                   · 
                                   
                                     f 
                                     max 
                                   
                                 
                                 
                                   
                                     λ 
                                     _ 
                                   
                                   + 
                                   δ 
                                 
                               
                             
                             ) 
                           
                         
                       
                     
                   
                 
               
               
                   
                   
               
             
          
           
               
                   
                 5. Schedule next interval I at  f*   
               
               
                   
                   
               
             
          
         
       
     
         [0070]    Steps 1 and 2 encompass workload characterization. Step 3 is workload prediction, and Steps 4 and 5 deal with frequency scheduling and emulation. 
         [0071]    III—Experimental Set-Up 
         [0072]    Here we detail the experimental set-up for evaluating our eco algorithm, including hardware and software platform, power and energy measurement, and ecod implementation. 
         [0073]    A. Experimental Platform 
         [0074]    The hardware platform in our experiment included a four-node cluster for computing and an additional node for recording the power and energy consumption. Each compute node contained two dual-core AMD Opteron 2218 processors and 4-GB main memory. Each CPU core included one 128-KB split instruction and data L1 cache. Two cores on the same die shared one 1 MB of L2 cache. Each processor supported six power/performance modes, as shown in Table I. Finally, the nodes were interconnected with Gigabit Ethernet. 
         [0000]    
       
         
               
             
               
               
               
             
           
               
                 TABLE I 
               
             
             
               
                   
               
               
                 Power/Performance Modes for ICE Cluster Node 
               
             
          
           
               
                   
                 Frequency (GHz) 
                 Voltage (V) 
               
               
                   
                   
               
               
                   
                 2.6 
                 1.30 
               
               
                   
                 2.4 
                 1.25 
               
               
                   
                 2.2 
                 1.20 
               
               
                   
                 2.0 
                 1.15 
               
               
                   
                 1.8 
                 1.15 
               
               
                   
                 1.0 
                 1.10 
               
               
                   
                   
               
             
          
         
       
     
         [0075]    We ran Red Hat Linux (kernel version 2.6.18) on each compute node. The Linux kernel CPUFreq subsystem was used for controlling DVFS and PERFCTR for hardware counter monitoring. With respect to the benchmarks, we used the latest NAS Parallel Benchmarks (NPB3.2-MPI). We use mpich2 (version 1.0.6) to run the benchmarks. 
         [0076]    B. Energy Measurement and Processing 
         [0077]    We used the “Watts Up? PRO ES” power meter to measure the total system energy for each node. Energy values were recorded immediately before and after the benchmark runs. The difference of the two energy values is the energy consumed by the system when the benchmark ran. Since DVFS scheduling only affects the power consumption of the CPU, would be misleading to evaluate our eco algorithm based on the energy consumption of total system. So, in addition to reporting the total system energy, we also evaluate the effect of eco on CPU energy by applying a CPU power model used in (Hsu, C. and Feng, W., A power-aware run-time system for high-performance computing. In Proceedings of the ACM/IEEE Supercomputing 2005 (SC05), 2005.) to isolate the CPU energy from the total system energy. 
         [0078]    C. The ecod Implementation 
         [0079]      FIG. 1  illustrates the software architecture of our ecod implementation. We implemented ecod as a lightweight daemon that monitors all the cores in a node and schedules appropriate frequencies for them. When ecod starts up, it reads the configuration file and dynamically detects processor settings, e.g. available frequencies, number of cores, etc. In each sampling interval, the master daemon  10  fetches hardware-event information from the “Hardware Event Monitor Module”  14 . Then, workload prediction and performance rectification are performed  10 . In the end, the master daemon dispatches the desired frequency to “DVFS Scheduler Module”  12 , which then takes care of frequency scheduling of the cores  16 . 
         [0080]    D. Parameters and Sensitivity Analysis 
         [0081]    ecod is configurable and tunable. The configuration parameters as well as their default values for our experiments are shown in Table II. 
         [0000]    
       
         
               
             
               
               
               
             
           
               
                 TABLE II 
               
             
             
               
                   
               
               
                 Configuration Parameters and their Values in ecod 
               
             
          
           
               
                 Parameter 
                 Description 
                 Value 
               
               
                   
               
               
                 I 
                 Sampling interval 
                 1 second 
               
               
                 δ 
                 performance bound 
                 5% 
               
               
                 L 
                 prediction window size 
                 3 
               
               
                   
               
             
          
         
       
     
         [0082]    The user-configurable parameters are sampling interval, performance bound, and prediction window size. Below are the tradeoffs of these user-configurable parameters. 
         [0083]    Sampling Interval. As sampling intervals increase in length, the precision of workload characterization and its prediction will worsen, resulting in performance that cannot be tightly controlled. Conversely, when the sampling intervals get too short, the overhead of sampling the workload and scheduling the frequency is not as easily amortized. 
         [0084]    Performance Bound. The larger the performance bound (or percentage slowdown), the more energy that will be saved. However, once the frequency reaches the system&#39;s lowest frequency, it cannot save any more energy. 
         [0085]    Prediction Window Size. If the window size is large, the algorithm will depend on a larger amount of historical information, thus making more instantaneous workload prediction inaccurate. If the window size is small, the algorithm will be too sensitive to the workload variation. 
         [0086]    In our experiments, we compare ecod with the β algorithm and the Linux on-demand governor. The performance constraint in the β algorithm is set to 5%. As for Linux on-demand governor, we use the default configuration with a sampling rate of 560,000 ms and up threshold of 80%. 
       IV—Experiments and Analysis 
       [0087]    In this section, we first validate the workload characterization λ obtained by measuring the CPU stall cycles due to off-chip activities against an off-line approach, described in Section V. Then, we evaluate the workload prediction method used in eco algorithm along with a sensitivity analysis of the algorithm. Finally, we demonstrate the efficacy of ecod, our power-aware daemon based on eco, on the NAS Parallel Benchmarks (NPB3.2-MPI) in a cluster environment. 
         [0088]    A. Validation of Workload Characterization 
         [0089]    Before evaluating eco on the NAS Parallel Benchmarks, we first validated our workload characterization (λ) on a representative set of 10 SPEC CPU2000 benchmarks: three CPU-bound, three memory-bound, and four in between. Specifically, by evaluating λ, we indirectly evaluate the measurement of CPU stall cycles due to off-chip activities. 
         [0090]      FIG. 2  shows our evaluation of measured λ to that of an off-line approach (see Section V below), with the benchmarks arranged in such a way that the CPU-boundedness (i.e., Y axis) of the benchmarks decrease going left to right. The error of the measured λ to off-line value is only 3.4% on average. 
         [0091]    B. Evaluation of Workload Prediction 
         [0092]    Here we use the workload characterization (λ) obtained by CPU stall cycles 25 due to off-chip activities as a baseline to evaluate the effectiveness of our workload prediction method. We chose crafty, mcf, and bzip2 SPEC CPU2000 to illustrate the predictive performance on CPU-bound, memory-bound, and in-between benchmarks, respectively. 
         [0093]    Over the execution time of the benchmarks, we determined that the difference between measured λ and predicted λ is within 2%. The predicted λ also changes more smoothly than measured λ. This reflects the stability of our algorithm, which in turn, avoids significant DVFS scheduling overhead since the larger the frequency transition, the more overhead that is induced in DVFS scheduling. 
         [0094]    C. Sensitivity Analysis of Performance Bound 
         [0095]    Since ecod can more tightly control performance loss, we also evaluate how ecod behaves with different performance bounds.  FIG. 3  shows that ecod can bound the performance quite well; the performance variances for all the performance bounds are within 3%.  FIG. 4  shows that while maintaining performance, ecod can also achieve up to 56% in energy savings. 
         [0096]    D. Parallel Experiment 
         [0097]    With the validation of our workload characterization and workload prediction, coupled with our sensitivity analysis, all on a per-node basis as shown above, we next evaluated our eco algorithm, implemented as an eco-friendly daemon that we call ecod in a cluster environment. In such an environment, we expect the performance of our eco-friendly daemon to be quite good given the additional opportunities for energy savings due to frequent memory and I/O access, network process synchronization, as well as CPU idling. 
         [0098]    To evaluate ecod, we used the NAS Parallel Benchmarks. We ran the benchmarks with a Class C workload on 16 cores across four compute nodes, with each compute node containing four cores. Since the cores on the same die have a common power/performance mode, we scheduled the core frequency according to the higher one on the same die in order to guarantee performance. 
         [0099]      FIGS. 5 and 6  show the performance control and energy savings of ecod in comparison with the β algorithm and Linux on-demand governor, respectively. Table III summarizes the statistics on performance loss and energy savings. The performance loss averages 5.1%, which is better than the β algorithm (10.6%) and Linux on-demand governor (7.9%). The standard deviation of ecod is also the best among the three algorithms. 
         [0000]    
       
         
               
             
               
               
               
               
             
               
               
               
               
             
           
               
                 TABLE III 
               
             
             
               
                   
               
               
                 Statistics on Parallel Experiment 
               
             
          
           
               
                   
                 ecod 
                 β 
                 Linux on-demand 
               
               
                   
                   
               
             
          
           
               
                 Performance Mean 
                 5.1% 
                 10.6% 
                 7.9% 
               
               
                 Performance Standard Dev. 
                 3.5% 
                 10.3% 
                 7.7% 
               
               
                 Energy Mean 
                 31.5% 
                 32.9% 
                 28.6% 
               
               
                   
               
             
          
         
       
     
         [0100]    The CPU energy savings are comparable between ecod (average of 31.5%), β algorithm (average of 32.9%) and Linux on-demand governor (average of 28.6%). Considering that ecod achieves the same energy saving by sacrificing far less performance, ecod clearly performs better than the β algorithm and Linux on-demand governor. 
         [0101]    Finally, with respect to overall energy savings, ecod performs better than the β algorithm and the Linux on-demand governor on average, as shown in  FIG. 7 . ecod can achieve 11% energy savings on average across the NAS Parallel Benchmarks. Both 0 and the Linux on-demand governor have energy savings of 8% for the same benchmarks on average. 
       V—Off-Line Measurement of Off-Chip Cycles 
       [0102]    Here we describe an off-line method to calculate the CPU boundedness for an application and use it as a baseline to evaluate our measurement of CPU stall cycles due to off-chip activities. The method is described below. 
         [0103]    1) run the application for each available CPU frequency and record the corresponding execution time. 
         [0104]    2) normalize the execution time for each CPU frequency to the execution time at maximum CPU frequency f max . 
         [0105]    3) draw a graph canvas in which X-axis is CPU cycle time and Y-axis is the execution time of the application. 
         [0106]    4) draw points onto the canvas. X-coordinate of each point is the reverse of its running CPU frequency and Y coordinate of each point is the execution time on that CPU frequency. 
         [0107]    5) take the point of maximum frequency as the fixed point of trend line and use linear least square regression method to determine the slope of the trend line. The slope will minimize the least-square error: 
         [0000]    
       
         
           
             min 
              
             
               
                 ∑ 
                 
                   i 
                   = 
                   1 
                 
                 
                   n 
                   - 
                   1 
                 
               
                
               
                   
               
                
               
                 
                    
                   
                     
                       T 
                        
                       
                         ( 
                         
                           f 
                           i 
                         
                         ) 
                       
                     
                     - 
                     
                       k 
                        
                       
                         ( 
                         
                           
                             1 
                             
                               f 
                               i 
                             
                           
                           - 
                           
                             1 
                             
                               f 
                               max 
                             
                           
                         
                         ) 
                       
                     
                     - 
                     
                       T 
                        
                       
                         ( 
                         
                           f 
                           max 
                         
                         ) 
                       
                     
                   
                    
                 
                 min 
                 2 
               
             
           
         
       
     
         [0108]    6) the slope of the line is actually the CPU execution cycle C on  when the application is running at maximum frequency for 1 second. In other words, the slope is the average CPU execution cycles when running on maximum frequency. 
         [0109]    7) use the equation (1) to calculate C off . 
         [0110]    8) use the equation (8) to calculate λ.