1 \documentclass[12pt]{article}
2 %\documentclass[12pt,twocolumn]{article}
4 \usepackage[T1]{fontenc}
5 \usepackage[utf8]{inputenc}
6 \usepackage[english]{babel}
7 \usepackage{algorithm,algorithmicx,algpseudocode}
8 \usepackage{graphicx,graphics}
13 % \usepackage{sectsty}
14 % \usepackage{titlesec}
16 %\usepackage[font={footnotesize,bt}]{caption}
17 %\usepackage[font=scriptsize,labelfont=bf]{caption}
19 \usepackage{todonotes}
20 \newcommand{\AG}[2][inline]{\todo[color=green!50,#1]{\sffamily\small\textbf{AG:} #2}}
24 \title{Optimal Dynamic Frequency Scaling for Energy-Performance of Parallel MPI Programs}
25 \author{A. Badri \and J.-C. Charr \and R. Couturier \and A. Giersch}
28 \AG{``Optimal'' is a bit pretentious in the title}
31 \AG{complete the abstract\dots}
34 \section{Introduction}
36 The need for computing power is still increasing and it is not expected to slow
37 down in the coming years. To satisfy this demand, researchers and supercomputers
38 constructors have been regularly increasing the number of computing cores in
39 supercomputers (for example in November 2013, according to the top 500
40 list~\cite{43}, the Tianhe-2 was the fastest supercomputer. It has more than 3
41 millions of cores and delivers more than 33 Tflop/s while consuming 17808
42 kW). This large increase in number of computing cores has led to large energy
43 consumption by these architectures. Moreover, the price of energy is expected to
44 continue its ascent according to the demand. For all these reasons energy
45 reduction became an important topic in the high performance computing field. To
46 tackle this problem, many researchers used DVFS (Dynamic Voltage Frequency
47 Scaling) operations which reduce dynamically the frequency and voltage of cores
48 and thus their energy consumption. However, this operation also degrades the
49 performance of computation. Therefore researchers try to reduce the frequency to
50 minimum when processors are idle (waiting for data from other processors or
51 communicating with other processors). Moreover, depending on their objectives
52 they use heuristics to find the best scaling factor during the computation. If
53 they aim for performance they choose the best scaling factor that reduces the
54 consumed energy while affecting as little as possible the performance. On the
55 other hand, if they aim for energy reduction, the chosen scaling factor must
56 produce the most energy efficient execution without considering the degradation
57 of the performance. It is important to notice that lowering the frequency to
58 minimum value does not always give the most efficient execution due to energy
59 leakage. The best scaling factor might be chosen during execution (online) or
60 during a pre-execution phase. In this paper we emphasize to develop an
61 algorithm that selects the optimal frequency scaling factor that takes into
62 consideration simultaneously the energy consumption and the performance. The
63 main objective of HPC systems is to run the application with less execution
64 time. Therefore, our algorithm selects the optimal scaling factor online with
65 very small footprint. The proposed algorithm takes into account the
66 communication times of the MPI programs to choose the scaling factor. This
67 algorithm has ability to predict both energy consumption and execution time over
68 all available scaling factors. The prediction achieved depends on some
69 computing time information, gathered at the beginning of the runtime. We apply
70 this algorithm to seven MPI benchmarks. These MPI programs are the NAS parallel
71 benchmarks (NPB v3.3) developed by NASA~\cite{44}. Our experiments are executed
72 using the simulator SimGrid/SMPI v3.10~\cite{Casanova:2008:SGF:1397760.1398183}
73 over an homogeneous distributed memory architecture. Furthermore, we compare the
74 proposed algorithm with Rauber's methods. The comparison's results show that our
75 algorithm gives better energy-time trade off.
77 \section{Related Works}
79 In the this section some heuristics, to compute the scaling factor, are
80 presented and classified in two parts : offline and online methods.
82 \subsection{The offline DVFS orientations}
84 The DVFS offline methods are static and are not executed during the runtime of
85 the program. Some approaches used heuristics to select the best DVFS state
86 during the compilation phases as an example in Azevedo et al.~\cite{40}. He used
87 intra-task algorithm to choose the DVFS setting when there are dependency points
88 between tasks. While in~\cite{29}, Xie et al. used breadth-first search
89 algorithm to do that. Their goal is saving energy with time limits. Another
90 approaches gathers and stores the runtime information for each DVFS state, then
91 used their methods offline to select the suitable DVFS that optimize energy-time
92 trade offs. As an example~\cite{8}, Rountree et al. used liner programming
93 algorithm, while in~\cite{38,34}, Cochran et al. used multi logistic regression
94 algorithm for the same goal. The offline study that shown the DVFS impact on the
95 communication time of the MPI program is~\cite{17}, Freeh et al. show that these
96 times not changed when the frequency is scaled down.
98 \subsection{The online DVFS orientations}
100 The objective of these works is to dynamically compute and set the frequency of
101 the CPU during the runtime of the program for saving energy. Estimating and
102 predicting approaches for the energy-time trade offs developed by
103 ~\cite{11,2,31}. These works select the best DVFS setting depending on the slack
104 times. These times happen when the processors have to wait for data from other
105 processors to compute their task. For example, during the synchronous
106 communication time that take place in the MPI programs, the processors are
107 idle. The optimal DVFS can be selected using the learning methods. Therefore, in
108 ~\cite{39,19} used machine learning to converge to the suitable DVFS
109 configuration. Their learning algorithms have big time to converge when the
110 number of available frequencies is high. Also, the communication time of the MPI
111 program used online for saving energy as in~\cite{1}, Lim et al. developed an
112 algorithm that detects the communication sections and changes the frequency
113 during these sections only. This approach changes the frequency many times
114 because an iteration may contain more than one communication section. The domain
115 of analytical modeling used for choosing the optimal frequency as in~\cite{3},
116 Rauber et al. developed an analytical mathematical model for determining the
117 optimal frequency scaling factor for any number of concurrent tasks, without
118 considering communication times. They set the slowest task to maximum frequency
119 for maintaining performance. In this paper we compare our algorithm with
120 Rauber's model~\cite{3}, because his model can be used for any number of
121 concurrent tasks for homogeneous platform and this is the same direction of this
122 paper. However, the primary contributions of this paper are:
124 \item Selecting the optimal frequency scaling factor for energy and performance
125 simultaneously. While taking into account the communication time.
126 \item Adapting our scale factor to taking into account the imbalanced tasks.
127 \item The execution time of our algorithm is very small when compared to other
128 methods (e.g.,~\cite{19}).
129 \item The proposed algorithm works online without profiling or training as
133 \section{Parallel Tasks Execution on Homogeneous Platform}
135 A homogeneous cluster consists of identical nodes in terms of the hardware and
136 the software. Each node has its own memory and at least one processor which can
137 be a multi-core. The nodes are connected via a high bandwidth network. Tasks
138 executed on this model can be either synchronous or asynchronous. In this paper
139 we consider execution of the synchronous tasks on distributed homogeneous
140 platform. These tasks can exchange the data via synchronous memory passing.
143 \subfloat[Synch. Imbalanced Communications]{\includegraphics[scale=0.67]{synch_tasks}\label{fig:h1}}
144 \subfloat[Synch. Imbalanced Computations]{\includegraphics[scale=0.67]{compt}\label{fig:h2}}
145 \caption{Parallel Tasks on Homogeneous Platform}
148 Therefore, the execution time of a task consists of the computation time and the
149 communication time. Moreover, the synchronous communications between tasks can
150 lead to idle time while tasks wait at the synchronous point for others tasks to
151 finish their communications see figure~(\ref{fig:h1}). Another source for idle
152 times is the imbalanced computations. This happen when processing different
153 amounts of data on each processor as an example see figure~(\ref{fig:h2}). In
154 this case the fastest tasks have to wait at the synchronous barrier for the
155 slowest tasks to finish their job. In both two cases the overall execution time
156 of the program is the execution time of the slowest task as :
159 \textit{Program Time} = \max_{i=1,2,\dots,N} T_i
161 where $T_i$ is the execution time of process $i$.
163 \section{Energy Model for Homogeneous Platform}
165 The energy consumption by the processor consists of two powers metric: the
166 dynamic and the static power. This general power formulation is used by many
167 researchers see~\cite{9,3,15,26}. The dynamic power of the CMOS processors
168 $P_{dyn}$ is related to the switching activity $\alpha$, load capacitance $C_L$,
169 the supply voltage $V$ and operational frequency $f$ respectively as follow :
172 P_{dyn} = \alpha \cdot C_L \cdot V^2 \cdot f
174 The static power $P_{static}$ captures the leakage power consumption as well as
175 the power consumption of peripheral devices like the I/O subsystem.
178 P_{static} = V \cdot N \cdot K_{design} \cdot I_{leak}
180 where V is the supply voltage, N is the number of transistors, $K_{design}$ is a
181 design dependent parameter and $I_{leak}$ is a technology-dependent
182 parameter. Energy consumed by an individual processor $E_{ind}$ is the summation
183 of the dynamic and the static power multiply by the execution time for example
187 E_{ind} = ( P_{dyn} + P_{static} ) \cdot T
189 The dynamic voltage and frequency scaling (DVFS) is a process that allowed in
190 modern processors to reduce the dynamic power by scaling down the voltage and
191 frequency. Its main objective is to reduce the overall energy
192 consumption~\cite{37}. The operational frequency \emph f depends linearly on the
193 supply voltage $V$, i.e., $V = \beta . f$ with some constant $\beta$. This
194 equation is used to study the change of the dynamic voltage with respect to
195 various frequency values in~\cite{3}. The reduction process of the frequency are
196 expressed by scaling factor \emph S. The scale \emph S is the ratio between the
197 maximum and the new frequency as in EQ~(\ref{eq:s}).
200 S = \frac{F_{max}}{F_{new}}
202 The value of the scale \emph S is grater than 1 when changing the frequency to
203 any new frequency value(\emph {P-state}) in governor. It is equal to 1 when the
204 frequency are set to the maximum frequency. The energy consumption model for
205 parallel homogeneous platform is depending on the scaling factor \emph S. This
206 factor reduces quadratically the dynamic power. Also, this factor increases the
207 static energy linearly because the execution time is increased~\cite{36}. The
208 energy model, depending on the frequency scaling factor, of homogeneous platform
209 for any number of concurrent tasks develops by Rauber~\cite{3}. This model
210 consider the two powers metric for measuring the energy of the parallel tasks as
211 in EQ~(\ref{eq:energy}).
215 E = P_{dyn} \cdot S_1^{-2} \cdot
216 \left( T_1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^2} \right) +
217 P_{static} \cdot T_1 \cdot S_1 \cdot N
220 Where \emph N is the number of parallel nodes, $T_1 $ is the time of the slower
221 task, $T_i$ is the time of the task $i$ and $S_1$ is the maximum scaling factor
222 for the slower task. The scaling factor $S_1$, as in EQ~(\ref{eq:s1}), selects
223 from the set of scales values $S_i$. Each of these scales are proportional to
224 the time value $T_i$ depends on the new frequency value as in EQ~(\ref{eq:si}).
227 S_1 = \max_{i=1,2,\dots,F} S_i
231 S_i = S \cdot \frac{T_1}{T_i}
232 = \frac{F_{max}}{F_{new}} \cdot \frac{T_1}{T_i}
234 Where $F$ is the number of available frequencies. In this paper we depend on
235 Rauber's energy model EQ~(\ref{eq:energy}) for two reasons : 1-this model used
236 for homogeneous platform that we work on in this paper. 2-we are compare our
237 algorithm with Rauber's scaling model. Rauber's optimal scaling factor for
238 optimal energy reduction derived from the EQ~(\ref{eq:energy}). He takes the
239 derivation for this equation (to be minimized) and set it to zero to produce the
240 scaling factor as in EQ~(\ref{eq:sopt}).
243 S_{opt} = \sqrt[3]{\frac{2}{n} \cdot \frac{P_{dyn}}{P_{static}} \cdot
244 \left( 1 + \sum_{i=2}^{N} \frac{T_i^3}{T_1^3} \right) }
247 \section{Performance Evaluation of MPI Programs}
249 The performance (execution time) of the parallel MPI applications are depends on
250 the time of the slowest task as in figure~(\ref{fig:homo}). Normally the
251 execution time of the parallel programs are proportional to the operational
252 frequency. Therefore, any DVFS operation for the energy reduction increase the
253 execution time of the parallel program. As shown in EQ~(\ref{eq:energy}) the
254 energy affected by the scaling factor $S$. This factor also has a great impact
255 on the performance. When scaling down the frequency to the new value according
256 to EQ~(\ref{eq:s}) lead to the value of the scale $S$ has inverse relation with
257 new frequency value ($S \propto \frac{1}{F_{new}}$). Also when decrease the
258 frequency value, the execution time increase. Then the new frequency value has
259 inverse relation with time ($F_{new} \propto \frac{1}{T}$). This lead to the
260 frequency scaling factor $S$ proportional linearly with execution time ($S
261 \propto T$). Large scale MPI applications such as NAS benchmarks have
262 considerable amount of communications embedded in these programs. During the
263 communication process the processor remain idle until the communication has
264 finished. For that reason any change in the frequency has no impact on the time
265 of communication but it has obvious impact on the time of
266 computation~\cite{17}. We are made many tests on real cluster to prove that the
267 frequency scaling factor \emph S has a linear relation with computation time
268 only also see~\cite{41}. To predict the execution time of MPI program, firstly
269 must be precisely specifying communication time and the computation time for the
270 slower task. Secondly, we use these times for predicting the execution time for
271 any MPI program as a function of the new scaling factor as in the
275 T_{new} = T_{\textit{Max Comp Old}} \cdot S + T_{\textit{Max Comm Old}}
277 The above equation shows that the scaling factor \emph S has linear relation
278 with the computation time without affecting the communication time. The
279 communication time consists of the beginning times which an MPI calls for
280 sending or receiving till the message is synchronously sent or received. In this
281 paper we predict the execution time of the program for any new scaling factor
282 value. Depending on this prediction we can produce our energy-performance scaling
283 method as we will show in the coming sections. In the next section we make an
284 investigation study for the EQ~(\ref{eq:tnew}).
286 \section{Performance Prediction Verification}
288 In this section we evaluate the precision of our performance prediction methods
289 on the NAS benchmark. We use the EQ~(\ref{eq:tnew}) that predicts the execution
290 time for any scale value. The NAS programs run the class B for comparing the
291 real execution time with the predicted execution time. Each program runs offline
292 with all available scaling factors on 8 or 9 nodes to produce real execution
293 time values. These scaling factors are computed by dividing the maximum
294 frequency by the new one see EQ~(\ref{eq:s}). In all tests, we use the simulator
295 SimGrid/SMPI v3.10 to run the NAS programs.
296 \begin{figure}[width=\textwidth,height=\textheight,keepaspectratio]
298 \includegraphics[scale=0.60]{cg_per.eps}
299 \includegraphics[scale=0.60]{mg_pre.eps}
300 \includegraphics[scale=0.60]{bt_pre.eps}
301 \includegraphics[scale=0.60]{lu_pre.eps}
302 \caption{Fitting Predicted to Real Execution Time}
305 %see Figure~\ref{fig:pred}
306 In our cluster there are 18 available frequency states for each processor from
307 2.5 GHz to 800 MHz, there is 100 MHz difference between two successive
308 frequencies. For more details on the characteristics of the platform refer to
309 table~(\ref{table:platform}). This lead to 18 run states for each program. We
310 use seven MPI programs of the NAS parallel benchmarks : CG, MG, EP, FT, BT, LU
311 and SP. The average normalized errors between the predicted execution time and
312 the real time (SimGrid time) for all programs is between 0.0032 to 0.0133. AS an
313 example, we are present the execution times of the NAS benchmarks as in the
314 figure~(\ref{fig:pred}).
316 \section{Performance to Energy Competition}
317 This section demonstrates our approach for choosing the optimal scaling
318 factor. This factor gives maximum energy reduction taking into account the
319 execution time for both computation and communication times . The relation
320 between the energy and the performance are nonlinear and complex, because the
321 relation of the energy with scaling factor is nonlinear and with the performance
322 it is linear see~\cite{17}. The relation between the energy and the performance
323 is not straightforward. Moreover, they are not measured using the same metric.
324 For solving this problem, we normalize the energy by calculating the ratio
325 between the consumed energy with scaled frequency and the consumed energy
326 without scaled frequency :
329 E_\textit{Norm} = \frac{E_{Reduced}}{E_{Original}}
330 = \frac{ P_{dyn} \cdot S_i^{-2} \cdot
331 \left( T_1 + \sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
332 P_{static} \cdot T_1 \cdot S_i \cdot N }{
333 P_{dyn} \cdot \left(T_1+\sum_{i=2}^{N}\frac{T_i^3}{T_1^2}\right) +
334 P_{static} \cdot T_1 \cdot N }
336 \AG{Use \texttt{\textbackslash{}text\{xxx\}} or
337 \texttt{\textbackslash{}textit\{xxx\}} for all subscripted words in equations
338 (e.g. \mbox{\texttt{E\_\{\textbackslash{}text\{Norm\}\}}}).
340 Don't hesitate to define new commands :
341 \mbox{\texttt{\textbackslash{}newcommand\{\textbackslash{}ENorm\}\{E\_\{\textbackslash{}text\{Norm\}\}\}}}
343 By the same way we can normalize the performance as follows :
346 P_{Norm} = \frac{T_{New}}{T_{Old}}
347 = \frac{T_{\textit{Max Comp Old}} \cdot S +
348 T_{\textit{Max Comm Old}}}{T_{Old}}
350 The second problem is the optimization operation for both energy and performance
351 is not in the same direction. In other words, the normalized energy and the
352 performance curves are not in the same direction see figure~(\ref{fig:r2}).
353 While the main goal is to optimize the energy and performance in the same
354 time. According to the equations~(\ref{eq:enorm}) and~(\ref{eq:pnorm}) the
355 scaling factor \emph S reduce both the energy and the performance
356 simultaneously. But the main objective is to produce maximum energy reduction
357 with minimum performance reduction. Many researchers used different strategies
358 to solve this nonlinear problem for example see~\cite{19,42}, their methods add
359 big overhead to the algorithm for selecting the suitable frequency. In this
360 paper we are present a method to find the optimal scaling factor \emph S for
361 optimize both energy and performance simultaneously without adding big
362 overheads. Our solution for this problem is to make the optimization process
363 have the same direction. Therefore, we inverse the equation of normalize
364 performance as follows :
367 P^{-1}_{Norm} = \frac{T_{Old}}{T_{New}}
368 = \frac{T_{Old}}{T_{\textit{Max Comp Old}} \cdot S +
369 T_{\textit{Max Comm Old}}}
373 \subfloat[Converted Relation.]{\includegraphics[scale=0.70]{file.eps}\label{fig:r1}}
374 \subfloat[Real Relation.]{\includegraphics[scale=0.70]{file3.eps}\label{fig:r2}}
376 \caption{The Energy and Performance Relation}
378 Then, we can modelize our objective function as finding the maximum distance
379 between the energy curve EQ~(\ref{eq:enorm}) and the inverse of performance
380 curve EQ~(\ref{eq:pnorm_en}) over all available scaling factors. This represent
381 the minimum energy consumption with minimum execution time (better performance)
382 in the same time, see figure~(\ref{fig:r1}). Then our objective function has the
386 \textit{MaxDist} = \max (\overbrace{P^{-1}_{Norm}}^{\text{Maximize}} -
387 \overbrace{E_{Norm}}^{\text{Minimize}} )
389 Then we can select the optimal scaling factor that satisfy the
390 EQ~(\ref{eq:max}). Our objective function can works with any energy model or
391 static power values stored in a data file. Moreover, this function works in
392 optimal way when the energy function has a convex form with frequency scaling
393 factor as shown in~\cite{15,3,19}. Energy measurement model is not the
394 objective of this paper and we choose Rauber's model as an example with two
395 reasons that mentioned before.
397 \section{Optimal Scaling Factor for Performance and Energy}
399 In the previous section we described the objective function that satisfy our
400 goal in discovering optimal scaling factor for both performance and energy at
401 the same time. Therefore, we develop an energy to performance scaling algorithm
402 (EPSA). This algorithm is simple and has a direct way to calculate the optimal
403 scaling factor for both energy and performance at the same time.
404 \begin{algorithm}[tp]
407 \begin{algorithmic}[1]
408 \State Initialize the variable $Dist=0$
409 \State Set dynamic and static power values.
410 \State Set $P_{states}$ to the number of available frequencies.
411 \State Set the variable $F_{new}$ to max. frequency, $F_{new} = F_{max} $
412 \State Set the variable $F_{diff}$ to the scale value between each two frequencies.
413 \For {$i=1$ to $P_{states} $}
414 \State - Calculate the new frequency as $F_{new}=F_{new} - F_{diff} $
415 \State - Calculate the scale factor $S$ as in EQ~(\ref{eq:s}).
416 \State - Calculate all available scales $S_i$ depend on $S$ as in EQ~(\ref{eq:si}).
417 \State - Select the maximum scale factor $S_1$ from the set of scales $S_i$.
418 \State - Calculate the normalize energy $E_{Norm}=E_{R}/E_{O}$ as in EQ~(\ref{eq:enorm}).
419 \State - Calculate the normalize inverse of performance\par
420 $P_{NormInv}=T_{old}/T_{new}$ as in EQ~(\ref{eq:pnorm_en}).
421 \If{ $(P_{NormInv}-E_{Norm} > Dist$) }
422 \State $S_{optimal} = S$
423 \State $Dist = P_{NormInv} - E_{Norm}$
426 \State Return $S_{optimal}$
429 The proposed EPSA algorithm works online during the execution time of the MPI
430 program. It selects the optimal scaling factor by gathering some information
431 from the program after one iteration. This algorithm has small execution time
432 (between 0.00152 $ms$ for 4 nodes to 0.00665 $ms$ for 32 nodes). The data
433 required by this algorithm is the computation time and the communication time
434 for each task from the first iteration only. When these times are measured, the
435 MPI program calls the EPSA algorithm to choose the new frequency using the
436 optimal scaling factor. Then the program set the new frequency to the
437 system. The algorithm is called just one time during the execution of the
438 program. The DVFS algorithm~(\ref{dvfs}) shows where and when the EPSA algorithm is called
440 %\begin{minipage}{\textwidth}
441 %\AG{Use the same format as for Algorithm~\ref{EPSA}}
443 \begin{algorithm}[tp]
447 \For {$J:=1$ to $Some-Iterations \; $}
448 \State -Computations Section.
449 \State -Communications Section.
451 \State -Gather all times of computation and\par
452 \State communication from each node.
453 \State -Call EPSA with these times.
454 \State -Calculate the new frequency from optimal scale.
455 \State -Set the new frequency to the system.
461 After obtaining the optimal scale factor from the EPSA algorithm. The program
462 calculates the new frequency $F_i$ for each task proportionally to its time
463 value $T_i$. By substitution of the EQ~(\ref{eq:s}) in the EQ~(\ref{eq:si}), we
464 can calculate the new frequency $F_i$ as follows :
467 F_i = \frac{F_{max} \cdot T_i}{S_{optimal} \cdot T_{max}}
469 According to this equation all the nodes may have the same frequency value if
470 they have balanced workloads. Otherwise, they take different frequencies when
471 have imbalanced workloads. Then EQ~(\ref{eq:fi}) works in adaptive way to change
472 the frequency according to the nodes workloads.
474 \section{Experimental Results}
476 The proposed EPSA algorithm was applied to seven MPI programs of the NAS
477 benchmarks (EP, CG, MG, FT, BT, LU and SP). We work on three classes (A, B and
478 C) for each program. Each program runs on specific number of processors
479 proportional to the size of the class. Each class represents the problem size
480 ascending from the class A to C. Additionally, depending on some speed up points
481 for each class we run the classes A, B and C on 4, 8 or 9 and 16 nodes
482 respectively. Our experiments are executed on the simulator SimGrid/SMPI
483 v3.10. We design a platform file that simulates a cluster with one core per
484 node. This cluster is a homogeneous architecture with distributed memory. The
485 detailed characteristics of our platform file are shown in the
486 table~(\ref{table:platform}). Each node in the cluster has 18 frequency values
487 from 2.5 GHz to 800 MHz with 100 MHz difference between each two successive
490 \caption{Platform File Parameters}
493 \begin{tabular}{ | l | l | l |l | l |l |l | p{2cm} |}
495 Max & Min & Backbone & Backbone&Link &Link& Sharing \\
496 Freq. & Freq. & Bandwidth & Latency & Bandwidth& Latency&Policy \\ \hline
497 2.5 &800 & 2.25 GBps &$5\times 10^{-7} s$& 1 GBps & $5\times 10^{-5}$ s&Full \\
498 GHz& MHz& & & & &Duplex \\\hline
500 \label{table:platform}
502 Depending on the EQ~(\ref{eq:energy}), we measure the energy consumption for all
503 the NAS MPI programs while assuming the power dynamic is equal to 20W and the
504 power static is equal to 4W for all experiments. We run the proposed EPSA
505 algorithm for all these programs. The results showed that the algorithm selected
506 different scaling factors for each program depending on the communication
507 features of the program as in the figure~(\ref{fig:nas}). This figure shows that
508 there are different distances between the normalized energy and the normalized
509 inversed performance curves, because there are different communication features
510 for each MPI program. When there are little or not communications, the inversed
511 performance curve is very close to the energy curve. Then the distance between
512 the two curves is very small. This lead to small energy savings. The opposite
513 happens when there are a lot of communication, the distance between the two
514 curves is big. This lead to more energy savings (e.g. CG and FT), see
515 table~(\ref{table:factors results}). All discovered frequency scaling factors
516 optimize both the energy and the performance simultaneously for all the NAS
517 programs. In table~(\ref{table:factors results}), we record all optimal scaling
518 factors results for each program on class C. These factors give the maximum
519 energy saving percent and the minimum performance degradation percent in the
520 same time over all available scales.
521 \begin{figure}[width=\textwidth,height=\textheight,keepaspectratio]
523 \includegraphics[scale=0.47]{ep.eps}
524 \includegraphics[scale=0.47]{cg.eps}
525 \includegraphics[scale=0.47]{sp.eps}
526 \includegraphics[scale=0.47]{lu.eps}
527 \includegraphics[scale=0.47]{bt.eps}
528 \includegraphics[scale=0.47]{ft.eps}
529 \caption{Optimal scaling factors for The NAS MPI Programs}
532 \begin{table}[width=\textwidth,height=\textheight,keepaspectratio]
533 \caption{Optimal Scaling Factors Results}
536 \AG{Use the same number of decimals for all numbers in a column,
537 and vertically align the numbers along the decimal points.
538 The same for all the following tables.}
539 \begin{tabular}{ | l | l | l |l | l | p{2cm} |}
541 Program & Optimal & Energy & Performance&Energy-Perf.\\
542 Name & Scaling Factor& Saving \%&Degradation \% &Distance \\ \hline
543 CG & 1.56 &39.23&14.88 &24.35\\ \hline
544 MG & 1.47 &34.97&21.70 &13.27 \\ \hline
545 EP & 1.04 &22.14&20.73 &1.41\\ \hline
546 LU & 1.38 &35.83&22.49 &13.34\\ \hline
547 BT & 1.31 &29.60&21.28 &8.32\\ \hline
548 SP & 1.38 &33.48&21.36 &12.12\\ \hline
549 FT & 1.47 &34.72&19.00 &15.72\\ \hline
551 \label{table:factors results}
552 % is used to refer this table in the text
555 As shown in the table~(\ref{table:factors results}), when the optimal scaling
556 factor has big value we can gain more energy savings for example as in CG and
557 FT. The opposite happens when the optimal scaling factor is small value as
558 example BT and EP. Our algorithm selects big scaling factor value when the
559 communication and the other slacks times are big and smaller ones in opposite
560 cases. In EP there are no communications inside the iterations. This make our
561 EPSA to selects smaller scaling factor values (inducing smaller energy savings).
563 \section{Comparing Results}
565 In this section, we compare our EPSA algorithm results with Rauber's
566 methods~\cite{3}. He had two scenarios, the first is to reduce energy to optimal
567 level without considering the performance as in EQ~(\ref{eq:sopt}). We refer to
568 this scenario as $Rauber_{E}$. The second scenario is similar to the first
569 except setting the slower task to the maximum frequency (when the scale $S=1$)
570 to keep the performance from degradation as mush as possible. We refer to this
571 scenario as $Rauber_{E-P}$. The comparison is made in tables~(\ref{table:compare
572 Class A},\ref{table:compare Class B},\ref{table:compare Class C}). These
573 tables show the results of our EPSA and Rauber's two scenarios for all the NAS
574 benchmarks programs for classes A,B and C.
576 \caption{Comparing Results for The NAS Class A}
579 \begin{tabular}{ | l | l | l |l | l | l| }
581 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
582 name &name&value& Saving \%&Degradation \% &Distance
584 % \rowcolor[gray]{0.85}
585 EPSA&CG & 1.56 &37.02 & 13.88 & 23.14\\ \hline
586 $Rauber_{E-P}$&CG &2.14 &42.77 & 25.27 & 17.50\\ \hline
587 $Rauber_{E}$&CG &2.14 &42.77&26.46&16.31\\ \hline
589 EPSA&MG & 1.47 &27.66&16.82&10.84\\ \hline
590 $Rauber_{E-P}$&MG &2.14&34.45&31.84&2.61\\ \hline
591 $Rauber_{E}$&MG &2.14&34.48&33.65&0.80 \\ \hline
593 EPSA&EP &1.19 &25.32&20.79&4.53\\ \hline
594 $Rauber_{E-P}$&EP&2.05&41.45&55.67&-14.22\\ \hline
595 $Rauber_{E}$&EP&2.05&42.09&57.59&-15.50\\ \hline
597 EPSA&LU&1.56& 39.55 &19.38& 20.17\\ \hline
598 $Rauber_{E-P}$&LU&2.14&45.62&27.00&18.62 \\ \hline
599 $Rauber_{E}$&LU&2.14&45.66&33.01&12.65\\ \hline
601 EPSA&BT&1.31& 29.60&20.53&9.07 \\ \hline
602 $Rauber_{E-P}$&BT&2.10&45.53&49.63&-4.10\\ \hline
603 $Rauber_{E}$&BT&2.10&43.93&52.86&-8.93\\ \hline
605 EPSA&SP&1.38& 33.51&15.65&17.86 \\ \hline
606 $Rauber_{E-P}$&SP&2.11&45.62&42.52&3.10\\ \hline
607 $Rauber_{E}$&SP&2.11&45.78&43.09&2.69\\ \hline
609 EPSA&FT&1.25&25.00&10.80&14.20 \\ \hline
610 $Rauber_{E-P}$&FT&2.10&39.29&34.30&4.99 \\ \hline
611 $Rauber_{E}$&FT&2.10&37.56&38.21&-0.65\\ \hline
613 \label{table:compare Class A}
614 % is used to refer this table in the text
617 \caption{Comparing Results for The NAS Class B}
620 \begin{tabular}{ | l | l | l |l | l |l| }
622 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
623 name &name&value& Saving \%&Degradation \% &Distance
625 % \rowcolor[gray]{0.85}
626 EPSA&CG & 1.66 &39.23&16.63&22.60 \\ \hline
627 $Rauber_{E-P}$&CG &2.15 &45.34&27.60&17.74\\ \hline
628 $Rauber_{E}$&CG &2.15 &45.34&28.88&16.46\\ \hline
630 EPSA&MG & 1.47 &34.98&18.35&16.63\\ \hline
631 $Rauber_{E-P}$&MG &2.14&43.55&36.42&7.13 \\ \hline
632 $Rauber_{E}$&MG &2.14&43.56&37.07&6.49 \\ \hline
634 EPSA&EP &1.08 &20.29&17.15&3.14 \\ \hline
635 $Rauber_{E-P}$&EP&2.00&42.38&56.88&-14.50\\ \hline
636 $Rauber_{E}$&EP&2.00&39.73&59.94&-20.21\\ \hline
638 EPSA&LU&1.47&38.57&21.34&17.23 \\ \hline
639 $Rauber_{E-P}$&LU&2.10&43.62&36.51&7.11 \\ \hline
640 $Rauber_{E}$&LU&2.10&43.61&38.54&5.07 \\ \hline
642 EPSA&BT&1.31& 29.59&20.88&8.71\\ \hline
643 $Rauber_{E-P}$&BT&2.10&44.53&53.05&-8.52\\ \hline
644 $Rauber_{E}$&BT&2.10&42.93&52.80&-9.87\\ \hline
646 EPSA&SP&1.38&33.44&19.24&14.20 \\ \hline
647 $Rauber_{E-P}$&SP&2.15&45.69&43.20&2.49\\ \hline
648 $Rauber_{E}$&SP&2.15&45.41&44.47&0.94\\ \hline
650 EPSA&FT&1.38&34.40&14.57&19.83 \\ \hline
651 $Rauber_{E-P}$&FT&2.13&42.98&37.35&5.63 \\ \hline
652 $Rauber_{E}$&FT&2.13&43.04&37.90&5.14\\ \hline
654 \label{table:compare Class B}
655 % is used to refer this table in the text
659 \caption{Comparing Results for The NAS Class C}
662 \begin{tabular}{ | l | l | l |l | l |l| }
664 Method&Program&Factor& Energy& Performance &Energy-Perf.\\
665 name &name&value& Saving \%&Degradation \% &Distance
667 % \rowcolor[gray]{0.85}
668 EPSA&CG & 1.56 &39.23&14.88&24.35 \\ \hline
669 $Rauber_{E-P}$&CG &2.15 &45.36&25.89&19.47\\ \hline
670 $Rauber_{E}$&CG &2.15 &45.36&26.70&18.66\\ \hline
672 EPSA&MG & 1.47 &34.97&21.69&13.27\\ \hline
673 $Rauber_{E-P}$&MG &2.15&43.65&40.45&3.20 \\ \hline
674 $Rauber_{E}$&MG &2.15&43.64&41.38&2.26 \\ \hline
676 EPSA&EP &1.04 &22.14&20.73&1.41 \\ \hline
677 $Rauber_{E-P}$&EP&1.92&39.40&56.33&-16.93\\ \hline
678 $Rauber_{E}$&EP&1.92&38.10&56.35&-18.25\\ \hline
680 EPSA&LU&1.38&35.83&22.49&13.34 \\ \hline
681 $Rauber_{E-P}$&LU&2.15&44.97&41.00&3.97 \\ \hline
682 $Rauber_{E}$&LU&2.15&44.97&41.80&3.17 \\ \hline
684 EPSA&BT&1.31& 29.60&21.28&8.32\\ \hline
685 $Rauber_{E-P}$&BT&2.13&45.60&49.84&-4.24\\ \hline
686 $Rauber_{E}$&BT&2.13&44.90&55.16&-10.26\\ \hline
688 EPSA&SP&1.38&33.48&21.35&12.12\\ \hline
689 $Rauber_{E-P}$&SP&2.10&45.69&43.60&2.09\\ \hline
690 $Rauber_{E}$&SP&2.10&45.75&44.10&1.65\\ \hline
692 EPSA&FT&1.47&34.72&19.00&15.72 \\ \hline
693 $Rauber_{E-P}$&FT&2.04&39.40&37.10&2.30\\ \hline
694 $Rauber_{E}$&FT&2.04&39.35&37.70&1.65\\ \hline
696 \label{table:compare Class C}
697 % is used to refer this table in the text
699 As shown in these tables our scaling factor is not optimal for energy saving
700 such as Rauber's scaling factor EQ~(\ref{eq:sopt}), but it is optimal for both
701 the energy and the performance simultaneously. Our EPSA optimal scaling factors
702 has better simultaneous optimization for both the energy and the performance
703 compared to Rauber's energy-performance method ($Rauber_{E-P}$). Also, in
704 ($Rauber_{E-P}$) method when setting the frequency to maximum value for the
705 slower task lead to a small improvement of the performance. Also the results
706 show that this method keep or improve energy saving. Because of the energy
707 consumption decrease when the execution time decreased while the frequency value
710 Figure~(\ref{fig:compare}) shows the maximum distance between the energy saving
711 percent and the performance degradation percent. Therefore, this means it is the
712 same resultant of our objective function EQ~(\ref{eq:max}). Our algorithm always
713 gives positive energy to performance trade offs while Rauber's method
714 ($Rauber_{E-P}$) gives in some time negative trade offs such as in BT and
715 EP. The positive trade offs with highest values lead to maximum energy savings
716 concatenating with less performance degradation and this the objective of this
717 paper. While the negative trade offs refers to improving energy saving (or may
718 be the performance) while degrading the performance (or may be the energy) more
720 \begin{figure}[width=\textwidth,height=\textheight,keepaspectratio]
722 \includegraphics[scale=0.60]{compare_class_A.pdf}
723 \includegraphics[scale=0.60]{compare_class_B.pdf}
724 \includegraphics[scale=0.60]{compare_class_c.pdf}
725 % use scale 35 for all to be in the same line
726 \caption{Comparing Our EPSA with Rauber's Methods}
733 \AG{the conclusion needs to be written\dots{} one day}
735 \section*{Acknowledgment}
737 Computations have been performed on the supercomputer facilities of the
738 Mésocentre de calcul de Franche-Comté.
740 \bibliographystyle{plain}
741 \bibliography{my_reference}
748 %%%ispell-local-dictionary: "american"
751 % LocalWords: Badri Charr FIXME Tianhe DVFS HPC NAS NPB SMPI Rauber's Rauber
752 % LocalWords: CMOS EQ EPSA