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}
12 % \usepackage{sectsty}
13 % \usepackage{titlesec}
15 %\usepackage[font={footnotesize,bt}]{caption}
16 %\usepackage[font=scriptsize,labelfont=bf]{caption}
18 \usepackage[textsize=footnotesize]{todonotes}
19 \newcommand{\AG}[2][inline]{\todo[color=green!50,#1]{\sffamily\textbf{AG:} #2}\xspace}
23 \title{Optimal Dynamic Frequency Scaling for Energy-Performance of Parallel MPI Programs}
34 University of Franche-Comté
40 \AG{``Optimal'' is a bit pretentious in the title.\\
41 Complete affiliation, add an email address, etc.}
44 The important technique for energy reduction of parallel systems is CPU frequency
45 scaling. This operation used by many researchers to reduce energy consumption in many
46 ways. Frequency scaling operation also has big impact on the performance. In some cases,
47 the performance degradation ratio is bigger than energy saving ratio when the frequency scaled
48 to down level. Therefore, the trade offs between the energy and performance becomes more
49 important topic when using this technique. In this paper we developed an algorithm that
50 select the frequency scaling factor for both energy and performance simultaneously.
51 This algorithm takes into account the communication times when selecting the frequency scaling
52 factor. It is works online without training or profiling to have very small overhead.
53 The algorithm has better energy-performance trade offs compared to other methods.
56 \section{Introduction}
59 The need for computing power is still increasing and it is not expected to slow
60 down in the coming years. To satisfy this demand, researchers and supercomputers
61 constructors have been regularly increasing the number of computing cores in
62 supercomputers (for example in November 2013, according to the TOP500
63 list~\cite{43}, the Tianhe-2 was the fastest supercomputer. It has more than 3
64 millions of cores and delivers more than 33 Tflop/s while consuming 17808
65 kW). This large increase in number of computing cores has led to large energy
66 consumption by these architectures. Moreover, the price of energy is expected to
67 continue its ascent according to the demand. For all these reasons energy
68 reduction became an important topic in the high performance computing field. To
69 tackle this problem, many researchers used DVFS (Dynamic Voltage Frequency
70 Scaling) operations which reduce dynamically the frequency and voltage of cores
71 and thus their energy consumption. However, this operation also degrades the
72 performance of computation. Therefore researchers try to reduce the frequency to
73 minimum when processors are idle (waiting for data from other processors or
74 communicating with other processors). Moreover, depending on their objectives
75 they use heuristics to find the best scaling factor during the computation. If
76 they aim for performance they choose the best scaling factor that reduces the
77 consumed energy while affecting as little as possible the performance. On the
78 other hand, if they aim for energy reduction, the chosen scaling factor must
79 produce the most energy efficient execution without considering the degradation
80 of the performance. It is important to notice that lowering the frequency to
81 minimum value does not always give the most efficient execution due to energy
82 leakage. The best scaling factor might be chosen during execution (online) or
83 during a pre-execution phase. In this paper we emphasize to develop an
84 algorithm that selects a frequency scaling factor that simultaneously takes into
85 consideration the energy consumption and the performance. The
86 main objective of HPC systems is to run the application with less execution
87 time. Therefore, our algorithm selects the scaling factor online with
88 very small footprint. The proposed algorithm takes into account the
89 communication times of the MPI program to choose the scaling factor. This
90 algorithm has ability to predict both energy consumption and execution time over
91 all available scaling factors. The prediction achieved depends on some
92 computing time information, gathered at the beginning of the runtime. We apply
93 this algorithm to seven MPI benchmarks. These MPI programs are the NAS parallel
94 benchmarks (NPB v3.3) developed by NASA~\cite{44}. Our experiments are executed
95 using the simulator SimGrid/SMPI v3.10~\cite{Casanova:2008:SGF:1397760.1398183}
96 over an homogeneous distributed memory architecture. Furthermore, we compare the
97 proposed algorithm with Rauber and R\"{u}nger methods~\cite{3}.
98 The comparison's results show that our
99 algorithm gives better energy-time trade off.
101 This paper is organized as follows: Section~\ref{sec.relwork} presents the works from other authors.
102 Section~\ref{sec.ptasks} shows the execution of parallel tasks and sources of idle times. Section~\ref{sec.energy} resumes the
103 energy model of homogenous platform. Section~\ref{sec.mpip} evaluates the performance of MPI program.
104 Section~\ref{sec.verif} verifies the performance prediction model. Section~\ref{sec.compet} presents
105 the energy-performance trade offs objective function. Section~\ref{sec.optim} demonstrates the proposed
106 energy-performance algorithm. Section~\ref{sec.expe} presents the results of our experiments.
107 Section~\ref{sec.compare} shows the comparison results. Finally, we conclude in Section~\ref{sec.concl}.
109 \section{Related Works}
112 \AG{Consider introducing the models (sec.~\ref{sec.ptasks},
113 maybe~\ref{sec.energy}) before related works}
115 In the this section some heuristics to compute the scaling factor are
116 presented and classified in two parts: offline and online methods.
118 \subsection{The offline DVFS orientations}
120 The DVFS offline methods are static and are not executed during the runtime of
121 the program. Some approaches used heuristics to select the best DVFS state
122 during the compilation phases as for example in Azevedo et al.~\cite{40}. They use
123 dynamic voltage scaling (DVS) algorithm to choose the DVS setting when there are dependency points
124 between tasks. While in~\cite{29}, Xie et al. used breadth-first search
125 algorithm to do that. Their goal is to save energy with time limits. Another
126 approach gathers and stores the runtime information for each DVFS state, then
127 selects the suitable DVFS offline to optimize energy-time
128 trade offs. As an example Rountree et al.~\cite{8}, use liner programming
129 algorithm, while in~\cite{38,34}, Cochran et al. use multi logistic regression
130 algorithm for the same goal. The offline study that shows the DVFS impact on the
131 communication time of the MPI program is~\cite{17}, where Freeh et al. show that these
132 times do not change when the frequency is scaled down.
134 \subsection{The online DVFS orientations}
136 The objective of online DVFS orientations works is to dynamically compute and set the frequency of
137 the CPU during the runtime of the program for saving energy. Estimating and
138 predicting approaches for the energy-time trade offs are developed by Kimura, Peraza, Yu-Liang et al.
139 ~\cite{11,2,31}. These works select the best DVFS setting depending on the slack
140 times. These times happen when the processors have to wait for data from other
141 processors to compute their task. For example, during the synchronous
142 communications that take place in MPI programs, some processors are
143 idle. The optimal DVFS can be selected using learning methods. Therefore, in Dhiman, Hao Shen et al.
144 ~\cite{39,19} used machine learning to converge to the suitable DVFS
145 configuration. Their learning algorithms take big time to converge when the
146 number of available frequencies is high. Also, the communication sections of the MPI
147 program can be used to save energy. In~\cite{1}, Lim et al. developed an
148 algorithm that detects the communication sections and changes the frequency
149 during these sections only. This approach changes the frequency many times
150 because an iteration may contain more than one communication section. The domain
151 of analytical modeling used for choosing the optimal frequency as inRauber and R\"{u}nger~\cite{3}. they
152 developed an analytical mathematical model to determine the
153 optimal frequency scaling factor for any number of concurrent tasks. They set the slowest task to maximum frequency for maintaining performance. In this paper we compare our algorithm with
154 Rauber and R\"{u}nger model~\cite{3}, because their model can be used for any number of
155 concurrent tasks for homogeneous platforms. The primary contributions of this paper are:
157 \item Selecting the frequency scaling factor for simultaneously optimizing energy and performance,
158 while taking into account the communication time.
159 \item Adapting our scaling factor to take into account the imbalanced tasks.
160 \item The execution time of our algorithm is very small when compared to other
161 methods (e.g.,~\cite{19}).
162 \item The proposed algorithm works online without profiling or training as
166 \section{Parallel Tasks Execution on Homogeneous Platform}
169 A homogeneous cluster consists of identical nodes in terms of hardware and software.
170 Each node has its own memory and at least one processor which can
171 be a multi-core. The nodes are connected via a high bandwidth network. Tasks
172 executed on this model can be either synchronous or asynchronous. In this paper
173 we consider execution of the synchronous tasks on distributed homogeneous
174 platform. These tasks can exchange the data via synchronous message passing.
177 \subfloat[Sync. Imbalanced Communications]{\includegraphics[scale=0.67]{commtasks}\label{fig:h1}}
178 \subfloat[Sync. Imbalanced Computations]{\includegraphics[scale=0.67]{compt}\label{fig:h2}}
179 \caption{Parallel Tasks on Homogeneous Platform}
182 Therefore, the execution time of a task consists of the computation time and the
183 communication time. Moreover, the synchronous communications between tasks can
184 lead to idle time while tasks wait at the synchronization barrier for other tasks to
185 finish their communications (see figure~(\ref{fig:h1})). The imbalanced communications happen when nodes have to send/receive different amount of data or each node is communicates with different number of nodes. Another source for idle times is the imbalanced computations. This happen when processing different
186 amounts of data on each processor (see figure~(\ref{fig:h2})). In
187 this case the fastest tasks have to wait at the synchronization barrier for the
188 slowest tasks to finish their job. In both cases the overall execution time
189 of the program is the execution time of the slowest task as:
192 \textit{Program Time} = \max_{i=1,2,\dots,N} T_i
194 where $T_i$ is the execution time of task $i$.
196 \section{Energy Model for Homogeneous Platform}
199 The energy consumption by the processor consists of two power metrics: the
200 dynamic and the static power. This general power formulation is used by many
201 researchers~\cite{9,3,15,26}. The dynamic power of the CMOS processors
202 $P_{dyn}$ is related to the switching activity $\alpha$, load capacitance $C_L$,
203 the supply voltage $V$ and operational frequency $f$ respectively as follow:
206 P_\textit{dyn} = \alpha \cdot C_L \cdot V^2 \cdot f
208 The static power $P_{static}$ captures the leakage power consumption as well as
209 the power consumption of peripheral devices like the I/O subsystem.
212 P_\textit{static} = V \cdot N \cdot K_{design} \cdot I_{leak}
214 where V is the supply voltage, N is the number of transistors, $K_{design}$ is a
215 design dependent parameter and $I_{leak}$ is a technology-dependent
216 parameter. Energy consumed by an individual processor $E_{ind}$ is the summation
217 of the dynamic and the static power multiplied by the execution time for example
221 E_\textit{ind} = ( P_\textit{dyn} + P_\textit{static} ) \cdot T
223 The dynamic voltage and frequency scaling (DVFS) is a process that is allowed in
224 modern processors to reduce the dynamic power by scaling down the voltage and
225 frequency. Its main objective is to reduce the overall energy
226 consumption~\cite{37}. The operational frequency \emph f depends linearly on the
227 supply voltage $V$, i.e., $V = \beta \cdot f$ with some constant $\beta$. This
228 equation is used to study the change of the dynamic voltage with respect to
229 various frequency values in~\cite{3}. The reduction process of the frequency are
230 expressed by scaling factor \emph S. The scale \emph S is the ratio between the
231 maximum and the new frequency as in EQ~(\ref{eq:s}).
234 S = \frac{F_\textit{max}}{F_\textit{new}}
236 The value of the scale $S$ is greater than 1 when changing the frequency to
237 any new frequency value~(\emph {P-state}) in governor, the CPU governor is an interface
238 driver supplied by the operating system kernel (e.g. Linux) to lowering core's frequency.
239 The scaling factor is equal to 1 when the frequency set is to the maximum frequency.
240 The energy consumption model for parallel homogeneous platform depends on the scaling factor \emph S. This factor reduces quadratically the dynamic power. Also, this factor increases the
241 static energy linearly because the execution time is increased~\cite{36}. The
242 energy model depending on the frequency scaling factor for homogeneous platform
243 for any number of concurrent tasks was developed by Rauber and R\"{u}nger~\cite{3}. This model
244 considers the two power metrics for measuring the energy of the parallel tasks as
245 in EQ~(\ref{eq:energy}):
249 E = P_\textit{dyn} \cdot S_1^{-2} \cdot
250 \left( T_1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^2} \right) +
251 P_\textit{static} \cdot T_1 \cdot S_1 \cdot N
254 where \emph N is the number of parallel nodes, $T_1 $ is the time of the slowest
255 task, $T_i$ is the time of the task $i$ and $S_1$ is the maximum scaling factor
256 for the slower task. The scaling factor $S_1$, as in EQ~(\ref{eq:s1}), selects
257 from the set of scales values $S_i$. Each of these scales are proportional to
258 the time value $T_i$ depends on the new frequency value as in EQ~(\ref{eq:si}).
261 S_1 = \max_{i=1,2,\dots,F} S_i
265 S_i = S \cdot \frac{T_1}{T_i}
266 = \frac{F_\textit{max}}{F_\textit{new}} \cdot \frac{T_1}{T_i}
268 where $F$ is the number of available frequencies. In this paper we depend on
269 Rauber and R\"{u}nger energy model EQ~(\ref{eq:energy}) for two reasons: (1)-this model is used
270 for homogeneous platform that we work on in this paper. 2-we compare our
271 algorithm with Rauber and R\"{u}nger scaling model. Rauber and R\"{u}nger scaling factor that reduce
272 energy consumption derived from the EQ~(\ref{eq:energy}). They take the
273 derivation for this equation (to be minimized) and set it to zero to produce the
274 scaling factor as in EQ~(\ref{eq:sopt}).
277 S_\textit{opt} = \sqrt[3]{\frac{2}{n} \cdot \frac{P_\textit{dyn}}{P_\textit{static}} \cdot
278 \left( 1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^3} \right) }
281 \section{Performance Evaluation of MPI Programs}
284 The performance (execution time) of parallel MPI applications depend on
285 the time of the slowest task as in figure~(\ref{fig:homo}). Normally the
286 execution time of the parallel programs are proportional to the operational
287 frequency. Therefore, any DVFS operation for the energy reduction increases the
288 execution time of the parallel program. As shown in EQ~(\ref{eq:energy}) the
289 energy is affected by the scaling factor $S$. This factor also has a great impact
290 on the performance. When scaling down the frequency to the new value according
291 to EQ~(\ref{eq:s}), the value of the scale $S$ has inverse relation with
292 new frequency value ($S \propto \frac{1}{F_{new}}$). Also when decreasing the
293 frequency value, the execution time increases. Then the new frequency value has
294 inverse relation with time ($F_{new} \propto \frac{1}{T}$). This leads to the
295 frequency scaling factor $S$ proportional linearly with execution time ($S
296 \propto T$). Large scale MPI applications such as NAS benchmarks have
297 considerable amount of communications embedded in these programs. During the
298 communication process the processors remain idle until the communication has
299 finished. For that reason any change in the frequency has no impact on the time
300 of communication but it has obvious impact on the time of
301 computation~\cite{17}. We have made many tests on a real cluster to prove that the
302 frequency scaling factor \emph S has a linear relation with computation time
303 only. To predict the execution time of MPI program, the communication time and
304 the computation time for the slower task must be first precisely specified. Secondly,
305 these times are used to predict the execution time for any MPI program as a function of
306 the new scaling factor as in the EQ~(\ref{eq:tnew}).
309 \textit T_\textit{new} = T_\textit{Max Comp Old} \cdot S + T_{\textit{Max Comm Old}}
311 The above equation shows that the scaling factor \emph S has linear relation
312 with the computation time without affecting the communication time. The
313 communication time consists of the beginning times which an MPI calls for
314 sending or receiving till the message is synchronously sent or received. In this
315 paper we predict the execution time of the program for any new scaling factor
316 value. Depending on this prediction we can produce our energy-performance scaling
317 method as we will show in the coming sections. In the next section we make an
318 investigation study for the EQ~(\ref{eq:tnew}).
320 \section{Performance Prediction Verification}
323 In this section we evaluate the precision of our performance prediction methods
324 on the NAS benchmark. We use the EQ~(\ref{eq:tnew}) that predicts the execution
325 time for any scale value. The NAS programs run the class B for comparing the
326 real execution time with the predicted execution time. Each program runs offline
327 with all available scaling factors on 8 or 9 nodes to produce real execution
328 time values. These scaling factors are computed by dividing the maximum
329 frequency by the new one see EQ~(\ref{eq:s}). In all tests, we use the simulator
330 SimGrid/SMPI v3.10 to run the NAS programs.
333 \includegraphics[width=.4\textwidth]{cg_per.eps}\qquad%
334 \includegraphics[width=.4\textwidth]{mg_pre.eps}
335 \includegraphics[width=.4\textwidth]{bt_pre.eps}\qquad%
336 \includegraphics[width=.4\textwidth]{lu_pre.eps}
337 \caption{Fitting Predicted to Real Execution Time}
340 %see Figure~\ref{fig:pred}
341 In our cluster there are 18 available frequency states for each processor from
342 2.5 GHz to 800 MHz, there is 100 MHz difference between two successive
343 frequencies. For more details on the characteristics of the platform refer to
344 table~(\ref{table:platform}). This lead to 18 run states for each program. We
345 use seven MPI programs of the NAS parallel benchmarks: CG, MG, EP, FT, BT, LU
346 and SP. The average normalized errors between the predicted execution time and
347 the real time (SimGrid time) for all programs is between 0.0032 to 0.0133. AS an
348 example, we are present the execution times of the NAS benchmarks as in the
349 figure~(\ref{fig:pred}).
351 \section{Performance to Energy Competition}
354 This section demonstrates our approach for choosing the optimal scaling
355 factor. This factor gives maximum energy reduction taking into account the
356 execution time for both computation and communication times. The relation
357 between the energy and the performance are nonlinear and complex, because the
358 relation of the energy with scaling factor is nonlinear and with the performance
359 it is linear see~\cite{17}. The relation between the energy and the performance
360 is not straightforward. Moreover, they are not measured using the same metric.
361 For solving this problem, we normalize the energy by calculating the ratio
362 between the consumed energy with scaled frequency and the consumed energy
363 without scaled frequency:
366 E_\textit{Norm} = \frac{ E_\textit{Reduced}}{E_\textit{Original}} \\
367 {} = \frac{P_\textit{dyn} \cdot S_i^{-2} \cdot
368 \left( T_1 + \sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
369 P_\textit{static} \cdot T_1 \cdot S_i \cdot N }{
370 P_\textit{dyn} \cdot \left(T_1+\sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
371 P_\textit{static} \cdot T_1 \cdot N }
373 By the same way we can normalize the performance as follows:
376 P_\textit{Norm} = \frac{T_\textit{New}}{T_\textit{Old}}
377 = \frac{T_\textit{Max Comp Old} \cdot S +
378 T_\textit{Max Comm Old}}{ T_\textit{Old}}
380 The second problem is the optimization operation for both energy and performance
381 is not in the same direction. In other words, the normalized energy and the
382 performance curves are not in the same direction see figure~(\ref{fig:r2}).
383 While the main goal is to optimize the energy and performance in the same
384 time. According to the equations~(\ref{eq:enorm}) and~(\ref{eq:pnorm}) the
385 scaling factor \emph S reduce both the energy and the performance
386 simultaneously. But the main objective is to produce maximum energy reduction
387 with minimum performance reduction. Many researchers used different strategies
388 to solve this nonlinear problem for example see~\cite{19,42}, their methods add
389 big overhead to the algorithm for selecting the suitable frequency. In this
390 paper we are present a method to find the optimal scaling factor \emph S for
391 optimize both energy and performance simultaneously without adding big
392 overheads. Our solution for this problem is to make the optimization process
393 have the same direction. Therefore, we inverse the equation of normalize
394 performance as follows:
397 P^{-1}_\textit{Norm} = \frac{ T_\textit{Old}}{ T_\textit{New}}
398 = \frac{ T_\textit{Old}}{T_\textit{Max Comp Old} \cdot S +
399 T_\textit{Max Comm Old}}
403 \subfloat[Converted Relation.]{%
404 \includegraphics[width=.4\textwidth]{file.eps}\label{fig:r1}}%
406 \subfloat[Real Relation.]{%
407 \includegraphics[width=.4\textwidth]{file3.eps}\label{fig:r2}}
409 \caption{The Energy and Performance Relation}
411 Then, we can modelize our objective function as finding the maximum distance
412 between the energy curve EQ~(\ref{eq:enorm}) and the inverse of performance
413 curve EQ~(\ref{eq:pnorm_en}) over all available scaling factors. This represent
414 the minimum energy consumption with minimum execution time (better performance)
415 in the same time, see figure~(\ref{fig:r1}). Then our objective function has the
419 \textit{MaxDist} = \max (\overbrace{P^{-1}_\textit{Norm}}^{\text{Maximize}} -
420 \overbrace{E_\textit{Norm}}^{\text{Minimize}} )
422 Then we can select the optimal scaling factor that satisfy the
423 EQ~(\ref{eq:max}). Our objective function can works with any energy model or
424 static power values stored in a data file. Moreover, this function works in
425 optimal way when the energy function has a convex form with frequency scaling
426 factor as shown in~\cite{15,3,19}. Energy measurement model is not the
427 objective of this paper and we choose Rauber and R\"{u}nger model as an example with two
428 reasons that mentioned before.
430 \section{Optimal Scaling Factor for Performance and Energy}
433 In the previous section we described the objective function that satisfy our
434 goal in discovering optimal scaling factor for both performance and energy at
435 the same time. Therefore, we develop an energy to performance scaling algorithm
436 ($EPSA$). This algorithm is simple and has a direct way to calculate the optimal
437 scaling factor for both energy and performance at the same time.
438 \begin{algorithm}[tp]
441 \begin{algorithmic}[1]
442 \State Initialize the variable $Dist=0$
443 \State Set dynamic and static power values.
444 \State Set $P_{states}$ to the number of available frequencies.
445 \State Set the variable $F_{new}$ to max. frequency, $F_{new} = F_{max} $
446 \State Set the variable $F_{diff}$ to the scale value between each two frequencies.
447 \For {$i=1$ to $P_{states} $}
448 \State - Calculate the new frequency as $F_{new}=F_{new} - F_{diff} $
449 \State - Calculate the scale factor $S$ as in EQ~(\ref{eq:s}).
450 \State - Calculate all available scales $S_i$ depend on $S$ as\par\hspace{1 pt} in EQ~(\ref{eq:si}).
451 \State - Select the maximum scale factor $S_1$ from the set\par\hspace{1 pt} of scales $S_i$.
452 \State - Calculate the normalize energy $E_{Norm}=E_{R}/E_{O}$
453 \par\hspace{1 pt} as in EQ~(\ref{eq:enorm}).
454 \State - Calculate the normalize inverse of performance\par\hspace{1 pt}
455 $P_{NormInv}=T_{old}/T_{new}$ as in EQ~(\ref{eq:pnorm_en}).
456 \If{ $(P_{NormInv}-E_{Norm} > Dist$) }
457 \State $S_{optimal} = S$
458 \State $Dist = P_{NormInv} - E_{Norm}$
461 \State Return $S_{optimal}$
464 The proposed EPSA algorithm works online during the execution time of the MPI
465 program. It selects the optimal scaling factor by gathering some information
466 from the program after one iteration. This algorithm has small execution time
467 (between 0.00152 $ms$ for 4 nodes to 0.00665 $ms$ for 32 nodes). The data
468 required by this algorithm is the computation time and the communication time
469 for each task from the first iteration only. When these times are measured, the
470 MPI program calls the EPSA algorithm to choose the new frequency using the
471 optimal scaling factor. Then the program set the new frequency to the
472 system. The algorithm is called just one time during the execution of the
473 program. The DVFS algorithm~(\ref{dvfs}) shows where and when the EPSA algorithm is called
475 %\begin{minipage}{\textwidth}
476 %\AG{Use the same format as for Algorithm~\ref{$EPSA$}}
478 \begin{algorithm}[tp]
481 \begin{algorithmic}[1]
482 \For {$J:=1$ to $Some-Iterations \; $}
483 \State -Computations Section.
484 \State -Communications Section.
486 \State -Gather all times of computation and\par\hspace{13 pt} communication from each node.
487 \State -Call EPSA with these times.
488 \State -Calculate the new frequency from optimal scale.
489 \State -Set the new frequency to the system.
495 After obtaining the optimal scale factor from the EPSA algorithm. The program
496 calculates the new frequency $F_i$ for each task proportionally to its time
497 value $T_i$. By substitution of the EQ~(\ref{eq:s}) in the EQ~(\ref{eq:si}), we
498 can calculate the new frequency $F_i$ as follows:
501 F_i = \frac{F_\textit{max} \cdot T_i}{S_\textit{optimal} \cdot T_\textit{max}}
503 According to this equation all the nodes may have the same frequency value if
504 they have balanced workloads. Otherwise, they take different frequencies when
505 have imbalanced workloads. Then EQ~(\ref{eq:fi}) works in adaptive way to change
506 the frequency according to the nodes workloads.
508 \section{Experimental Results}
511 The proposed EPSA algorithm was applied to seven MPI programs of the NAS
512 benchmarks (EP, CG, MG, FT, BT, LU and SP). We work on three classes (A, B and
513 C) for each program. Each program runs on specific number of processors
514 proportional to the size of the class. Each class represents the problem size
515 ascending from the class A to C. Additionally, depending on some speed up points
516 for each class we run the classes A, B and C on 4, 8 or 9 and 16 nodes
517 respectively. Our experiments are executed on the simulator SimGrid/SMPI
518 v3.10. We design a platform file that simulates a cluster with one core per
519 node. This cluster is a homogeneous architecture with distributed memory. The
520 detailed characteristics of our platform file are shown in the
521 table~(\ref{table:platform}). Each node in the cluster has 18 frequency values
522 from 2.5 GHz to 800 MHz with 100 MHz difference between each two successive
525 \caption{Platform File Parameters}
528 \begin{tabular}{ | l | l | l |l | l |l |l | p{2cm} |}
530 Max & Min & Backbone & Backbone&Link &Link& Sharing \\
531 Freq. & Freq. & Bandwidth & Latency & Bandwidth& Latency&Policy \\ \hline
532 2.5 &800 & 2.25 GBps &$5\times 10^{-7} s$& 1 GBps & $5\times 10^{-5} s$ &Full \\
533 GHz& MHz& & & & &Duplex \\\hline
535 \label{table:platform}
537 Depending on the EQ~(\ref{eq:energy}), we measure the energy consumption for all
538 the NAS MPI programs while assuming the power dynamic is equal to 20W and the
539 power static is equal to 4W for all experiments. We run the proposed EPSA
540 algorithm for all these programs. The results showed that the algorithm selected
541 different scaling factors for each program depending on the communication
542 features of the program as in the figure~(\ref{fig:nas}). This figure shows that
543 there are different distances between the normalized energy and the normalized
544 inversed performance curves, because there are different communication features
545 for each MPI program. When there are little or not communications, the inversed
546 performance curve is very close to the energy curve. Then the distance between
547 the two curves is very small. This lead to small energy savings. The opposite
548 happens when there are a lot of communication, the distance between the two
549 curves is big. This lead to more energy savings (e.g. CG and FT), see
550 table~(\ref{table:factors results}). All discovered frequency scaling factors
551 optimize both the energy and the performance simultaneously for all the NAS
552 programs. In table~(\ref{table:factors results}), we record all optimal scaling
553 factors results for each program on class C. These factors give the maximum
554 energy saving percent and the minimum performance degradation percent in the
555 same time over all available scales.
558 \includegraphics[width=.33\textwidth]{ep.eps}\hfill%
559 \includegraphics[width=.33\textwidth]{cg.eps}\hfill%
560 \includegraphics[width=.33\textwidth]{sp.eps}
561 \includegraphics[width=.33\textwidth]{lu.eps}\hfill%
562 \includegraphics[width=.33\textwidth]{bt.eps}\hfill%
563 \includegraphics[width=.33\textwidth]{ft.eps}
564 \caption{Optimal scaling factors for The NAS MPI Programs}
568 \caption{Optimal Scaling Factors Results}
571 \AG{Use the same number of decimals for all numbers in a column,
572 and vertically align the numbers along the decimal points.
573 The same for all the following tables.}
574 \begin{tabular}{ | l | l | l |l | r |}
576 Program & Optimal & Energy & Performance&Energy-Perf.\\
577 Name & Scaling Factor& Saving \%&Degradation \% &Distance \\ \hline
578 CG & 1.56 &39.23&14.88 &24.35\\ \hline
579 MG & 1.47 &34.97&21.70 &13.27 \\ \hline
580 EP & 1.04 &22.14&20.73 &1.41\\ \hline
581 LU & 1.38 &35.83&22.49 &13.34\\ \hline
582 BT & 1.31 &29.60&21.28 &8.32\\ \hline
583 SP & 1.38 &33.48&21.36 &12.12\\ \hline
584 FT & 1.47 &34.72&19.00 &15.72\\ \hline
586 \label{table:factors results}
587 % is used to refer this table in the text
590 As shown in the table~(\ref{table:factors results}), when the optimal scaling
591 factor has big value we can gain more energy savings for example as in CG and
592 FT. The opposite happens when the optimal scaling factor is small value as
593 example BT and EP. Our algorithm selects big scaling factor value when the
594 communication and the other slacks times are big and smaller ones in opposite
595 cases. In EP there are no communications inside the iterations. This make our
596 EPSA to selects smaller scaling factor values (inducing smaller energy savings).
598 \section{Comparing Results}
601 In this section, we compare our EPSA algorithm results with Rauber and R\"{u}nger
602 methods~\cite{3}. He had two scenarios, the first is to reduce energy to optimal
603 level without considering the performance as in EQ~(\ref{eq:sopt}). We refer to
604 this scenario as $R_{E}$. The second scenario is similar to the first
605 except setting the slower task to the maximum frequency (when the scale $S=1$)
606 to keep the performance from degradation as mush as possible. We refer to this
607 scenario as $R_{E-P}$. The comparison is made in tables~(\ref{table:compare
608 Class A},\ref{table:compare Class B},\ref{table:compare Class C}). These
609 tables show the results of our EPSA and Rauber and R\"{u}nger scenarios for all the NAS
610 benchmarks programs for classes A,B and C.
612 \caption{Comparing Results for The NAS Class A}
615 \begin{tabular}{ | l | l | l |l | l | r| }
617 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
618 Name &Name&Value& Saving \%&Degradation \% &Distance
620 % \rowcolor[gray]{0.85}
621 $EPSA$&CG & 1.56 &37.02 & 13.88 & 23.14\\ \hline
622 $R_{E-P}$&CG &2.14 &42.77 & 25.27 & 17.50\\ \hline
623 $R_{E}$&CG &2.14 &42.77&26.46&16.31\\ \hline
625 $EPSA$&MG & 1.47 &27.66&16.82&10.84\\ \hline
626 $R_{E-P}$&MG &2.14&34.45&31.84&2.61\\ \hline
627 $R_{E}$&MG &2.14&34.48&33.65&0.80 \\ \hline
629 $EPSA$&EP &1.19 &25.32&20.79&4.53\\ \hline
630 $R_{E-P}$&EP&2.05&41.45&55.67&-14.22\\ \hline
631 $R_{E}$&EP&2.05&42.09&57.59&-15.50\\ \hline
633 $EPSA$&LU&1.56& 39.55 &19.38& 20.17\\ \hline
634 $R_{E-P}$&LU&2.14&45.62&27.00&18.62 \\ \hline
635 $R_{E}$&LU&2.14&45.66&33.01&12.65\\ \hline
637 $EPSA$&BT&1.31& 29.60&20.53&9.07 \\ \hline
638 $R_{E-P}$&BT&2.10&45.53&49.63&-4.10\\ \hline
639 $R_{E}$&BT&2.10&43.93&52.86&-8.93\\ \hline
641 $EPSA$&SP&1.38& 33.51&15.65&17.86 \\ \hline
642 $R_{E-P}$&SP&2.11&45.62&42.52&3.10\\ \hline
643 $R_{E}$&SP&2.11&45.78&43.09&2.69\\ \hline
645 $EPSA$&FT&1.25&25.00&10.80&14.20 \\ \hline
646 $R_{E-P}$&FT&2.10&39.29&34.30&4.99 \\ \hline
647 $R_{E}$&FT&2.10&37.56&38.21&-0.65\\ \hline
649 \label{table:compare Class A}
650 % is used to refer this table in the text
653 \caption{Comparing Results for The NAS Class B}
656 \begin{tabular}{ | l | l | l |l | l |r| }
658 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
659 Name &Name&Value& Saving \%&Degradation \% &Distance
661 % \rowcolor[gray]{0.85}
662 $EPSA$&CG & 1.66 &39.23&16.63&22.60 \\ \hline
663 $R_{E-P}$&CG &2.15 &45.34&27.60&17.74\\ \hline
664 $R_{E}$&CG &2.15 &45.34&28.88&16.46\\ \hline
666 $EPSA$ &MG & 1.47 &34.98&18.35&16.63\\ \hline
667 $R_{E-P}$&MG &2.14&43.55&36.42&7.13 \\ \hline
668 $R_{E}$&MG &2.14&43.56&37.07&6.49 \\ \hline
670 $EPSA$&EP &1.08 &20.29&17.15&3.14 \\ \hline
671 $R_{E-P}$&EP&2.00&42.38&56.88&-14.50\\ \hline
672 $R_{E}$&EP&2.00&39.73&59.94&-20.21\\ \hline
674 $EPSA$&LU&1.47&38.57&21.34&17.23 \\ \hline
675 $R_{E-P}$&LU&2.10&43.62&36.51&7.11 \\ \hline
676 $R_{E}$&LU&2.10&43.61&38.54&5.07 \\ \hline
678 $EPSA$&BT&1.31& 29.59&20.88&8.71\\ \hline
679 $R_{E-P}$&BT&2.10&44.53&53.05&-8.52\\ \hline
680 $R_{E}$&BT&2.10&42.93&52.80&-9.87\\ \hline
682 $EPSA$&SP&1.38&33.44&19.24&14.20 \\ \hline
683 $R_{E-P}$&SP&2.15&45.69&43.20&2.49\\ \hline
684 $R_{E}$&SP&2.15&45.41&44.47&0.94\\ \hline
686 $EPSA$&FT&1.38&34.40&14.57&19.83 \\ \hline
687 $R_{E-P}$&FT&2.13&42.98&37.35&5.63 \\ \hline
688 $R_{E}$&FT&2.13&43.04&37.90&5.14\\ \hline
690 \label{table:compare Class B}
691 % is used to refer this table in the text
695 \caption{Comparing Results for The NAS Class C}
698 \begin{tabular}{ | l | l | l |l | l |r| }
700 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
701 Name &Name&Value& Saving \%&Degradation \% &Distance
703 % \rowcolor[gray]{0.85}
704 $EPSA$&CG & 1.56 &39.23&14.88&24.35 \\ \hline
705 $R_{E-P}$&CG &2.15 &45.36&25.89&19.47\\ \hline
706 $R_{E}$&CG &2.15 &45.36&26.70&18.66\\ \hline
708 $EPSA$&MG & 1.47 &34.97&21.69&13.27\\ \hline
709 $R_{E-P}$&MG &2.15&43.65&40.45&3.20 \\ \hline
710 $R_{E}$&MG &2.15&43.64&41.38&2.26 \\ \hline
712 $EPSA$&EP &1.04 &22.14&20.73&1.41 \\ \hline
713 $R_{E-P}$&EP&1.92&39.40&56.33&-16.93\\ \hline
714 $R_{E}$&EP&1.92&38.10&56.35&-18.25\\ \hline
716 $EPSA$&LU&1.38&35.83&22.49&13.34 \\ \hline
717 $R_{E-P}$&LU&2.15&44.97&41.00&3.97 \\ \hline
718 $R_{E}$&LU&2.15&44.97&41.80&3.17 \\ \hline
720 $EPSA$&BT&1.31& 29.60&21.28&8.32\\ \hline
721 $R_{E-P}$&BT&2.13&45.60&49.84&-4.24\\ \hline
722 $R_{E}$&BT&2.13&44.90&55.16&-10.26\\ \hline
724 $EPSA$&SP&1.38&33.48&21.35&12.12\\ \hline
725 $R_{E-P}$&SP&2.10&45.69&43.60&2.09\\ \hline
726 $R_{E}$&SP&2.10&45.75&44.10&1.65\\ \hline
728 $EPSA$&FT&1.47&34.72&19.00&15.72 \\ \hline
729 $R_{E-P}$&FT&2.04&39.40&37.10&2.30\\ \hline
730 $R_{E}$&FT&2.04&39.35&37.70&1.65\\ \hline
732 \label{table:compare Class C}
733 % is used to refer this table in the text
735 As shown in these tables our scaling factor is not optimal for energy saving
736 such as Rauber's scaling factor EQ~(\ref{eq:sopt}), but it is optimal for both
737 the energy and the performance simultaneously. Our $EPSA$ optimal scaling factors
738 has better simultaneous optimization for both the energy and the performance
739 compared to Rauber and R\"{u}nger energy-performance method ($R_{E-P}$). Also, in
740 ($R_{E-P}$) method when setting the frequency to maximum value for the
741 slower task lead to a small improvement of the performance. Also the results
742 show that this method keep or improve energy saving. Because of the energy
743 consumption decrease when the execution time decreased while the frequency value
746 Figure~(\ref{fig:compare}) shows the maximum distance between the energy saving
747 percent and the performance degradation percent. Therefore, this means it is the
748 same resultant of our objective function EQ~(\ref{eq:max}). Our algorithm always
749 gives positive energy to performance trade offs while Rauber and R\"{u}nger method
750 ($R_{E-P}$) gives in some time negative trade offs such as in BT and
751 EP. The positive trade offs with highest values lead to maximum energy savings
752 concatenating with less performance degradation and this the objective of this
753 paper. While the negative trade offs refers to improving energy saving (or may
754 be the performance) while degrading the performance (or may be the energy) more
758 \includegraphics[width=.33\textwidth]{compare_class_A.pdf}
759 \includegraphics[width=.33\textwidth]{compare_class_B.pdf}
760 \includegraphics[width=.33\textwidth]{compare_class_c.pdf}
761 \caption{Comparing Our EPSA with Rauber and R\"{u}nger Methods}
768 \AG{the conclusion needs to be written\dots{} one day}
770 \section*{Acknowledgment}
773 Computations have been performed on the supercomputer facilities of the
774 Mésocentre de calcul de Franche-Comté.
776 % trigger a \newpage just before the given reference
777 % number - used to balance the columns on the last page
778 % adjust value as needed - may need to be readjusted if
779 % the document is modified later
780 %\IEEEtriggeratref{15}
782 \bibliographystyle{IEEEtran}
783 \bibliography{IEEEabrv,my_reference}
790 %%% ispell-local-dictionary: "american"
793 % LocalWords: Badri Charr FIXME Tianhe DVFS HPC NAS NPB SMPI Rauber's Rauber
794 % LocalWords: CMOS EQ $$EPSA$$ Franche Comté Tflop