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