1 \documentclass[conference]{IEEEtran}
3 \usepackage[T1]{fontenc}
4 \usepackage[utf8]{inputenc}
5 \usepackage[english]{babel}
6 \usepackage{algorithm,algorithmicx,algpseudocode}
7 \usepackage{graphicx,graphics}
14 \DeclareUrlCommand\email{\urlstyle{same}}
16 \usepackage[autolanguage,np]{numprint}
18 \renewcommand*\npunitcommand[1]{\text{#1}}
19 \npthousandthpartsep{}}
22 \usepackage[textsize=footnotesize]{todonotes}
23 \newcommand{\AG}[2][inline]{%
24 \todo[color=green!50,#1]{\sffamily\textbf{AG:} #2}\xspace}
25 \newcommand{\JC}[2][inline]{%
26 \todo[color=red!10,#1]{\sffamily\textbf{JC:} #2}\xspace}
30 \title{Dynamic Frequency Scaling for Energy Consumption
31 Reduction in Distributed MPI Programs}
42 University of Franche-Comté\\
43 IUT de Belfort-Montbéliard,
44 19 avenue du Maréchal Juin, BP 527, 90016 Belfort cedex, France\\
45 % Telephone: \mbox{+33 3 84 58 77 86}, % Raphaël
46 % Fax: \mbox{+33 3 84 58 77 81}\\ % Dept Info
47 Email: \email{{jean-claude.charr,raphael.couturier,ahmed.fanfakh_badri_muslim,arnaud.giersch}@univ-fcomte.fr}
54 Dynamic Voltage Frequency Scaling (DVFS) can be applied to modern CPUs. This
55 technique is usually used to reduce the energy consumed by a CPU while
56 computing. Indeed, power consumption by a processor at a given instant is
57 exponentially related to its frequency. Thus, decreasing the frequency
58 reduces the power consumed by the CPU. However, it can also significantly
59 affect the performance of the executed program if it is compute bound and if a
60 low CPU frequency is selected. The performance degradation ratio can even be
61 higher than the saved energy ratio. Therefore, the chosen scaling factor must
62 give the best possible trade-off between energy reduction and performance.
64 In this paper we present an algorithm that predicts the energy consumed with
65 each frequency gear and selects the one that gives the best ratio between
66 energy consumption reduction and performance. This algorithm works online
67 without training or profiling and has a very small overhead. It also takes
68 into account synchronous communications between the nodes that are executing
69 the distributed algorithm. The algorithm has been evaluated over the SimGrid
70 simulator while being applied to the NAS parallel benchmark programs. The
71 results of the experiments show that it outperforms other existing scaling
72 factor selection algorithms.
75 \section{Introduction}
78 The need and demand for more computing power have been increasing since the
79 birth of the first computing unit and it is not expected to slow down in the
80 coming years. To satisfy this demand, researchers and supercomputers
81 constructors have been regularly increasing the number of computing cores and
82 processors in supercomputers (for example in November 2013, according to the
83 TOP500 list~\cite{43}, the Tianhe-2 was the fastest supercomputer. It has more
84 than 3 millions of cores and delivers more than \np[Tflop/s]{33} while consuming
85 \np[kW]{17808}). This large increase in number of computing cores has led to
86 large energy consumption by these architectures. Moreover, the price of energy
87 is expected to continue its ascent according to the demand. For all these
88 reasons energy reduction became an important topic in the high performance
89 computing field. To tackle this problem, many researchers used DVFS (Dynamic
90 Voltage Frequency Scaling) operations which reduce dynamically the frequency and
91 voltage of cores and thus their energy consumption. Indeed, modern CPUs offer a
92 set of acceptable frequencies which are usually called gears, and the user or
93 the operating system can modify the frequency of the processor according to its
94 needs. However, DVFS also degrades the performance of computation. Therefore
95 researchers try to reduce the frequency to minimum when processors are idle
96 (waiting for data from other processors or communicating with other processors).
97 Moreover, depending on their objectives they use heuristics to find the best
98 scaling factor during the computation. If they aim for performance they choose
99 the best scaling factor that reduces the consumed energy while affecting as
100 little as possible the performance. On the other hand, if they aim for energy
101 reduction, the chosen scaling factor must produce the most energy efficient
102 execution without considering the degradation of the performance. It is
103 important to notice that lowering the frequency to minimum value does not always
104 give the most energy efficient execution due to energy leakage. The best
105 scaling factor might be chosen during execution (online) or during a
106 pre-execution phase. In this paper, we present an algorithm that selects a
107 frequency scaling factor that simultaneously takes into consideration the energy
108 consumption by the CPU and the performance of the application. The main
109 objective of HPC systems is to execute as fast as possible the application.
110 Therefore, our algorithm selects the scaling factor online with very small
111 footprint. The proposed algorithm takes into account the communication times of
112 the MPI program to choose the scaling factor. This algorithm has ability to
113 predict both energy consumption and execution time over all available scaling
114 factors. The prediction achieved depends on some computing time information,
115 gathered at the beginning of the runtime. We apply this algorithm to seven MPI
116 benchmarks. These MPI programs are the NAS parallel benchmarks (NPB v3.3)
117 developed by NASA~\cite{44}. Our experiments are executed using the simulator
118 SimGrid/SMPI v3.10~\cite{Casanova:2008:SGF:1397760.1398183} over an homogeneous
119 distributed memory architecture. Furthermore, we compare the proposed algorithm
120 with Rauber and Rünger methods~\cite{3}. The comparison's results show that our
121 algorithm gives better energy-time trade-off.
123 This paper is organized as follows: Section~\ref{sec.relwork} presents some
124 related works from other authors. Section~\ref{sec.exe} explains the execution
125 of parallel tasks and the sources of slack times. It also presents an energy
126 model for homogeneous platforms. Section~\ref{sec.mpip} describes how the
127 performance of MPI programs can be predicted. Section~\ref{sec.compet} presents
128 the energy-performance objective function that maximizes the reduction of energy
129 consumption while minimizing the degradation of the program's performance.
130 Section~\ref{sec.optim} details the proposed energy-performance algorithm.
131 Section~\ref{sec.expe} verifies the accuracy of the performance prediction model
132 and presents the results of the proposed algorithm. It also shows the
133 comparison results between our method and other existing methods. Finally, we
134 conclude in Section~\ref{sec.concl} with a summary and some future works.
136 \section{Related works}
140 In this section, some heuristics to compute the scaling factor are presented and
141 classified into two categories: offline and online methods.
143 \subsection{Offline scaling factor selection methods}
145 The offline scaling factor selection methods are executed before the runtime of
146 the program. They return static scaling factor values to the processors
147 participating in the execution of the parallel program. On one hand, the
148 scaling factor values could be computed based on information retrieved by
149 analyzing the code of the program and the computing system that will execute it.
150 In~\cite{40}, Azevedo et al. detect during compilation the dependency points
151 between tasks in a multi-task program. This information is then used to lower
152 the frequency of some processors in order to eliminate slack times. A slack
153 time is the period of time during which a processor that have already finished
154 its computation, have to wait for a set of processors to finish their
155 computations and send their results to the waiting processor in order to
156 continue its task that is dependent on the results of computations being
157 executed on other processors. Freeh et al. showed in~\cite{17} that the
158 communication times of MPI programs do not change when the frequency is scaled
159 down. On the other hand, some offline scaling factor selection methods use the
160 information gathered from previous full or partial executions of the program. A
161 part or the whole program is usually executed over all the available frequency
162 gears and the the execution time and the energy consumed with each frequency
163 gear are measured. Then an heuristic or an exact method uses the retrieved
164 information to compute the values of the scaling factor for the processors.
165 In~\cite{29}, Xie et al. use an exact exponential breadth-first search algorithm
166 to compute the scaling factor values that give the optimal energy reduction
167 while respecting a deadline for a sequential program. They also present a
168 linear heuristic that approximates the optimal solution. In~\cite{8} , Rountree
169 et al. use a linear programming algorithm, while in~\cite{38,34}, Cochran et
170 al. use multi logistic regression algorithm for the same goal. The main
171 drawback for these methods is that they all require executing a part or the
172 whole program on all frequency gears for each new instance of the same program.
174 \subsection{Online scaling factor selection methods}
176 The online scaling factor selection methods are executed during the runtime of
177 the program. They are usually integrated into iterative programs where the same
178 block of instructions is executed many times. During the first few iterations,
179 many informations are measured such as the execution time, the energy consumed
180 using a multimeter, the slack times, \dots{} Then a method will exploit these
181 measurements to compute the scaling factor values for each processor. This
182 operation, measurements and computing new scaling factor, can be repeated as
183 much as needed if the iterations are not regular. Kimura, Peraza, Yu-Liang et
184 al.~\cite{11,2,31} used varied heuristics to select the appropriate scaling
185 factor values to eliminate the slack times during runtime. However, as seen
186 in~\cite{39,19}, machine learning methods can take a lot of time to converge
187 when the number of available gears is big. To reduce the impact of slack times,
188 in~\cite{1}, Lim et al. developed an algorithm that detects the communication
189 sections and changes the frequency during these sections only. This approach
190 might change the frequency of each processor many times per iteration if an
191 iteration contains more than one communication section. In~\cite{3}, Rauber and
192 Rünger used an analytical model that can predict the consumed energy and the
193 execution time for every frequency gear after measuring the consumed energy and
194 the execution time with the highest frequency gear. These predictions may be
195 used to choose the optimal gear for each processor executing the parallel
196 program to reduce energy consumption. To maintain the performance of the
197 parallel program , they set the processor with the biggest load to the highest
198 gear and then compute the scaling factor values for the rest of the processors.
199 Although this model was built for parallel architectures, it can be adapted to
200 distributed architectures by taking into account the communications. The
201 primary contribution of our paper is presenting a new online scaling factor
202 selection method which has the following characteristics:
204 \item It is based on Rauber and Rünger analytical model to predict the energy
205 consumption of the application with different frequency gears.
206 \item It selects the frequency scaling factor for simultaneously optimizing
207 energy reduction and maintaining performance.
208 \item It is well adapted to distributed architectures because it takes into
209 account the communication time.
210 \item It is well adapted to distributed applications with imbalanced tasks.
211 \item It has very small footprint when compared to other methods
212 (e.g.,~\cite{19}) and does not require profiling or training as
217 \section{Execution and energy of parallel tasks on homogeneous platform}
220 % \JC{The whole subsection ``Parallel Tasks Execution on Homogeneous Platform'',
221 % can be deleted if we need space, we can just say we are interested in this
222 % paper in homogeneous clusters}
224 \subsection{Parallel tasks execution on homogeneous platform}
226 A homogeneous cluster consists of identical nodes in terms of hardware and
227 software. Each node has its own memory and at least one processor which can be
228 a multi-core. The nodes are connected via a high bandwidth network. Tasks
229 executed on this model can be either synchronous or asynchronous. In this paper
230 we consider execution of the synchronous tasks on distributed homogeneous
231 platform. These tasks can exchange the data via synchronous message passing.
234 \subfloat[Sync. imbalanced communications]{%
235 \includegraphics[scale=0.67]{fig/commtasks}\label{fig:h1}}
236 \subfloat[Sync. imbalanced computations]{%
237 \includegraphics[scale=0.67]{fig/compt}\label{fig:h2}}
238 \caption{Parallel tasks on homogeneous platform}
241 Therefore, the execution time of a task consists of the computation time and the
242 communication time. Moreover, the synchronous communications between tasks can
243 lead to slack times while tasks wait at the synchronization barrier for other
244 tasks to finish their tasks (see figure~(\ref{fig:h1})). The imbalanced
245 communications happen when nodes have to send/receive different amount of data
246 or they communicate with different number of nodes. Another source of slack
247 times is the imbalanced computations. This happens when processing different
248 amounts of data on each processor (see figure~(\ref{fig:h2})). In this case the
249 fastest tasks have to wait at the synchronization barrier for the slowest ones
250 to begin the next task. In both cases the overall execution time of the program
251 is the execution time of the slowest task as in EQ~(\ref{eq:T1}).
254 \textit{Program Time} = \max_{i=1,2,\dots,N} T_i
256 where $T_i$ is the execution time of task $i$ and all the tasks are executed
257 concurrently on different processors.
259 \subsection{Energy model for homogeneous platform}
261 Many researchers~\cite{9,3,15,26} divide the power consumed by a processor to
262 two power metrics: the static and the dynamic power. While the first one is
263 consumed as long as the computing unit is on, the latter is only consumed during
264 computation times. The dynamic power $P_{dyn}$ is related to the switching
265 activity $\alpha$, load capacitance $C_L$, the supply voltage $V$ and
266 operational frequency $f$, as shown in EQ~(\ref{eq:pd}).
269 P_\textit{dyn} = \alpha \cdot C_L \cdot V^2 \cdot f
271 The static power $P_{static}$ captures the leakage power as follows:
274 P_\textit{static} = V \cdot N_{trans} \cdot K_{design} \cdot I_{leak}
276 where V is the supply voltage, $N_{trans}$ is the number of transistors,
277 $K_{design}$ is a design dependent parameter and $I_{leak}$ is a
278 technology-dependent parameter. The energy consumed by an individual processor
279 to execute a given program can be computed as:
282 E_\textit{ind} = P_\textit{dyn} \cdot T_{Comp} + P_\textit{static} \cdot T
284 where $T$ is the execution time of the program, $T_{Comp}$ is the computation
285 time and $T_{Comp} \leq T$. $T_{Comp}$ may be equal to $T$ if there is no
286 communications, no slack times and no synchronizations.
288 DVFS is a process that is allowed in modern processors to reduce the dynamic
289 power by scaling down the voltage and frequency. Its main objective is to
290 reduce the overall energy consumption~\cite{37}. The operational frequency $f$
291 depends linearly on the supply voltage $V$, i.e., $V = \beta \cdot f$ with some
292 constant $\beta$. This equation is used to study the change of the dynamic
293 voltage with respect to various frequency values in~\cite{3}. The reduction
294 process of the frequency can be expressed by the scaling factor $S$ which is the
295 ratio between the maximum and the new frequency as in EQ~(\ref{eq:s}).
298 S = \frac{F_\textit{max}}{F_\textit{new}}
300 The value of the scaling factor $S$ is greater than 1 when changing the
301 frequency of the CPU to any new frequency value~(\emph{P-state}) in the
302 governor. The CPU governor is an interface driver supplied by the operating
303 system's kernel to lower a core's frequency. This factor reduces quadratically
304 the dynamic power which may cause degradation in performance and thus, the
305 increase of the static energy because the execution time is increased~\cite{36}.
306 If the tasks are sorted according to their execution times before scaling in a
307 descending order, the total energy consumption model for a parallel homogeneous
308 platform, as presented by Rauber and Rünger~\cite{3}, can be written as a
309 function of the scaling factor $S$, as in EQ~(\ref{eq:energy}).
313 E = P_\textit{dyn} \cdot S_1^{-2} \cdot
314 \left( T_1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^2} \right) +
315 P_\textit{static} \cdot T_1 \cdot S_1 \cdot N
318 where $N$ is the number of parallel nodes, $T_i$ and $S_i$ for $i=1,\dots,N$ are
319 the execution times and scaling factors of the sorted tasks. Therefore, $T1$ is
320 the time of the slowest task, and $S_1$ its scaling factor which should be the
321 highest because they are proportional to the time values $T_i$. The scaling
322 factors are computed as in EQ~(\ref{eq:si}).
325 S_i = S \cdot \frac{T_1}{T_i}
326 = \frac{F_\textit{max}}{F_\textit{new}} \cdot \frac{T_1}{T_i}
328 In this paper we depend on Rauber and Rünger energy model EQ~(\ref{eq:energy})
329 for two reasons: (1) this model is used for any number of concurrent tasks, and
330 (2) we compare our algorithm with Rauber and Rünger scaling factor selection
331 method which is based on EQ~(\ref{eq:energy}). The optimal scaling factor is
332 computed by minimizing the derivation for this equation which produces
337 S_\textit{opt} = \sqrt[3]{\frac{2}{N} \cdot \frac{P_\textit{dyn}}{P_\textit{static}} \cdot
338 \left( 1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^3} \right) }
342 \section{Performance evaluation of MPI programs}
345 The performance (execution time) of parallel synchronous MPI applications depend
346 on the time of the slowest task as in figure~(\ref{fig:homo}). If there is no
347 communication and the application is not data bounded, the execution time of a
348 parallel program is linearly proportional to the operational frequency and any
349 DVFS operation for energy reduction increases the execution time of the parallel
350 program. Therefore, the scaling factor $S$ is linearly proportional to the
351 execution time. However, in most of MPI applications the processes exchange
352 data. During these communications the processors involved remain idle until the
353 communications are finished. For that reason any change in the frequency has no
354 impact on the time of communication~\cite{17}. The communication time for a
355 task is the summation of periods of time that begin with an MPI call for sending
356 or receiving a message till the message is synchronously sent or received. To
357 be able to predict the execution time of MPI program, the communication time and
358 the computation time for the slower task must be measured before scaling. These
359 times are used to predict the execution time for any MPI program as a function
360 of the new scaling factor as in EQ~(\ref{eq:tnew}).
363 \textit T_\textit{new} = T_\textit{Max Comp Old} \cdot S + T_{\textit{Max Comm Old}}
365 In this paper, this prediction method is used to select the best scaling factor
366 for each processor as presented in the next section.
368 \section{Performance to energy competition}
371 This section demonstrates our approach for choosing the optimal scaling factor.
372 This factor gives maximum energy reduction taking into account the execution
373 times for both computation and communication. The relation between the energy
374 and the performance is nonlinear and complex, because the relation of the energy
375 with scaling factor is nonlinear and with the performance it is linear
376 see~\cite{17}. Moreover, they are not measured using the same metric. For
377 solving this problem, we normalize the energy by calculating the ratio between
378 the consumed energy with scaled frequency and the consumed energy without scaled
382 E_\textit{Norm} = \frac{ E_\textit{Reduced}}{E_\textit{Original}} \\
383 {} = \frac{P_\textit{dyn} \cdot S_1^{-2} \cdot
384 \left( T_1 + \sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
385 P_\textit{static} \cdot T_1 \cdot S_1 \cdot N }{
386 P_\textit{dyn} \cdot \left(T_1+\sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
387 P_\textit{static} \cdot T_1 \cdot N }
389 By the same way we can normalize the performance as follows:
392 P_\textit{Norm} = \frac{T_\textit{New}}{T_\textit{Old}}
393 = \frac{T_\textit{Max Comp Old} \cdot S +
394 T_\textit{Max Comm Old}}{T_\textit{Max Comp Old} +
395 T_\textit{Max Comm Old}}
397 The second problem is that the optimization operation for both energy and
398 performance is not in the same direction. In other words, the normalized energy
399 and the performance curves are not in the same direction see
400 figure~(\ref{fig:r2}). While the main goal is to optimize the energy and
401 performance in the same time. According to the equations~(\ref{eq:enorm})
402 and~(\ref{eq:pnorm}), the scaling factor $S$ reduce both the energy and the
403 performance simultaneously. But the main objective is to produce maximum energy
404 reduction with minimum performance reduction. Many researchers used different
405 strategies to solve this nonlinear problem for example see~\cite{19,42}, their
406 methods add big overhead to the algorithm for selecting the suitable frequency.
407 In this paper we present a method to find the optimal scaling factor $S$ for
408 optimizing both energy and performance simultaneously without adding big
409 overheads. Our solution for this problem is to make the optimization process
410 have the same direction. Therefore, we inverse the equation of normalize
411 performance as follows:
414 P^{-1}_\textit{Norm} = \frac{ T_\textit{Old}}{ T_\textit{New}}
415 = \frac{T_\textit{Max Comp Old} +
416 T_\textit{Max Comm Old}}{T_\textit{Max Comp Old} \cdot S +
417 T_\textit{Max Comm Old}}
421 \subfloat[Converted relation.]{%
422 \includegraphics[width=.4\textwidth]{fig/file}\label{fig:r1}}%
424 \subfloat[Real relation.]{%
425 \includegraphics[width=.4\textwidth]{fig/file3}\label{fig:r2}}
427 \caption{The energy and performance relation}
429 Then, we can modelize our objective function as finding the maximum distance
430 between the energy curve EQ~(\ref{eq:enorm}) and the inverse of performance
431 curve EQ~(\ref{eq:pnorm_en}) over all available scaling factors. This
432 represents the minimum energy consumption with minimum execution time (better
433 performance) at the same time, see figure~(\ref{fig:r1}). Then our objective
434 function has the following form:
437 Max Dist = \max_{j=1,2,\dots,F}
438 (\overbrace{P^{-1}_\textit{Norm}(S_j)}^{\text{Maximize}} -
439 \overbrace{E_\textit{Norm}(S_j)}^{\text{Minimize}} )
441 where $F$ is the number of available frequencies. Then we can select the optimal
442 scaling factor that satisfies EQ~(\ref{eq:max}). Our objective function can
443 work with any energy model or static power values stored in a data file.
444 Moreover, this function works in optimal way when the energy curve has a convex
445 form over the available frequency scaling factors as shown in~\cite{15,3,19}.
447 \section{Optimal scaling factor for performance and energy}
450 Algorithm~\ref{EPSA} computes the optimal scaling factor according to the
451 objective function described above.
452 \begin{algorithm}[tp]
453 \caption{Scaling factor selection algorithm}
455 \begin{algorithmic}[1]
456 \State Initialize the variable $Dist=0$
457 \State Set dynamic and static power values.
458 \State Set $P_{states}$ to the number of available frequencies.
459 \State Set the variable $F_{new}$ to max. frequency, $F_{new} = F_{max} $
460 \State Set the variable $F_{diff}$ to the difference between two successive
462 \For {$j:=1$ to $P_{states} $}
463 \State $F_{new}=F_{new} - F_{diff} $
464 \State $S = \frac{F_\textit{max}}{F_\textit{new}}$
465 \State $S_i = S \cdot \frac{T_1}{T_i}
466 = \frac{F_\textit{max}}{F_\textit{new}} \cdot \frac{T_1}{T_i}$
468 \State $E_\textit{Norm} =
469 \frac{P_\textit{dyn} \cdot S_1^{-2} \cdot
470 \left( T_1 + \sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
471 P_\textit{static} \cdot T_1 \cdot S_1 \cdot N }{
473 \left(T_1+\sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
474 P_\textit{static} \cdot T_1 \cdot N }$
475 \State $P_{NormInv}=T_{old}/T_{new}$
476 \If{$(P_{NormInv}-E_{Norm} > Dist)$}
478 \State $Dist = P_{NormInv} - E_{Norm}$
481 \State Return $S_{opt}$
485 The proposed algorithm works online during the execution time of the MPI
486 program. It selects the optimal scaling factor after gathering the computation
487 and communication times from the program after one iteration. Then the program
488 changes the new frequencies of the CPUs according to the computed scaling
489 factors. This algorithm has a small execution time: for a homogeneous cluster
490 composed of nodes having the characteristics presented in
491 table~\ref{table:platform}, it takes \np[ms]{0.00152} on average for 4 nodes and
492 \np[ms]{0.00665} on average for 32 nodes. The algorithm complexity is $O(F\cdot
493 N)$, where $F$ is the number of available frequencies and $N$ is the number of
494 computing nodes. The algorithm is called just once during the execution of the
495 program. The DVFS algorithm~(\ref{dvfs}) shows where and when the algorithm is
496 called in the MPI program.
498 \caption{Platform file parameters}
501 \begin{tabular}{|*{7}{l|}}
503 Max & Min & Backbone & Backbone & Link & Link & Sharing \\
504 Freq. & Freq. & Bandwidth & Latency & Bandwidth & Latency & Policy \\
506 \np{2.5} & \np{800} & \np[GBps]{2.25} & \np[$\mu$s]{0.5} & \np[GBps]{1} & \np[$\mu$s]{50} & Full \\
507 GHz & MHz & & & & & Duplex \\
510 \label{table:platform}
513 \begin{algorithm}[tp]
516 \begin{algorithmic}[1]
517 \For {$k:=1$ to \textit{some iterations}}
518 \State Computations section.
519 \State Communications section.
521 \State Gather all times of computation and\newline\hspace*{3em}%
522 communication from each node.
523 \State Call algorithm~\ref{EPSA} with these times.
524 \State Compute the new frequency from the\newline\hspace*{3em}%
525 returned optimal scaling factor.
526 \State Set the new frequency to the CPU.
531 After obtaining the optimal scaling factor, the program calculates the new
532 frequency $F_i$ for each task proportionally to its time value $T_i$. By
533 substitution of EQ~(\ref{eq:s}) in EQ~(\ref{eq:si}), we can calculate the new
534 frequency $F_i$ as follows:
537 F_i = \frac{F_\textit{max} \cdot T_i}{S_\textit{optimal} \cdot T_\textit{max}}
539 According to this equation all the nodes may have the same frequency value if
540 they have balanced workloads, otherwise, they take different frequencies when
541 having imbalanced workloads. Thus, EQ~(\ref{eq:fi}) adapts the frequency of the
542 CPU to the nodes' workloads to maintain performance.
544 \section{Experimental results}
546 Our experiments are executed on the simulator SimGrid/SMPI v3.10. We configure
547 the simulator to use a homogeneous cluster with one core per node. The detailed
548 characteristics of our platform file are shown in the
549 table~(\ref{table:platform}). Each node in the cluster has 18 frequency values
550 from \np[GHz]{2.5} to \np[MHz]{800} with \np[MHz]{100} difference between each
551 two successive frequencies. The simulated network link is \np[GB]{1} Ethernet
552 (TCP/IP). The backbone of the cluster simulates a high performance switch.
554 \subsection{Performance prediction verification}
556 In this section we evaluate the precision of our performance prediction method
557 based on EQ~(\ref{eq:tnew}) by applying it the NAS benchmarks. The NAS programs
558 are executed with the class B option for comparing the real execution time with
559 the predicted execution time. Each program runs offline with all available
560 scaling factors on 8 or 9 nodes (depending on the benchmark) to produce real
561 execution time values. These scaling factors are computed by dividing the
562 maximum frequency by the new one see EQ~(\ref{eq:s}).
565 \includegraphics[width=.328\textwidth]{fig/cg_per}\hfill%
566 \includegraphics[width=.328\textwidth]{fig/mg_pre}\hfill%
567 % \includegraphics[width=.4\textwidth]{fig/bt_pre}\qquad%
568 \includegraphics[width=.328\textwidth]{fig/lu_pre}\hfill%
569 \caption{Comparing predicted to real execution time}
572 %see Figure~\ref{fig:pred}
573 In our cluster there are 18 available frequency states for each processor. This
574 leads to 18 run states for each program. We use seven MPI programs of the NAS
575 parallel benchmarks: CG, MG, EP, FT, BT, LU and SP. Figure~(\ref{fig:pred})
576 presents plots of the real execution times and the simulated ones. The maximum
577 normalized error between these two execution times varies between \np{0.0073} to
578 \np{0.031} dependent on the executed benchmark. The smallest prediction error
579 was for CG and the worst one was for LU.
581 \subsection{The experimental results for the scaling algorithm }
583 The proposed algorithm was applied to seven MPI programs of the NAS benchmarks
584 (EP, CG, MG, FT, BT, LU and SP) which were run with three classes (A, B and C).
585 For each instance the benchmarks were executed on a number of processors
586 proportional to the size of the class. Each class represents the problem size
587 ascending from the class A to C. Additionally, depending on some speed up
588 points for each class we run the classes A, B and C on 4, 8 or 9 and 16 nodes
589 respectively. Depending on EQ~(\ref{eq:energy}), we measure the energy
590 consumption for all the NAS MPI programs while assuming the power dynamic with
591 the highest frequency is equal to \np[W]{20} and the power static is equal to
592 \np[W]{4} for all experiments. These power values were also used by Rauber and
593 Rünger in~\cite{3}. The results showed that the algorithm selected different
594 scaling factors for each program depending on the communication features of the
595 program as in the plots~(\ref{fig:nas}). These plots illustrate that there are
596 different distances between the normalized energy and the normalized inverted
597 performance curves, because there are different communication features for each
598 benchmark. When there are little or not communications, the inverted
599 performance curve is very close to the energy curve. Then the distance between
600 the two curves is very small. This leads to small energy savings. The opposite
601 happens when there are a lot of communication, the distance between the two
602 curves is big. This leads to more energy savings (e.g. CG and FT), see
603 table~(\ref{table:factors results}). All discovered frequency scaling factors
604 optimize both the energy and the performance simultaneously for all NAS
605 benchmarks. In table~(\ref{table:factors results}), we record all optimal
606 scaling factors results for each benchmark running class C. These scaling
607 factors give the maximum energy saving percent and the minimum performance
608 degradation percent at the same time from all available scaling factors.
611 \includegraphics[width=.328\textwidth]{fig/ep}\hfill%
612 \includegraphics[width=.328\textwidth]{fig/cg}\hfill%
613 \includegraphics[width=.328\textwidth]{fig/sp}
614 \includegraphics[width=.328\textwidth]{fig/lu}\hfill%
615 \includegraphics[width=.328\textwidth]{fig/bt}\hfill%
616 \includegraphics[width=.328\textwidth]{fig/ft}
617 \caption{Optimal scaling factors for the predicted energy and performance of NAS benchmarks}
621 \caption{The scaling factors results}
624 \begin{tabular}{|l|*{4}{r|}}
626 Program & Optimal & Energy & Performance & Energy-Perf. \\
627 Name & Scaling Factor & Saving \% & Degradation \% & Distance \\
629 CG & 1.56 & 39.23 & 14.88 & 24.35 \\
631 MG & 1.47 & 34.97 & 21.70 & 13.27 \\
633 EP & 1.04 & 22.14 & 20.73 & 1.41 \\
635 LU & 1.38 & 35.83 & 22.49 & 13.34 \\
637 BT & 1.31 & 29.60 & 21.28 & 8.32 \\
639 SP & 1.38 & 33.48 & 21.36 & 12.12 \\
641 FT & 1.47 & 34.72 & 19.00 & 15.72 \\
644 \label{table:factors results}
645 % is used to refer this table in the text
647 As shown in the table~(\ref{table:factors results}), when the optimal scaling
648 factor has big value we can gain more energy savings for example as in CG and
649 FT. The opposite happens when the optimal scaling factor is small value as
650 example BT and EP. Our algorithm selects big scaling factor value when the
651 communication and the other slacks times are big and smaller ones in opposite
652 cases. In EP there are no communications inside the iterations. This make our
653 algorithm to selects smaller scaling factor values (inducing smaller energy
656 \subsection{Results comparison}
658 In this section, we compare our scaling factor selection method with Rauber and
659 Rünger methods~\cite{3}. They had two scenarios, the first is to reduce energy
660 to the optimal level without considering the performance as in
661 EQ~(\ref{eq:sopt}). We refer to this scenario as $R_{E}$. The second scenario
662 is similar to the first except setting the slower task to the maximum frequency
663 (when the scale $S=1$) to keep the performance from degradation as mush as
664 possible. We refer to this scenario as $R_{E-P}$. While we refer to our
665 algorithm as EPSA (Energy to Performance Scaling Algorithm). The comparison is
666 made in tables \ref{table:compareA}, \ref{table:compareB},
667 and~\ref{table:compareC}. These tables show the results of our method and
668 Rauber and Rünger scenarios for all the NAS benchmarks programs for classes A, B
671 \caption{Comparing results for the NAS class A}
674 \begin{tabular}{|l|l|*{4}{r|}}
676 Method & Program & Factor & Energy & Performance & Energy-Perf. \\
677 Name & Name & Value & Saving \% & Degradation \% & Distance \\
679 % \rowcolor[gray]{0.85}
680 $EPSA$ & CG & 1.56 & 37.02 & 13.88 & 23.14 \\ \hline
681 $R_{E-P}$ & CG & 2.14 & 42.77 & 25.27 & 17.50 \\ \hline
682 $R_{E}$ & CG & 2.14 & 42.77 & 26.46 & 16.31 \\ \hline
684 $EPSA$ & MG & 1.47 & 27.66 & 16.82 & 10.84 \\ \hline
685 $R_{E-P}$ & MG & 2.14 & 34.45 & 31.84 & 2.61 \\ \hline
686 $R_{E}$ & MG & 2.14 & 34.48 & 33.65 & 0.80 \\ \hline
688 $EPSA$ & EP & 1.19 & 25.32 & 20.79 & 4.53 \\ \hline
689 $R_{E-P}$ & EP & 2.05 & 41.45 & 55.67 & -14.22 \\ \hline
690 $R_{E}$ & EP & 2.05 & 42.09 & 57.59 & -15.50 \\ \hline
692 $EPSA$ & LU & 1.56 & 39.55 & 19.38 & 20.17 \\ \hline
693 $R_{E-P}$ & LU & 2.14 & 45.62 & 27.00 & 18.62 \\ \hline
694 $R_{E}$ & LU & 2.14 & 45.66 & 33.01 & 12.65 \\ \hline
696 $EPSA$ & BT & 1.31 & 29.60 & 20.53 & 9.07 \\ \hline
697 $R_{E-P}$ & BT & 2.10 & 45.53 & 49.63 & -4.10 \\ \hline
698 $R_{E}$ & BT & 2.10 & 43.93 & 52.86 & -8.93 \\ \hline
700 $EPSA$ & SP & 1.38 & 33.51 & 15.65 & 17.86 \\ \hline
701 $R_{E-P}$ & SP & 2.11 & 45.62 & 42.52 & 3.10 \\ \hline
702 $R_{E}$ & SP & 2.11 & 45.78 & 43.09 & 2.69 \\ \hline
704 $EPSA$ & FT & 1.25 & 25.00 & 10.80 & 14.20 \\ \hline
705 $R_{E-P}$ & FT & 2.10 & 39.29 & 34.30 & 4.99 \\ \hline
706 $R_{E}$ & FT & 2.10 & 37.56 & 38.21 & -0.65 \\ \hline
708 \label{table:compareA}
709 % is used to refer this table in the text
712 \caption{Comparing results for the NAS class B}
715 \begin{tabular}{|l|l|*{4}{r|}}
717 Method & Program & Factor & Energy & Performance & Energy-Perf. \\
718 Name & Name & Value & Saving \% & Degradation \% & Distance \\
720 % \rowcolor[gray]{0.85}
721 $EPSA$ & CG & 1.66 & 39.23 & 16.63 & 22.60 \\ \hline
722 $R_{E-P}$ & CG & 2.15 & 45.34 & 27.60 & 17.74 \\ \hline
723 $R_{E}$ & CG & 2.15 & 45.34 & 28.88 & 16.46 \\ \hline
725 $EPSA$ & MG & 1.47 & 34.98 & 18.35 & 16.63 \\ \hline
726 $R_{E-P}$ & MG & 2.14 & 43.55 & 36.42 & 7.13 \\ \hline
727 $R_{E}$ & MG & 2.14 & 43.56 & 37.07 & 6.49 \\ \hline
729 $EPSA$ & EP & 1.08 & 20.29 & 17.15 & 3.14 \\ \hline
730 $R_{E-P}$ & EP & 2.00 & 42.38 & 56.88 & -14.50 \\ \hline
731 $R_{E}$ & EP & 2.00 & 39.73 & 59.94 & -20.21 \\ \hline
733 $EPSA$ & LU & 1.47 & 38.57 & 21.34 & 17.23 \\ \hline
734 $R_{E-P}$ & LU & 2.10 & 43.62 & 36.51 & 7.11 \\ \hline
735 $R_{E}$ & LU & 2.10 & 43.61 & 38.54 & 5.07 \\ \hline
737 $EPSA$ & BT & 1.31 & 29.59 & 20.88 & 8.71 \\ \hline
738 $R_{E-P}$ & BT & 2.10 & 44.53 & 53.05 & -8.52 \\ \hline
739 $R_{E}$ & BT & 2.10 & 42.93 & 52.80 & -9.87 \\ \hline
741 $EPSA$ & SP & 1.38 & 33.44 & 19.24 & 14.20 \\ \hline
742 $R_{E-P}$ & SP & 2.15 & 45.69 & 43.20 & 2.49 \\ \hline
743 $R_{E}$ & SP & 2.15 & 45.41 & 44.47 & 0.94 \\ \hline
745 $EPSA$ & FT & 1.38 & 34.40 & 14.57 & 19.83 \\ \hline
746 $R_{E-P}$ & FT & 2.13 & 42.98 & 37.35 & 5.63 \\ \hline
747 $R_{E}$ & FT & 2.13 & 43.04 & 37.90 & 5.14 \\ \hline
749 \label{table:compareB}
750 % is used to refer this table in the text
754 \caption{Comparing results for the NAS class C}
757 \begin{tabular}{|l|l|*{4}{r|}}
759 Method & Program & Factor & Energy & Performance & Energy-Perf. \\
760 Name & Name & Value & Saving \% & Degradation \% & Distance \\
762 % \rowcolor[gray]{0.85}
763 $EPSA$ & CG & 1.56 & 39.23 & 14.88 & 24.35 \\ \hline
764 $R_{E-P}$ & CG & 2.15 & 45.36 & 25.89 & 19.47 \\ \hline
765 $R_{E}$ & CG & 2.15 & 45.36 & 26.70 & 18.66 \\ \hline
767 $EPSA$ & MG & 1.47 & 34.97 & 21.69 & 13.27 \\ \hline
768 $R_{E-P}$ & MG & 2.15 & 43.65 & 40.45 & 3.20 \\ \hline
769 $R_{E}$ & MG & 2.15 & 43.64 & 41.38 & 2.26 \\ \hline
771 $EPSA$ & EP & 1.04 & 22.14 & 20.73 & 1.41 \\ \hline
772 $R_{E-P}$ & EP & 1.92 & 39.40 & 56.33 & -16.93 \\ \hline
773 $R_{E}$ & EP & 1.92 & 38.10 & 56.35 & -18.25 \\ \hline
775 $EPSA$ & LU & 1.38 & 35.83 & 22.49 & 13.34 \\ \hline
776 $R_{E-P}$ & LU & 2.15 & 44.97 & 41.00 & 3.97 \\ \hline
777 $R_{E}$ & LU & 2.15 & 44.97 & 41.80 & 3.17 \\ \hline
779 $EPSA$ & BT & 1.31 & 29.60 & 21.28 & 8.32 \\ \hline
780 $R_{E-P}$ & BT & 2.13 & 45.60 & 49.84 & -4.24 \\ \hline
781 $R_{E}$ & BT & 2.13 & 44.90 & 55.16 & -10.26 \\ \hline
783 $EPSA$ & SP & 1.38 & 33.48 & 21.35 & 12.12 \\ \hline
784 $R_{E-P}$ & SP & 2.10 & 45.69 & 43.60 & 2.09 \\ \hline
785 $R_{E}$ & SP & 2.10 & 45.75 & 44.10 & 1.65 \\ \hline
787 $EPSA$ & FT & 1.47 & 34.72 & 19.00 & 15.72 \\ \hline
788 $R_{E-P}$ & FT & 2.04 & 39.40 & 37.10 & 2.30 \\ \hline
789 $R_{E}$ & FT & 2.04 & 39.35 & 37.70 & 1.65 \\ \hline
791 \label{table:compareC}
792 % is used to refer this table in the text
794 As shown in tables~\ref{table:compareA},~\ref{table:compareB}
795 and~\ref{table:compareC}, the ($R_{E-P}$) method outperforms the ($R_{E}$)
796 method in terms of performance and energy reduction. The ($R_{E-P}$) method
797 also gives better energy savings than our method. However, although our scaling
798 factor is not optimal for energy reduction, the results in these tables prove
799 that our algorithm returns the best scaling factor that satisfy our objective
800 method: the largest distance between energy reduction and performance
801 degradation. Negative values in the energy-performance column mean that one of
802 the two objectives (energy or performance) have been degraded more than the
803 other. The positive trade-offs with the highest values lead to maximum energy
804 savings while keeping the performance degradation as low as possible. Our
805 algorithm always gives the highest positive energy to performance trade-offs
806 while Rauber and Rünger method ($R_{E-P}$) gives in some time negative
807 trade-offs such as in BT and EP.
810 % \includegraphics[width=.328\textwidth]{fig/compare_class_A}
811 % \includegraphics[width=.328\textwidth]{fig/compare_class_B}
812 % \includegraphics[width=.328\textwidth]{fig/compare_class_C}
813 % \caption{Comparing our method to Rauber and Rünger methods}
814 % \label{fig:compare}
820 In this paper, we have presented a new online scaling factor selection method
821 that optimizes simultaneously the energy and performance of a distributed
822 application running on an homogeneous cluster. It uses the computation and
823 communication times measured at the first iteration to predict energy
824 consumption and the performance of the parallel application at every available
825 frequency. Then, it selects the scaling factor that gives the best trade-off
826 between energy reduction and performance which is the maximum distance between
827 the energy and the inverted performance curves. To evaluate this method, we
828 have applied it to the NAS benchmarks and it was compared to Rauber and Rünger
829 methods while being executed on the simulator SimGrid. The results showed that
830 our method, outperforms Rauber and Rünger methods in terms of energy-performance
833 In the near future, we would like to adapt this scaling factor selection method
834 to heterogeneous platforms where each node has different characteristics. In
835 particular, each CPU has different available frequencies, energy consumption and
836 performance. It would be also interesting to develop a new energy model for
837 asynchronous parallel iterative methods where the number of iterations is not
838 known in advance and depends on the global convergence of the iterative system.
840 \section*{Acknowledgment}
842 This work has been partially supported by the Labex ACTION project (contract
843 ``ANR-11-LABX-01-01''). Computations have been performed on the supercomputer
844 facilities of the Mésocentre de calcul de Franche-Comté. As a PhD student,
845 Mr. Ahmed Fanfakh, would like to thank the University of Babylon (Iraq) for
848 % trigger a \newpage just before the given reference
849 % number - used to balance the columns on the last page
850 % adjust value as needed - may need to be readjusted if
851 % the document is modified later
852 %\IEEEtriggeratref{15}
854 \bibliographystyle{IEEEtran}
855 \bibliography{IEEEabrv,my_reference}
862 %%% ispell-local-dictionary: "american"
865 % LocalWords: Fanfakh Charr FIXME Tianhe DVFS HPC NAS NPB SMPI Rauber's Rauber
866 % LocalWords: CMOS EQ EPSA Franche Comté Tflop Rünger IUT Maréchal Juin cedex