1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 \chapter{Energy Optimization of Heterogeneous Platforms}
9 \newcommand{\CL}{\Xsub{C}{L}}
10 \newcommand{\Dist}{\mathit{Dist}}
11 \newcommand{\EdNew}{\Xsub{E}{dNew}}
12 \newcommand{\Eind}{\Xsub{E}{ind}}
13 \newcommand{\Enorm}{\Xsub{E}{Norm}}
14 \newcommand{\Eoriginal}{\Xsub{E}{Original}}
15 \newcommand{\Ereduced}{\Xsub{E}{Reduced}}
16 \newcommand{\Es}{\Xsub{E}{S}}
17 \newcommand{\Fdiff}[1][]{\Xsub{F}{diff}_{\!#1}}
18 \newcommand{\Fmax}[1][]{\Xsub{F}{max}_{\fxheight{#1}}}
19 \newcommand{\Fnew}{\Xsub{F}{new}}
20 \newcommand{\Ileak}{\Xsub{I}{leak}}
21 \newcommand{\Kdesign}{\Xsub{K}{design}}
22 \newcommand{\MaxDist}{\mathit{Max}\Dist}
23 \newcommand{\MinTcm}{\mathit{Min}\Tcm}
24 \newcommand{\Ntrans}{\Xsub{N}{trans}}
25 \newcommand{\Pd}[1][]{\Xsub{P}{d}_{\fxheight{#1}}}
26 \newcommand{\PdNew}{\Xsub{P}{dNew}}
27 \newcommand{\PdOld}{\Xsub{P}{dOld}}
28 \newcommand{\Pnorm}{\Xsub{P}{Norm}}
29 \newcommand{\Ps}[1][]{\Xsub{P}{s}_{\fxheight{#1}}}
30 \newcommand{\Scp}[1][]{\Xsub{S}{cp}_{#1}}
31 \newcommand{\Sopt}[1][]{\Xsub{S}{opt}_{#1}}
32 \newcommand{\Tcm}[1][]{\Xsub{T}{cm}_{\fxheight{#1}}}
33 \newcommand{\Tcp}[1][]{\Xsub{T}{cp}_{#1}}
34 \newcommand{\TcpOld}[1][]{\Xsub{T}{cpOld}_{#1}}
35 \newcommand{\Tnew}{\Xsub{T}{New}}
36 \newcommand{\Told}{\Xsub{T}{Old}}
37 \newcommand{\Pmax}[1][]{\Xsub{P}{max}_{\fxheight{#1}}}
38 \newcommand{\Pidle}[1][]{\Xsub{P}{idle}_{\fxheight{#1}}}
41 \renewcommand{\algorithmicdo}{\textbf{do}}
42 \renewcommand{\algorithmicwhile}{\textbf{while}}
43 \renewcommand{\algorithmicrequire}{\textbf{Require:}}
44 \renewcommand{\algorithmicensure}{\textbf{Ensure:}}
45 \renewcommand{\algorithmicend}{\textbf{end}}
46 \renewcommand{\algorithmicif}{\textbf{if}}
47 \renewcommand{\algorithmicthen}{\textbf{then}}
49 \section{Introduction}
53 Computing platforms are consuming more and more energy due to the increasing
54 number of nodes composing them. In a heterogeneous computing platform composed
55 of multiple computing nodes, nodes may differ in the computing power from
56 each others. Accordingly, the fast nodes have to wait for the slow ones to finish
57 their works. The resulting waiting times are called idle times which are increased
58 proportionally to the increase in the heterogeneity between the computing nodes.
59 This leads to a big waste in the computing power and thus the energy consumed by fast nodes.
60 To minimize the operating costs of these platforms many techniques have been used.
61 Dynamic voltage and frequency scaling (DVFS) is one of them. It reduces the frequency
62 of a CPU to lower its energy consumption. However, lowering the frequency of a CPU may
63 increase the execution time of an application running on that processor. Therefore,
64 the frequency that gives the best trade-off between the energy consumption and
65 the performance of an application must be selected.
67 In this chapter, two new online frequency selecting algorithms for heterogeneous local
68 clusters (heterogeneous CPUs) and grid platforms are presented.
69 They select the frequencies that try to give the best
70 trade-off between energy saving and performance degradation, for each node
71 computing the synchronous message passing application with iterations. These algorithms have a small
72 overhead and work without training or profiling. They use new energy models
73 for message passing synchronous applications with iterations running on both the heterogeneous
74 local cluster and the grid platform. The first proposed algorithm for a heterogeneous local
75 cluster was evaluated on the SimGrid simulator while running the class C of the NAS parallel
76 benchmarks. The experiments conducted over 8 heterogeneous nodes show that it reduces on
77 average the energy consumption by 29.8\% while limiting the performance degradation to 3.8\%.
78 The second proposed algorithm for a grid platform was evaluated on the Grid5000 testbed
79 platform while running the class D of the NAS parallel benchmarks.
80 The experiments were run on 16 nodes, distributed on three clusters, and show that the algorithm reduces
81 on average the energy consumption by 30\% while the performance is on average only degraded
83 Finally, both algorithms were compared to the EDP method. The comparison
84 results show that they outperform the latter in the energy reduction and performance trade-off.
87 This chapter is organized as follows: Section~\ref{ch3:relwork} presents some
88 related works from other authors. Section~\ref{ch3:1} presents the performance and energy
89 models of synchronous message passing programs running over a heterogeneous local cluster.
90 It also describes the proposed frequency selecting algorithm then the precision of the proposed algorithm is verified.
91 Section~\ref{ch3:2} presents the simulation results of applying the algorithm on the NAS parallel
92 benchmarks class C and executing them on a heterogeneous local cluster. It shows the results of running
93 three different power scenarios and comparing them. Moreover, it also shows the
94 comparison results between the proposed method and an existing method.
95 Section~\ref{ch3:3} shows the energy and performance models in addition to the frequencies
96 selecting algorithm of synchronous message passing programs running over a grid platform.
97 Section~\ref{ch3:4} presents the results of applying the algorithm on the
98 NAS parallel benchmarks (class D) and executing them on the Grid'5000 testbed.
99 The algorithm is also evaluated over multi-core architectures and over three different power scenarios. Moreover, Section~\ref{ch3:4}, shows the comparison results between the proposed method and the EDP method.
100 Finally, in Section~\ref{ch3:concl} the chapter ends with a summary.
102 \section{Related works}
105 The process of selecting the appropriate frequency for a
106 processor to satisfy some objectives, while taking into account all the
107 constraints, is not a trivial operation. Many researchers used different
108 strategies to tackle this problem. Some of them developed online methods that
109 compute the new frequency while executing the application, such
110 as~\cite{ref64,ref67}.
111 Others used offline methods that may need to run the application and profile
112 it before selecting the new frequency, such
113 as~\cite{ref58,ref91}.
114 The methods could be heuristics, exact or brute force methods that satisfy
115 varied objectives such as energy reduction or performance. They also could be
116 adapted to the execution's environment and the type of the application such as
117 sequential, parallel or distributed architecture, homogeneous or heterogeneous
118 platform, synchronous or asynchronous application, \dots{}
120 In this chapter, we are interested in reducing the energy consumption when running a message passing
121 synchronous applications with iterations over a heterogeneous platform. Some
122 works have already been done for such platforms which can be classified into
123 two types of heterogeneous platforms:
125 \item the platform is composed of homogeneous GPUs and homogeneous CPUs.
126 \item the platform is only composed of heterogeneous CPUs.
129 For the first type of platform, the computing intensive parallel tasks are
130 executed on the GPUs and the rest are executed on the CPUs. Luley et
131 al.~\cite{ref68}, proposed a
132 heterogeneous cluster composed of Intel Xeon CPUs and NVIDIA GPUs. Their main
133 goal was to maximize the energy efficiency of the platform during computation by
134 maximizing the number of FLOPS per watt generated.
135 In~\cite{ref69}, Kai Ma et al. developed a scheduling algorithm that distributes
136 workloads proportional to
137 the computing power of the nodes which could be a GPU or a CPU. All the tasks
138 must be completed at the same time. In~\cite{ref70},
139 Rong et al. showed that a heterogeneous (GPUs and CPUs) cluster that enables
140 DVFS operations gave better energy and performance efficiency than other clusters only
143 The work presented in this chapter concerns the second type of platform, with
144 heterogeneous CPUs. Many methods were conceived to reduce the energy
145 consumption of this type of platform. Naveen et
146 al.~\cite{ref71} developed a method that
147 minimizes the value of $\mathit{energy}\times \mathit{delay}^2$ (the delay is
148 the sum of slack times that happen during synchronous communications) by
149 dynamically assigning new frequencies to the CPUs of the heterogeneous cluster.
150 Lizhe et al.~\cite{ref72} proposed an
151 algorithm that divides the executed tasks into two types: the critical and non
152 critical tasks. The algorithm scales down the frequency of non critical tasks
153 proportionally to their slack and communication times while limiting the
154 performance degradation percentage to less than 10\%.
155 In~\cite{ref73}, they developed a
156 heterogeneous cluster composed of two types of Intel and AMD processors. They
157 use a gradient method to predict the impact of DVFS operations on performance.
159 \cite{ref75}, the best
160 frequencies for a specified heterogeneous cluster are selected offline using
161 on heuristic. Chen et
162 al.~\cite{ref76} used a greedy dynamic
163 programming approach to minimize the power consumption of heterogeneous servers
164 while respecting the given time constraint. This approach had considerable
165 overhead. In contrast to the above described works, the work of this chapter presents the
166 following contributions:
168 \item two new energy and two performance models for message passing
169 synchronous applications with iterations running over a heterogeneous local cluster and a grid platform.
170 All the models take into account the communications and the slack times. The models can predict the
171 energy consumption and the execution time of the application.
173 \item two new online frequencies selecting algorithms for a heterogeneous
174 local cluster and a grid platform. The algorithms have a very small overhead and do not need any
175 training or profiling. They use a new optimization function which
176 simultaneously maximizes the performance and minimizes the energy consumption
177 of a message passing synchronous application with iterations.
180 \section[The energy optimization of a heterogeneous cluster]{The energy optimization of parallel applications with iterations running over local heterogeneous
184 \subsection{The execution time of message passing distributed
185 applications with iterations on a heterogeneous local cluster}
187 In this section, we are interested in reducing the energy consumption of message
188 passing distributed synchronous applications with iterations running over heterogeneous local clusters.
189 In this work, a heterogeneous local cluster is defined as a collection of
190 heterogeneous computing nodes interconnected via a high speed homogeneous
191 network. Therefore, the nodes may have different characteristics such as computing
192 power (FLOPS), energy consumption, CPU's frequency range, \dots{} but they all
193 have the same network bandwidth and latency.
197 \includegraphics[scale=0.8]{fig/ch3/commtasks}
198 \caption{Parallel tasks on a heterogeneous platform}
199 \label{fig:task-heter}
202 The overall execution time of a distributed synchronous application with iterations
203 over a heterogeneous local cluster consists of the sum of the computation time and
204 the communication time for every iteration on a node. However, due to the
205 heterogeneous computation power of the computing nodes, slack times may occur
206 when fast nodes have to wait, during synchronous communications, for the slower
207 nodes to finish their computations (see Figure~\ref{fig:task-heter}). Therefore, the
208 overall execution time of the program is the execution time of the slowest task
209 which has the highest computation time and no slack time.
211 Reducing the frequency of a processor by applying DVFS operation can be expressed by the scaling
212 factor S which is the ratio between the maximum frequency and the new frequency of a CPU
214 The execution time of a compute bound sequential program is linearly
215 proportional to the frequency scaling factor $S$. On the other hand, message
216 passing distributed applications consist of two parts: computation and
217 communication. The execution time of the computation part is linearly
218 proportional to the frequency scaling factor $S$ but the communication time is
219 not affected by the scaling factor because the processors involved remain idle
220 during the communications~\cite{ref53}. The
221 communication time for a task is the summation of periods of time that begin
222 with an MPI call for sending or receiving a message until the message is
223 synchronously sent or received.
225 Since in a heterogeneous cluster the nodes may have different characteristics,
226 especially different frequency gears, when applying DVFS operations on these
227 nodes, they may get different scaling factors represented by a scaling vector:
228 $(S_1, S_2,\dots, S_N)$ where $S_i$ is the scaling factor of processor $i$. To
229 be able to predict the execution time of message passing synchronous
230 applications with iterations running over a heterogeneous local cluster, for different vectors of
231 scaling factors, the communication time and the computation time for all the
232 tasks must be measured during the first iteration before applying any DVFS
233 operation. Then the execution time for one iteration of the application with any
234 vector of scaling factors can be predicted using (\ref{eq:perf_heter}).
236 \label{eq:perf_heter}
237 \Tnew = \max_{i=1,2,\dots,N} ({\TcpOld[i]} \cdot S_{i}) + \min_{i=1,2,\dots,N} (\Tcm[i])
240 where $\TcpOld[i]$ is the computation time of processor $i$ during the first
241 iteration. The model computes the maximum computation time with
242 scaling factor from each node added to the communication time of the slowest
243 node. It means only the communication time without any slack time is taken into
244 account. Therefore, the execution time of the application with iterations is equal to
245 the execution time of one iteration as in (\ref{eq:perf_heter}) multiplied by the
246 number of iterations of that application.
248 This prediction model is improved from the model that predicts the execution time
249 of message passing distributed applications for homogeneous
250 architectures presented in Chapter \ref{ch2} Section \ref{ch2:3}. The execution time prediction model is
251 used in the method that optimizes both the energy consumption and the performance
252 of parallel application with iterations, which is presented in the following sections.
254 \subsection{Energy model for heterogeneous local cluster}
256 In Chapter \ref{ch2}, the dynamic and the static energy consumption of a
257 processor is computed according to Equations \ref{eq:Edyn_new} and \ref{eq:Estatic_new} respectively. Then, the total energy consumption of a processor is the sum of these two metrics.
258 Therefore, the overall energy consumption for the parallel tasks over a parallel cluster
259 is the summation of the energies consumed by all the processors.
261 In the considered heterogeneous platform, each processor $i$ may have
262 different dynamic and static powers, noted as $\Pd[i]$ and $\Ps[i]$
263 respectively. Therefore, even if the distributed message passing
264 application with iterations is load balanced, the computation time of each CPU $i$ noted
265 $\Tcp[i]$ may be different and different frequency scaling factors may be
266 computed in order to decrease the overall energy consumption of the application
267 and reduce the slack times. The communication time of a processor $i$ is noted as
268 $\Tcm[i]$ and could contain slack times when communicating with slower nodes,
269 see Figure~\ref{fig:task-heter}. Therefore, all the nodes do not have equal
270 communication times. While the dynamic energy is computed according to the
271 frequency scaling factor and the dynamic power of each node as in
272 (\ref{eq:Edyn_new}), the static energy is computed as the sum of the execution time
273 of one iteration as in \ref{eq:perf_heter} multiplied by the static power of each processor.
274 The overall energy consumption of a message passing distributed application executed over a
275 heterogeneous cluster during one iteration is the summation of the dynamic and
276 static energies for all the processors. It is computed as follows:
278 \label{eq:energy-heter}
279 E = \sum_{i=1}^{N} {(S_i^{-2} \cdot \Pd[i] \cdot \Tcp[i])} +
280 \sum_{i=1}^{N} (\Ps[i] \cdot (\max_{i=1,2,\dots,N} (\Tcp[i] \cdot S_{i}) +
281 { \min_{i=1,2,\dots,N} (\Tcm[i]) ))}
284 Reducing the frequencies of the processors according to the vector of scaling
285 factors $(S_1, S_2,\dots, S_N)$ may degrade the performance of the application
286 and thus, increase the consumed static energy because the execution time is
287 increased~\cite{ref78}. The overall energy consumption
288 for an application with iterations can be measured by measuring the energy
289 consumption for one iteration as in (\ref{eq:energy-heter}) multiplied by the number
290 of iterations of that application.
292 \subsection{Optimization of both energy consumption and performance}
294 Using the lowest frequency for each processor does not necessarily give the most
295 energy efficient execution of an application. Indeed, even though the dynamic
296 power is reduced while scaling down the frequency of a processor, its
297 computation power is proportionally decreased. Hence, the execution time might
298 be drastically increased and during that time, dynamic and static powers are
299 being consumed. Therefore, it might cancel any gains achieved by scaling down
300 the frequency of all nodes to the minimum and the overall energy consumption of
301 the application might not be the optimal one. It is not trivial to select the
302 appropriate frequency scaling factor for each processor while considering the
303 characteristics of each processor (computation power, range of frequencies,
304 dynamic and static powers) and the task it is executing (computation/communication
305 ratio). In Chapter~\ref{ch2}, we proposed a method that selects the optimal
306 frequency scaling factor for a homogeneous cluster executing a message passing
307 synchronous application with iterations while giving the best trade-off between the
308 energy consumption and the performance for such applications.
309 In this section, this optimization method is improved while considering a heterogeneous clusters.
311 As described before, the relation between the energy consumption and the execution time for an
312 application is complex and nonlinear. Thus, to find the trade-off relation between the energy consumption computed in Equation \ref{eq:energy-heter} and the performance with Equation \ref{eq:perf_heter} for the message passing applications with iterations, first we need to normalize both terms as follows:
316 \label{eq:enorm-heter}
317 \Enorm = \frac{\Ereduced}{\Eoriginal}
318 = \frac{ \sum_{i=1}^{N}{(S_i^{-2} \cdot \Pd[i] \cdot \Tcp[i])} +
319 \sum_{i=1}^{N} {(\Ps[i] \cdot \Tnew)}}{\sum_{i=1}^{N}{( \Pd[i] \cdot \Tcp[i])} +
320 \sum_{i=1}^{N} {(\Ps[i] \cdot \Told)}}
326 \label{eq:pnorm-heter}
327 \Pnorm = \frac{\Told}{\Tnew}
328 = \frac{\max_{i=1,2,\dots,N}{(\Tcp[i]+\Tcm[i])}}
329 { \max_{i=1,2,\dots,N} (\Tcp[i] \cdot S_{i}) + \min_{i=1,2,\dots,N} (\Tcm[i])}
335 \includegraphics[width=.7\textwidth]{fig/ch3/heter}
336 \caption{The energy and performance relation in heterogeneous cluster}
337 \label{fig:rel-heter}
340 Then, the objective function can be modeled in order to find the maximum
341 distance between the energy curve (\ref{eq:enorm-heter}) and the performance curve
342 (\ref{eq:pnorm-heter}) over all available sets of scaling factors for the processors of the heterogeneous
343 cluster. This represents the minimum energy consumption with minimum execution time (maximum
344 performance) at the same time, see Figure~\ref{fig:rel-heter}. Then the objective function has the following form:
348 \mathop{\max_{i=1,\dots N}}_{j=1,\dots,F_i}
349 (\overbrace{\Pnorm(S_{ij})}^{\text{Maximize}} -
350 \overbrace{\Enorm(S_{ij})}^{\text{Minimize}} )
352 where $N$ is the number of nodes and $F_i$ is the number of available frequencies
353 for the node $i$. Then, the set of scaling factors that maximizes the objective function
354 (\ref{eq:max-heter}) should be selected.
356 \subsection[The scaling algorithm for heterogeneous cluster]{The scaling factors selection algorithm for heterogeneous cluster }
360 \begin{algorithm}[h!]
361 \begin{algorithmic}[1]
365 \item[{$\Tcp[i]$}] array of all computation times for all nodes during one iteration and with highest frequency.
366 \item[{$\Tcm[i]$}] array of all communication times for all nodes during one iteration and with highest frequency.
367 \item[{$\Fmax[i]$}] array of the maximum frequencies for all nodes.
368 \item[{$\Pd[i]$}] array of the dynamic powers for all nodes.
369 \item[{$\Ps[i]$}] array of the static powers for all nodes.
370 \item[{$\Fdiff[i]$}] array of the differences between two successive frequencies for all nodes.
372 \Ensure $\Sopt[1],\Sopt[2] \dots, \Sopt[N]$ is a vector of optimal scaling factors
374 \State $\Scp[i] \gets \frac{\max_{i=1,2,\dots,N}(\Tcp[i])}{\Tcp[i]} $
375 \State $F_{i} \gets \frac{\Fmax[i]}{\Scp[i]},~{i=1,2,\cdots,N}$
376 \State Round the computed initial frequencies $F_i$ to the closest one available in each node.
377 \If{(not the first frequency)}
378 \State $F_i \gets F_i+\Fdiff[i],~i=1,\dots,N.$
380 \State $\Told \gets \max_{i=1,\dots,N} (\Tcp[i]+\Tcm[i])$
381 % \State $\Eoriginal \gets \sum_{i=1}^{N}{( \Pd[i] \cdot \Tcp[i])} +\sum_{i=1}^{N} {(\Ps[i] \cdot \Told)}$
382 \State $\Eoriginal \gets \sum_{i=1}^{N}{( \Pd[i] \cdot \Tcp[i] + \Ps[i] \cdot \Told)}$
383 \State $\Sopt[i] \gets 1,~i=1,\dots,N. $
384 \State $\Dist \gets 0 $
385 \While {(all nodes not reach their minimum frequency)}
386 \If{(not the last freq. \textbf{and} not the slowest node)}
387 \State $F_i \gets F_i - \Fdiff[i],~i=1,\dots,N.$
388 \State $S_i \gets \frac{\Fmax[i]}{F_i},~i=1,\dots,N.$
390 \State $\Tnew \gets \max_{i=1,2,\dots,N} ({\TcpOld[i]} \cdot S_{i}) + \min_{i=1,2,\dots,N} (\Tcm[i])$
391 % \State $\Ereduced \gets \sum_{i=1}^{N}{(S_i^{-2} \cdot \Pd[i] \cdot \Tcp[i])} + \sum_{i=1}^{N} {(\Ps[i] \cdot \rlap{\Tnew)}} $
392 \State $\Ereduced \gets \sum_{i=1}^{N} {(S_i^{-2} \cdot \Pd[i] \cdot \Tcp[i])} +
393 \sum_{i=1}^{N} (\Ps[i] \cdot (\max_{i=1,2,\dots,N} (\Tcp[i] \cdot S_{i}) +
394 { \min_{i=1,2,\dots,N} (\Tcm[i]) ))} $
395 \State $\Pnorm \gets \frac{\Told}{\Tnew}$
396 \State $\Enorm\gets \frac{\Ereduced}{\Eoriginal}$
397 \If{$(\Pnorm - \Enorm > \Dist)$}
398 \State $\Sopt[i] \gets S_{i},~i=1,\dots,N. $
399 \State $\Dist \gets \Pnorm - \Enorm$
402 \State Return $\Sopt[1],\Sopt[2],\dots,\Sopt[N]$
404 \caption{Scaling factors selection algorithm for heterogeneous cluster}
410 \begin{algorithm}[h!]
411 \begin{algorithmic}[1]
413 \For {$k=1$ to \textit{some iterations}}
414 \State Computations section.
415 \State Communications section.
417 \State Gather all times of computation and communication from each node.
418 \State Call Algorithm \ref{HSA}.
419 \State Compute the new frequencies from the returned optimal scaling factors.
420 \State Set the new frequencies to nodes.
424 \caption{DVFS algorithm of heterogeneous platform}
430 In this section, Algorithm~\ref{HSA} is presented. It selects the frequency
431 scaling factors vector that gives the best trade-off between minimizing the
432 energy consumption and maximizing the performance of a message passing
433 synchronous application with iterations executed on a heterogeneous local cluster. It works
434 online during the execution time of the message passing program with iterations. It
435 uses information gathered during the first iteration such as the computation
436 time and the communication time in one iteration for each node. The algorithm is
437 executed after the first iteration and returns a vector of optimal frequency
438 scaling factors that satisfies the objective function (\ref{eq:max-heter}). The
439 program applies DVFS operations to change the frequencies of the CPUs according
440 to the computed scaling factors. This algorithm is called just once during the
441 execution of the program. Algorithm~\ref{dvfs-heter} shows where and when the proposed
442 scaling algorithm is called in the MPI program with iterations.
446 \includegraphics[scale=0.75]{fig/ch3/start_freq}
447 \caption{Selecting the initial frequencies in heterogeneous cluster}
448 \label{fig:st_freq-cluster}
451 The nodes in a heterogeneous cluster may have different computing powers.
452 The algorithm takes into account this
453 problem and tries to reduce these slack times when selecting the frequency
454 scaling factors vector. At first, it selects initial frequency scaling factors
455 that increase the execution times of fast nodes and minimize the differences
456 between the computation times of the fast nodes and the slow ones. The value of the initial
457 frequency scaling factor for each node is inversely proportional to its
458 computation time that was gathered from the first iteration. These initial
459 frequency scaling factors are computed as a ratio between the computation time
460 of the slowest node and the computation time of the node $i$ as follows:
463 \Scp[i] = \frac{\max_{i=1,2,\dots,N}(\Tcp[i])}{\Tcp[i]}
465 Using the initial frequency scaling factors computed in (\ref{eq:Scp}), the
466 algorithm computes the initial frequencies for all nodes as a ratio between the
467 maximum frequency of node $i$ and the computed scaling factor $\Scp[i]$ as
471 F_{i} = \frac{\Fmax[i]}{\Scp[i]},~{i=1,2,\dots,N}
473 If the computed initial frequency for a node is not available in the gears of
474 that node, it is replaced by the nearest available frequency. In
475 Figure~\ref{fig:st_freq-cluster}, the nodes are sorted by their computing power in
476 ascending order and the frequencies of the faster nodes are scaled down
477 according to the computed initial frequency scaling factors. The resulting new
478 frequencies are highlighted in Figure~\ref{fig:st_freq-cluster}. This set of
479 frequencies can be considered as a higher bound for the search space of the
480 optimal vector of frequencies because selecting scaling factors higher
481 than the higher bound will not improve the performance of the application and it
482 will increase its overall energy consumption. Therefore the algorithm that
483 selects the frequency scaling factors starts the search method from these
484 initial frequencies and takes a downward search direction toward lower
485 frequencies. The algorithm iterates on all remaining frequencies, from the higher
486 bound until all nodes reach their minimum frequencies, to compute their overall
487 energy consumption and performance, and select the optimal frequency scaling
488 factors vector. At each iteration the algorithm determines the slowest node
489 according to Equation (\ref{eq:perf_heter}) and keeps its frequency unchanged,
490 while it lowers the frequency of all other nodes by one gear. The new overall
491 energy consumption and execution time are computed according to the new scaling
492 factors. The optimal set of frequency scaling factors is the set that gives the
493 highest distance according to the objective function (\ref{eq:max-heter}).
495 Figure~\ref{fig:rel-heter} illustrates the normalized performance and
496 consumed energy for an application running on a
497 heterogeneous cluster while increasing the scaling factors. It can
498 be noticed that in a homogeneous cluster, as in the figure \ref{fig:rel} (a),
499 the search for the optimal scaling
500 factor should start from the maximum frequency because the performance and the
501 consumed energy decrease from the beginning of the plot. On the other hand, in
502 the heterogeneous cluster the performance is maintained at the beginning of the
503 plot even if the frequencies of the faster nodes decrease until the computing
504 power of scaled down nodes are lower than the slowest node. In other words,
505 until they reach the higher bound. It can also be noticed that the higher the
506 difference between the faster nodes and the slower nodes is, the bigger the
507 maximum distance between the energy curve and the performance curve is which results in bigger energy savings.
509 \subsection{The evaluation of the proposed algorithm}
511 The accuracy of the proposed algorithm mainly depends on the execution time
512 prediction model defined in (\ref{eq:perf_heter}) and the energy model computed by Equation
513 (\ref{eq:energy-heter}). The energy model is also significantly dependent on the
514 execution time model because the static energy is linearly related to the
515 execution time and the dynamic energy is related to the computation time. So,
516 all the works presented in this chapter are based on the execution time model. To
517 verify this model, the predicted execution time was compared to the real
518 execution time over SimGrid/SMPI simulator,
519 v3.10~\cite{ref66}, for all the NAS
520 parallel benchmarks NPB v3.3 \cite{ref65}, running class B on
521 8 or 9 nodes. The comparison showed that the proposed execution time model is
522 very accurate, the maximum normalized difference between the predicted execution
523 time and the real execution time is equal to 0.03 for all the NAS benchmarks.
525 Since the proposed algorithm is not an exact method, it does not test all the
526 possible solutions (vectors of scaling factors) in the search space. To prove
527 its efficiency, it was compared on small instances to a brute force search
528 algorithm that tests all the possible solutions. The brute force algorithm was
529 applied to different NAS benchmarks classes with different number of nodes. The
530 solutions returned by the brute force algorithm and the proposed algorithm were
531 identical and the proposed algorithm was on average 10 times faster than the
532 brute force algorithm. It has a small execution time: for a heterogeneous
533 cluster composed of four different types of nodes having the characteristics
534 presented in Table~\ref{table:platform-cluster}, it takes on average 0.04 \textit{ms} for 4
535 nodes and 0.15 \textit{ms} on average for 144 nodes to compute the best scaling
536 factors vector. The algorithm complexity is $O(F_i \cdot N)$, where $F_i$ is the
537 maximum number of available frequencies in the node $i$, and $N$ is the number of computing
538 nodes. The algorithm needs from 12 to 20 iterations to select the best vector of
539 frequency scaling factors that gives the results of the next sections.
542 \caption{Heterogeneous nodes characteristics}
545 \begin{tabular}{|*{7}{r|}}
547 Node & Simulated & Max & Min & Diff. & Dynamic & Static \\
548 type & GFLOPS & Freq. & Freq. & Freq. & power & power \\
549 & & GHz & GHz & GHz & & \\
551 1 & 40 & 2.50 & 1.20 & 0.100 & 20 W & 4 W \\
553 2 & 50 & 2.66 & 1.60 & 0.133 & 25 W & 5 W \\
555 3 & 60 & 2.90 & 1.20 & 0.100 & 30 W & 6 W \\
557 4 & 70 & 3.40 & 1.60 & 0.133 & 35 W & 7 W \\
560 \label{table:platform-cluster}
563 \section{Experimental results over a heterogeneous local cluster}
565 To evaluate the efficiency and the overall energy consumption reduction of
566 Algorithm~\ref{HSA}, it was applied to the NAS parallel benchmarks NPB v3.3 which
567 is composed of synchronous message passing applications. The
568 experiments were executed on the simulator SimGrid/SMPI which offers easy tools
569 to create a heterogeneous local cluster and run message passing applications over it.
570 The heterogeneous cluster that was used in the experiments, had one core per
571 node because just one process was executed per node. The heterogeneous cluster
572 was composed of four types of nodes. Each type of nodes had different
573 characteristics such as the maximum CPU frequency, the number of available
574 frequencies and the computational power, see Table~\ref{table:platform-cluster}. The
575 characteristics of these different types of nodes are inspired from the
576 specifications of real Intel processors. The heterogeneous cluster had up to
577 144 nodes and had nodes from the four types in equal proportions, for example if
578 a benchmark was executed on 8 nodes, 2 nodes from each type were used. Since the
579 constructors of CPUs do not specify the dynamic and the static power of their
580 CPUs, for each type of node they were chosen proportionally to their computing
581 powers (FLOPS). The dynamic power corresponds to 80\% of the overall power consumption while executing at
582 the higher frequency and the
583 remaining 20\% is the static power. The same assumption was made in Chapter \ref{ch2} and
584 \cite{ref3}. Finally, These nodes were connected via an Ethernet network with 1 \textit{Gbit/s} bandwidth.
587 \subsection{The experimental results of the scaling algorithm }
590 The proposed algorithm was applied to the seven parallel NAS benchmarks (EP, CG,
591 MG, FT, BT, LU and SP). The benchmarks were executed with class C while being
592 run on different number of nodes, ranging from 8 to 128 or 144 nodes depending
593 on the benchmark being executed.
594 Indeed, the benchmarks CG, MG, LU, EP and FT had to be executed on 1,
595 2, 4, 8, 16, 32, 64, or 128 nodes. The other benchmarks such as BT and SP had
596 to be executed on 1, 4, 9, 16, 36, 64, or 144 nodes.
601 \caption{Running NAS benchmarks on 8 and 9 nodes }
604 \begin{tabular}{|*{7}{r|}}
607 Program & Execution & Energy & Energy & Performance & Distance \\
608 name & time/s & consumption/J & saving\% & degradation\% & \\
610 CG & 36.11 & 3263.49 & 31.25 & 7.12 & 24.13 \\
612 MG & 8.99 & 953.39 & 33.78 & 6.41 & 27.37 \\
614 EP & 40.39 & 5652.81 & 27.04 & 0.49 & 26.55 \\
616 LU & 218.79 & 36149.77 & 28.23 & 0.01 & 28.22 \\
618 BT & 166.89 & 23207.42 & 32.32 & 7.89 & 24.43 \\
620 SP & 104.73 & 18414.62 & 24.73 & 2.78 & 21.95 \\
622 FT & 51.10 & 4913.26 & 31.02 & 2.54 & 28.48 \\
630 \caption{Running NAS benchmarks on 16 nodes }
633 \begin{tabular}{|*{7}{r|}}
636 Program & Execution & Energy & Energy & Performance & Distance \\
637 name & time/s & consumption/J & saving\% & degradation\% & \\
639 CG & 31.74 & 4373.90 & 26.29 & 9.57 & 16.72 \\
641 MG & 5.71 & 1076.19 & 32.49 & 6.05 & 26.44 \\
643 EP & 20.11 & 5638.49 & 26.85 & 0.56 & 26.29 \\
645 LU & 144.13 & 42529.06 & 28.80 & 6.56 & 22.24 \\
647 BT & 97.29 & 22813.86 & 34.95 & 5.80 & 29.15 \\
649 SP & 66.49 & 20821.67 & 22.49 & 3.82 & 18.67 \\
651 FT & 37.01 & 5505.60 & 31.59 & 6.48 & 25.11 \\
654 \label{table:res_16n}
659 \caption{Running NAS benchmarks on 32 and 36 nodes }
662 \begin{tabular}{|*{7}{r|}}
665 Program & Execution & Energy & Energy & Performance & Distance \\
666 name & time/s & consumption/J & saving\% & degradation\% & \\
668 CG & 32.35 & 6704.21 & 16.15 & 5.30 & 10.85 \\
670 MG & 4.30 & 1355.58 & 28.93 & 8.85 & 20.08 \\
672 EP & 9.96 & 5519.68 & 26.98 & 0.02 & 26.96 \\
674 LU & 99.93 & 67463.43 & 23.60 & 2.45 & 21.15 \\
676 BT & 48.61 & 23796.97 & 34.62 & 5.83 & 28.79 \\
678 SP & 46.01 & 27007.43 & 22.72 & 3.45 & 19.27 \\
680 FT & 28.06 & 7142.69 & 23.09 & 2.90 & 20.19 \\
683 \label{table:res_32n}
688 \caption{Running NAS benchmarks on 64 nodes }
691 \begin{tabular}{|*{7}{r|}}
694 Program & Execution & Energy & Energy & Performance & Distance \\
695 name & time/s & consumption/J & saving\% & degradation\% & \\
697 CG & 46.65 & 17521.83 & 8.13 & 1.68 & 6.45 \\
699 MG & 3.27 & 1534.70 & 29.27 & 14.35 & 14.92 \\
701 EP & 5.05 & 5471.11 & 27.12 & 3.11 & 24.01 \\
703 LU & 73.92 & 101339.16 & 21.96 & 3.67 & 18.29 \\
705 BT & 39.99 & 27166.71 & 32.02 & 12.28 & 19.74 \\
707 SP & 52.00 & 49099.28 & 24.84 & 0.03 & 24.81 \\
709 FT & 25.97 & 10416.82 & 20.15 & 4.87 & 15.28 \\
712 \label{table:res_64n}
715 \medskip \begin{table}[h!]
716 \caption{Running NAS benchmarks on 128 and 144 nodes }
719 \begin{tabular}{|*{7}{r|}}
722 Program & Execution & Energy & Energy & Performance & Distance \\
723 name & time/s & consumption/J & saving\% & degradation\% & \\
725 CG & 56.92 & 41163.36 & 4.00 & 1.10 & 2.90 \\
727 MG & 3.55 & 2843.33 & 18.77 & 10.38 & 8.39 \\
729 EP & 2.67 & 5669.66 & 27.09 & 0.03 & 27.06 \\
731 LU & 51.23 & 144471.90 & 16.67 & 2.36 & 14.31 \\
733 BT & 37.96 & 44243.82 & 23.18 & 1.28 & 21.90 \\
735 SP & 64.53 & 115409.71 & 26.72 & 0.05 & 26.67 \\
737 FT & 25.51 & 18808.72 & 12.85 & 2.84 & 10.01 \\
740 \label{table:res_128n}
746 \includegraphics[width=.7\textwidth]{fig/ch3/energy}\\~ ~ ~ ~ ~(a) \\
748 \includegraphics[width=.7\textwidth]{fig/ch3/per_deg}\\~ ~ ~ ~ ~(b)
749 \caption{NAS benchmarks running with a different number of nodes (a) the energy saving and
750 (b) the performance degradation }
754 The overall energy consumption was computed for each instance according to the
755 energy consumption model (\ref{eq:energy-heter}), with and without applying the
756 algorithm. The execution time was also measured for all these experiments. Then,
757 the energy saving and performance degradation percentages were computed for each
758 instance. The results are presented in Tables
759 \ref{table:res_8n}, \ref{table:res_16n}, \ref{table:res_32n},
760 \ref{table:res_64n} and \ref{table:res_128n}. All these results are the average
761 values obtained from many experiments for energy savings and performance degradation.
762 The tables show the experimental results for running the NAS parallel benchmarks
763 on different numbers of nodes. The experiments show that the algorithm
764 significantly reduces the energy consumption (up to 34\%) and tries to
765 limit the performance degradation. They also show that the energy saving
766 percentage decreases when the number of computing nodes increases. This
767 reduction is due to the increase of the communication times compared to the
768 execution times when the benchmarks are run over a higher number of nodes.
769 Indeed, the benchmarks with the same class, C, are executed on different numbers
770 of nodes, so the computation required for each iteration is divided by the
771 number of computing nodes. On the other hand, more communications are required
772 when increasing the number of nodes so the static energy increases linearly
773 according to the communication time and the dynamic power is less relevant in
774 the overall energy consumption. Therefore, reducing the frequency with
775 Algorithm~\ref{HSA} is less effective in reducing the overall energy savings. It
776 can also be noticed that for the benchmarks EP and SP that contain little or no
777 communications, the energy savings are not significantly affected by the high
778 number of nodes. No experiments were conducted using bigger classes than D,
779 because they require a lot of memory (more than 64 \textit{GB}) when being executed
780 by the simulator on one machine. The maximum distance between the normalized
781 energy curve and the normalized performance for each instance is also shown in
782 the result tables. It decreases in the same way as the energy saving percentage.
783 The tables also show that the performance degradation percentage is not
784 significantly increased when the number of computing nodes is increased because
785 the computation times are small when compared to the communication times.
787 Figure~\ref{fig:res} (a) and (b) present the energy saving and
788 performance degradation respectively for all the benchmarks according to the
789 number of used nodes. As shown in the first plot, the energy saving percentages
790 of the benchmarks MG, LU, BT and FT decrease linearly when the number of nodes
791 increase. While for the EP and SP benchmarks, the energy saving percentage is
792 not affected by the increase of the number of computing nodes, because in these
793 benchmarks there are little or no communications. Finally, the energy saving of
794 the CG benchmark significantly decreases when the number of nodes increase
795 because this benchmark has more communications than the others. The second plot
796 shows that the performance degradation percentages of most of the benchmarks
797 decrease when they run on a big number of nodes because they spend more time
798 communicating than computing, thus, scaling down the frequencies of some nodes
799 has less effect on the performance.
801 \subsection{The results for different power consumption scenarios}
804 The results of the previous section were obtained while using processors that
805 consume during computation an overall power which is 80\% composed of
806 dynamic power and 20\% of static power. In this section, these ratios
807 are changed and two new power scenarios are considered in order to evaluate how
808 the proposed algorithm adapts itself according to the static and dynamic power
809 values. The two new power scenarios are the following:
812 \item 70\% of dynamic power and 30\% of static power
813 \item 90\% of dynamic power and 10\% of static power
816 The NAS parallel benchmarks were executed again over processors that follow the
817 new power scenarios. The class C of each benchmark was run over 8 or 9 nodes
818 and the results are presented in Tables~\ref{table:res_s1} and
819 \ref{table:res_s2}. These tables show that the energy saving percentage of the
820 70\%-30\% scenario is smaller for all benchmarks compared to the
821 energy saving of the 90\%-10\% scenario. Indeed, in the latter
822 more dynamic power is consumed when nodes are running on their maximum
823 frequencies, thus, scaling down the frequency of the nodes results in higher
824 energy savings than in the 70\%-30\% scenario. On the other hand,
825 the performance degradation percentage is smaller in the 70\%-30\%
826 scenario compared to the 90\%-10\% scenario. This is due to the
827 higher static power percentage in the first scenario which makes it more
828 relevant in the overall consumed energy. Indeed, the static energy is related
829 to the execution time and if the performance is degraded the amount of consumed
830 static energy directly increases. Therefore, the proposed algorithm does not
831 significantly scale down the frequencies of the nodes in order to
832 limit the increase of the execution time and thus limiting the effect of the
833 consumed static energy.
835 Both new power scenarios are compared to the old one in
836 Figure~\ref{fig:powers-heter} (a). It shows the average of the performance degradation,
837 the energy saving and the distances for all the NAS benchmarks running class C on
838 8 or 9 nodes. The comparison shows that the energy saving ratio is proportional
839 to the dynamic power ratio: it is increased when applying the
840 90\%-10\% scenario because at maximum frequency the dynamic energy
841 is the most relevant in the overall consumed energy and can be reduced by
842 lowering the frequency of some processors. On the other hand, the energy saving
843 decreases when the 70\%-30\% scenario is used because the dynamic
844 energy is less relevant in the overall consumed energy and lowering the
845 frequency does not return big energy savings. Moreover, the average of the
846 performance degradation is decreased when using a higher ratio for the static power
847 (e.g. 70\%-30\% scenario and 80\%-20\% scenario). Since the proposed
848 algorithm optimizes the energy consumption when
849 using a higher ratio for the dynamic power, the algorithm selects bigger frequency
850 scaling factors that results in more energy saving but degrade the performance, for
851 example see Figure~\ref{fig:powers-heter} (b). The opposite happens when using a
852 higher ratio for the static power, the algorithm proportionally selects smaller
853 scaling values which results in less energy saving but also less performance
857 \caption{The results of the 70\%-30\% power scenario}
860 \begin{tabular}{|*{6}{r|}}
862 Program & Energy & Energy & Performance & Distance \\
863 name & consumption/J & saving\% & degradation\% & \\
865 CG & 4144.21 & 22.42 & 7.72 & 14.70 \\
867 MG & 1133.23 & 24.50 & 5.34 & 19.16 \\
869 EP & 6170.30 & 16.19 & 0.02 & 16.17 \\
871 LU & 39477.28 & 20.43 & 0.07 & 20.36 \\
873 BT & 26169.55 & 25.34 & 6.62 & 18.71 \\
875 SP & 19620.09 & 19.32 & 3.66 & 15.66 \\
877 FT & 6094.07 & 23.17 & 0.36 & 22.81 \\
884 \caption{The results of the 90\%-10\% power scenario}
887 \begin{tabular}{|*{6}{r|}}
889 Program & Energy & Energy & Performance & Distance \\
890 name & consumption/J & saving\% & degradation\% & \\
892 CG & 2812.38 & 36.36 & 6.80 & 29.56 \\
894 MG & 825.43 & 38.35 & 6.41 & 31.94 \\
896 EP & 5281.62 & 35.02 & 2.68 & 32.34 \\
898 LU & 31611.28 & 39.15 & 3.51 & 35.64 \\
900 BT & 21296.46 & 36.70 & 6.60 & 30.10 \\
902 SP & 15183.42 & 35.19 & 11.76 & 23.43 \\
904 FT & 3856.54 & 40.80 & 5.67 & 35.13 \\
911 \caption{Comparing the MaxDist algorithm to the EDP method}
913 \begin{tabular}{|*{7}{r|}}
915 Program & \multicolumn{2}{c|}{Energy saving \%}
916 & \multicolumn{2}{c|}{Perf. degradation \%}
917 & \multicolumn{2}{c|}{Distance} \\
919 name & EDP & MaxDist & EDP & MaxDist & EDP & MaxDist \\
921 CG & 27.58 & 31.25 & 5.82 & 7.12 & 21.76 & 24.13 \\
923 MG & 29.49 & 33.78 & 3.74 & 6.41 & 25.75 & 27.37 \\
925 LU & 19.55 & 28.33 & 0.00 & 0.01 & 19.55 & 28.22 \\
927 EP & 28.40 & 27.04 & 4.29 & 0.49 & 24.11 & 26.55 \\
929 BT & 27.68 & 32.32 & 6.45 & 7.87 & 21.23 & 24.43 \\
931 SP & 20.52 & 24.73 & 5.21 & 2.78 & 15.31 & 21.95 \\
933 FT & 27.03 & 31.02 & 2.75 & 2.54 & 24.28 & 28.48 \\
936 \label{table:compare_EDP}
942 \includegraphics[width=.75\textwidth]{fig/ch3/sen_comp}\\~ ~ ~ ~ ~ (a)\\
944 \includegraphics[width=.75\textwidth]{fig/ch3/three_scenarios}\\~ ~ ~ ~ ~ (b)
946 \caption{(a) Comparison the results of the three power scenarios and
947 (b) Comparison the selected frequency scaling factors of MG benchmark class C running on 8 nodes}
948 \label{fig:powers-heter}
953 \includegraphics[scale=0.85]{fig/ch3/compare_EDP.pdf}
954 \caption{Trade-off comparison for NAS benchmarks class C}
955 \label{fig:compare_EDP}
959 \subsection{Comparison between the proposed scaling algorithm and the EDP method}
961 In this section, the scaling factors selection algorithm, called MaxDist, is
962 compared to \cite{ref67}, EDP method. They developed a
963 green governor that regularly applies an online frequency selecting algorithm to
964 reduce the energy consumed by a multi-core architecture without degrading much
965 its performance. The algorithm selects the frequencies that minimize the energy
966 and delay product, $\mathit{EDP}=\mathit{energy}\times \mathit{delay}$, using
967 the predicted overall energy consumption and execution time delay for each
968 frequency. To fairly compare both algorithms, the same energy and execution
969 time models, Equations (\ref{eq:energy-heter}) and (\ref{eq:perf_heter}), were used for both
970 algorithms to predict the energy consumption and the execution times.
971 Spiliopoulos et al. algorithm was adapted to start the search from the initial
972 frequencies computed using Equation (\ref{eq:Fint}). The resulting algorithm
973 is an exhaustive search algorithm that minimizes the EDP and has the initial
974 frequencies values as an upper bound.
976 Both algorithms were applied to the parallel NAS benchmarks to compare their
977 efficiency. Table~\ref{table:compare_EDP} presents the
978 execution times and the energy consumption for both versions of the NAS
979 benchmarks while running the class C of each benchmark over 8 or 9 heterogeneous
980 nodes. The results show that our algorithm provides better energy savings than
981 Spiliopoulos et al. algorithm, on average it results in 29.76\% energy
982 saving while their algorithm saves just 25.75\%. The average of
983 performance degradation percentage is approximately the same for both
984 algorithms, about 4\%.
986 For all benchmarks, our algorithm outperforms Spiliopoulos et al. algorithm in
987 the energy reduction to performance trade-off, see Figure~\ref{fig:compare_EDP},
988 because it maximizes the distance between the energy saving and the performance
989 degradation values while giving the same weight for both metrics.
991 \section[The energy optimization of grid]{The energy optimization of parallel applications with iterations running over grids}
994 \subsection{The energy and performance models of grid platform}
996 In this section, we are interested in reducing the energy consumption of message
997 passing applications with synchronous iterations running over
998 heterogeneous grid platforms. A heterogeneous grid platform could be defined as a collection of
999 heterogeneous computing clusters interconnected via a long distance network which has a lower bandwidth
1000 and a higher latency than the local networks of the clusters. Each computing cluster in the grid is composed of homogeneous nodes that are connected together via a high speed network. However, nodes from distinct clusters may have different characteristics such as computing power (FLOPS), energy consumption, CPU's frequency range, network bandwidth and latency.
1002 Since in a heterogeneous grid each cluster has different characteristics,
1003 when applying DVFS operations on the nodes
1004 of these clusters, they may get different scaling factors represented by a scaling vector:
1005 $(S_{11}, S_{12},\dots, S_{NM})$ where $S_{ij}$ is the scaling factor of processor $j$ in cluster $i$. To
1006 be able to predict the execution time of message passing
1007 applications with synchronous iterations running over a heterogeneous grid, for different vectors of
1008 scaling factors, the communication time and the computation time for all the
1009 tasks must be measured during the first iteration before applying any DVFS
1010 operation. Then the execution time for one iteration of the application with any
1011 vector of scaling factors can be predicted using Equation (\ref{eq:perf-grid}).
1014 \label{eq:perf-grid}
1015 \Tnew = \mathop{\max_{i=1,\dots N}}_{j=1,\dots,M_i}({\TcpOld[ij]} \cdot S_{ij})
1016 +\mathop{\min_{j=1,\dots,M_i}} (\Tcm[hj])
1019 where $N$ is the number of clusters in the grid, $M_i$ is the number of nodes in
1020 cluster $i$, $\TcpOld[ij]$ is the computation time of processor $j$ in the cluster $i$
1021 and $\Tcm[hj]$ is the communication time of processor $j$ in the cluster $h$ during the
1022 first iteration. The execution time for one iteration is equal to the sum of the maximum computation time for all nodes with the new scaling factors
1023 and the slowest communication time without slack time during one iteration.
1024 The latter is equal to the communication time of the slowest node in the slowest cluster $h$.
1025 It means that only the communication time without any slack time is taken into account.
1026 Therefore, the execution time of the parallel application with iterations is equal to
1027 the execution time of one iteration as in Equation (\ref{eq:perf-grid}) multiplied by the
1028 number of iterations of that application.
1031 In the considered heterogeneous grid platform, each node $j$ in cluster $i$ may have
1032 different dynamic and static powers from the nodes of the other clusters,
1033 noted as $\Pd[ij]$ and $\Ps[ij]$ respectively. Therefore, even if the distributed
1034 message passing application with iterations is load balanced, the computation time of each CPU $j$
1035 in cluster $i$ noted $\Tcp[ij]$ may be different and different frequency scaling factors may be
1036 computed in order to decrease the overall energy consumption of the application
1037 and reduce slack times. The communication time of a processor $j$ in cluster $i$ is noted as
1038 $\Tcm[ij]$ and could contain slack times when communicating with slower nodes,
1039 see Figure~\ref{fig:task-heter}. Therefore, all nodes do not have equal
1040 communication times. While the dynamic energy is computed according to the
1041 frequency scaling factor and the dynamic power of each node as in Equation
1042 (\ref{eq:Edyn}), the static energy is computed as the sum of the execution time
1043 of one iteration multiplied by the static power of each processor. The overall
1044 energy consumption of a message passing distributed application executed over a
1045 heterogeneous grid platform during one iteration is the summation of all dynamic and
1046 static energies for $M_i$ processors in $N$ clusters. It is computed as follows:
1048 \label{eq:energy-grid}
1049 E = \sum_{i=1}^{N} \sum_{i=1}^{M_i} {(S_{ij}^{-2} \cdot \Pd[ij] \cdot \Tcp[ij])} +
1050 \sum_{i=1}^{N} \sum_{j=1}^{M_i} (\Ps[ij] \cdot
1051 (\mathop{\max_{i=1,\dots N}}_{j=1,\dots,M_i}({\Tcp[ij]} \cdot S_{ij})
1052 +\mathop{\min_{j=1,\dots M_i}} (\Tcm[hj]) ))
1056 To optimize both of the energy consumption model computed by \ref{eq:energy-grid} and the performance model computed by \ref{eq:perf-grid},
1057 they must be normalized as in Equation \ref{eq:enorm-heter} and Equation \ref{eq:pnorm-heter} respectively.
1058 While the original energy consumption is the consumed energy with the
1059 maximum frequency for all the nodes computed as follows:
1062 \label{eq:eorginal-grid}
1063 \Eoriginal = \sum_{i=1}^{N} \sum_{j=1}^{M_i} ( \Pd[ij] \cdot \Tcp[ij]) +
1064 \mathop{\sum_{i=1}^{N}} \sum_{j=1}^{M_i} (\Ps[ij] \cdot \Told)
1067 By the same way, the old execution time with the maximum frequency for all the nodes is computed as follows:
1070 \label{eq:told-grid}
1071 \Told = \mathop{\max_{i=1,\dots N}}_{j=1,\dots,M_i}({\Tcp[ij]})
1072 +\mathop{\min_{j=1,\dots,M_i}} (\Tcm[hj])
1074 Therefore, the objective function can be modelled in order to find the maximum
1075 distance between the normalized energy curve and the normalized performance curve
1076 over all possible sets of scaling factors as follows:
1081 \mathop{ \mathop{\max_{i=1,\dots N}}_{j=1,\dots,M_i}}_{k=1,\dots,F_j}
1082 (\overbrace{\Pnorm(S_{ijk})}^{\text{Maximize}} -
1083 \overbrace{\Enorm(S_{ijk})}^{\text{Minimize}} )
1086 where $N$ is the number of clusters, $M_i$ is the number of nodes in each cluster and
1087 $F_j$ is the number of available frequencies for the node $j$. Then, the optimal set
1088 of scaling factors that satisfies (\ref{eq:max-grid}) can be selected.
1090 \subsection{The scaling factors selection algorithm for a grid architecture}
1095 \begin{algorithmic}[1]
1100 \item [{$N$}] number of clusters in the grid.
1101 \item [{$M_i$}] number of nodes in each cluster.
1102 \item[{$\Tcp[ij]$}] array of all computation times for all nodes during one iteration and with the highest frequency.
1103 \item[{$\Tcm[ij]$}] array of all communication times for all nodes during one iteration and with the highest frequency.
1104 \item[{$\Fmax[ij]$}] array of the maximum frequencies for all nodes.
1105 \item[{$\Pd[ij]$}] array of the dynamic powers for all nodes.
1106 \item[{$\Ps[ij]$}] array of the static powers for all nodes.
1107 \item[{$\Fdiff[ij]$}] array of the differences between two successive frequencies for all nodes.
1109 \Ensure $\Sopt[11],\Sopt[12] \dots, \Sopt[NM_i]$, a vector of scaling factors that gives the optimal trade-off between energy consumption and execution time
1111 \State $\Scp[ij] \gets \frac{ \mathop{\max\limits_{i=1,\dots N}}\limits_{j=1,\dots,M_i}(\Tcp[ij])} {\Tcp[ij]} $
1112 \State $F_{ij} \gets \frac{\Fmax[ij]}{\Scp[i]},~{i=1,2,\cdots,N},~{j=1,2,\dots,M_i}.$
1113 \State Round the computed initial frequencies $F_i$ to the closest available frequency for each node.
1114 \If{(not the first frequency)}
1115 \State $F_{ij} \gets F_{ij}+\Fdiff[ij],~i=1,\dots,N,~{j=1,\dots,M_i}.$
1117 \State $\Told \gets \mathop{\max\limits_{i=1,\dots N}}\limits_{j=1,\dots,M_i}({\Tcp[ij]})
1118 +\mathop{\min\limits_{j=1,\dots,M_i}} (\Tcm[hj]) $
1119 \State $\Eoriginal \gets \sum_{i=1}^{N} \sum_{j=1}^{M_i} ( \Pd[ij] \cdot \Tcp[ij]) +
1120 \mathop{\sum_{i=1}^{N}} \sum_{j=1}^{M_i} (\Ps[ij] \cdot \Told) $
1121 \State $\Sopt[ij] \gets 1,~i=1,\dots,N,~{j=1,\dots,M_i}. $
1122 \State $\Dist \gets 0 $
1123 \While {(all nodes have not reached their minimum frequency \textbf{or} $\Pnorm - \Enorm < 0 $)}
1124 \If{(not the last freq. \textbf{and} not the slowest node)}
1125 \State $F_{ij} \gets F_{ij} - \Fdiff[ij],~{i=1,\dots,N},~{j=1,\dots,M_i}$.
1126 \State $S_{ij} \gets \frac{\Fmax[ij]}{F_{ij}},~{i=1,\dots,N},~{j=1,\dots,M_i}.$
1128 \State $\Tnew \gets \mathop{\max\limits_{i=1,\dots N}}\limits_{j=1,\dots,M_i}({\TcpOld[ij]}
1129 \cdot S_{ij}) +\mathop{\min\limits_{j=1,\dots,M_i}} (\Tcm[hj]) $
1130 \State $\Ereduced \gets \sum\limits_{i=1}^{N} \sum\limits_{i=1}^{M_i} {(S_{ij}^{-2} \cdot \Pd[ij]
1131 \cdot \Tcp[ij])} + \sum\limits_{i=1}^{N} \sum\limits_{j=1}^{M_i} (\Ps[ij] \cdot
1132 (\mathop{\max\limits_{i=1,\dots N}}\limits_{j=1,\dots,M_i}({\Tcp[ij]} \cdot S_{ij})
1133 +\mathop{\min\limits_{j=1,\dots,M_i}} (\Tcm[hj]) ))$
1134 \State $\Pnorm \gets \frac{\Told}{\Tnew}$
1136 \State $\Enorm \gets \frac{\Ereduced}{\Eoriginal}$
1137 \If{$(\Pnorm - \Enorm > \Dist)$}
1138 \State $\Sopt[ij] \gets S_{ij},~i=1,\dots,N,~j=1,\dots,M_i$
1139 \State $\Dist \gets \Pnorm - \Enorm$
1142 \State Return $\Sopt[11],\Sopt[12],\dots,\Sopt[NM_i]$
1144 \caption{Scaling factors selection algorithm for grid}
1150 \includegraphics[scale=0.7]{fig/ch3/init_freq}
1151 \caption{Selecting the initial frequencies in the grid architecture}
1152 \label{fig:st_freq-grid}
1157 \includegraphics[width=.7\textwidth]{fig/ch3/heter2}
1158 \caption{The energy and performance relation in grid}
1159 \label{fig:rel-grid}
1163 In this section, the scaling factors selection algorithm for a grid, Algorithm~\ref{HSA-grid},
1164 is presented. It selects the vector of frequency
1165 scaling factors that gives the best trade-off between minimizing the
1166 energy consumption and maximizing the performance of a message passing
1167 application with synchronous iterations executed on a grid.
1168 It is similar to the frequency selection algorithm for heterogeneous
1169 local clusters presented in Section \ref{ch3:1:4}.
1171 The value of the initial frequency scaling factor for each node is inversely proportional to its
1172 computation time that was gathered in the first iteration. The initial
1173 frequency scaling factor for a node $i$ is computed as a ratio between the computation time
1174 of the slowest node and the computation time of the node $i$ as follows:
1177 \Scp[ij] = \frac{ \mathop{\max\limits_{i=1,\dots N}}\limits_{j=1,\dots,M_i}(\Tcp[ij])} {\Tcp[ij]}
1179 Using the initial frequency scaling factors computed in (\ref{eq:Scp-grid}), the
1180 algorithm computes the initial frequencies for all nodes as a ratio between the
1181 maximum frequency of the node and its computed scaling factor, as follows:
1183 \label{eq:Fint-grid}
1184 F_{ij} = \frac{\Fmax[ij]}{\Scp[ij]},~{i=1,2,\dots,N},~{j=1,\dots,M_i}
1186 Figure \ref{fig:st_freq-grid} shows the selected initial frequencies for a grid composed of three clusters.
1187 In contrast to algorithm \ref{HSA}, algorithm \ref{HSA-grid} replaces the computed initial frequency for a node by the nearest available frequency if not available in the gears of
1189 The frequency scaling algorithm of the grid stops its iteration if it reaches the lower bound, which is the frequency that gives a negative distance between the energy and performance.
1190 A negative distance means that the performance degradation ratio is higher than the energy saving ratio as in figure \ref{fig:rel-grid}.
1191 In this situation, the algorithm must stop the downward search because it has reached the lower bound and it is useless to test the lower frequencies. Indeed, they will all give worse distances.
1192 Therefore, the algorithm iterates on all the remaining frequencies, from the higher
1193 bound until all nodes reach their minimum frequencies or their lower bounds, to compute the overall
1194 energy consumption and execution time. Then, it selects the vector of frequency scaling
1195 factors that give the maximum distance (MaxDist). Algorithm~\ref{dvfs-heter} is also used to call the Algorithm \ref{HSA-grid} in the MPI program executed over the grid platform.
1197 \section{Experimental results over the Grid5000 platform}
1200 In this section, real experiments were conducted over the Grid'5000 platform.
1201 Grid'5000~\cite{ref21} is a large-scale testbed that consists of ten sites distributed all over metropolitan France and Luxembourg. These sites are: Grenoble, Lille, Luxembourg, Lyon, Nancy, Reims, Rennes , Sophia, Toulouse and Bordeaux. Figure \ref{fig:grid5000-dis} shows the geographical distribution of grid'5000 sites over France and Luxembourg. All the sites are connected together via a special long distance network called RENATER, which is the abbreviation of the French
1202 National Telecommunication Network for Technology. Each site in the grid is
1203 composed of a few heterogeneous computing clusters and each cluster contains
1204 many homogeneous nodes. In total, Grid'5000 has about one thousand heterogeneous nodes and eight thousand cores. In each site, the clusters and their nodes
1205 are connected via high speed local area networks. Two types of local networks
1206 are used, Ethernet or Infiniband networks, which have different characteristics
1207 in terms of bandwidth and latency.
1208 Grid'5000 is dedicated for research experiments and users can book nodes from different sites to conduct their experiments.
1209 It also gives the opportunity to the users to deploy their customized operating system over the reserved nodes.
1210 Indeed, many software tools are available for users in order to control and manage the reservation and deployment processes remotely. For example, OAR \cite{ref22} is a batch scheduler that is used to manage the heterogeneous resources of the grid'5000.
1214 \includegraphics[scale=1]{fig/ch3/grid5000.pdf}
1215 \caption{Grid5000's sites distribution in France and Luxembourg}
1216 \label{fig:grid5000-dis}
1220 Moreover, the Grid'5000 testbed provides at some sites a power measurement tool to capture
1221 the power consumption for each node in those sites. The measured power is the overall consumed power by all the components of a node at a given instant. For more details refer to \cite{ref79}.
1222 In order to correctly measure the CPU power of one core in a node $j$,
1223 firstly, the power consumed by the node while being idle at instant $y$, noted as $\Pidle[jy]$, was measured. Then, the power was measured while running a single thread benchmark with no communication (no idle time) over the same node with its CPU scaled to the maximum available frequency. The latter power measured at time $x$ with maximum frequency for one core of node $j$ is noted $\Pmax[jx]$. The difference between the two measured power consumptions represents the
1224 dynamic power consumption of that core with the maximum frequency, see Figure~\ref{fig:power_cons}.
1227 The dynamic power $\Pd[j]$ is computed as in Equation~\ref{eq:pdyn}
1230 \Pd[j] = \max_{x=\beta_1,\dots \beta_2} (\Pmax[jx]) - \min_{y=\Theta_1,\dots \Theta_2} (\Pidle[jy])
1233 where $\Pd[j]$ is the dynamic power consumption for one core of node $j$,
1234 $\lbrace \beta_1,\beta_2 \rbrace$ is the time interval for the measured maximum power values,
1235 $\lbrace\Theta_1,\Theta_2\rbrace$ is the time interval for the measured idle power values.
1236 Therefore, the dynamic power of one core is computed as the difference between the maximum
1237 measured value in maximum powers vector and the minimum measured value in the idle powers vector.
1239 On the other hand, the static power consumption by one core is a part of the measured idle power consumption of the node. Since in Grid'5000 there is no way to measure precisely the consumed static power and it was assumed, as in Sections \ref{ch3:2} and \ref{ch2:6}, that the static power represents a ratio of the dynamic power, the value of the static power is assumed to be equal to 20\% of the dynamic power consumption of the core.
1241 In the experiments presented in the following sections, two sites of Grid'5000 were used, Lyon and Nancy sites. These two sites have in total seven different clusters as shown in Figure~\ref{fig:grid5000}.
1243 Four clusters from the two sites were selected in the experiments: one cluster from
1244 Lyon's site, Taurus, and three clusters from Nancy's site, Graphene,
1245 Griffon and Graphite. Each one of these clusters composed of homogeneous nodes, while nodes from different clusters are heterogeneous in many aspects such as: computing power, power consumption, available
1246 frequency ranges and local network features: the bandwidth and the latency. Table~\ref{table:grid5000-1} shows
1247 the detailed characteristics of these four clusters. Moreover, the dynamic powers were computed using Equation~\ref{eq:pdyn} for all the nodes in the
1248 selected clusters and are presented in Table~\ref{table:grid5000-1}.
1253 \includegraphics[scale=1.4]{fig/ch3/grid5000-2}
1254 \caption{The selected two sites of Grid'5000}
1255 \label{fig:grid5000}
1259 \includegraphics[scale=0.8]{fig/ch3/power_consumption.pdf}
1260 \caption{The power consumed by one core from the Taurus cluster}
1261 \label{fig:power_cons}
1265 The energy model and the scaling factors selection algorithm were applied to the NAS parallel benchmarks v3.3 \cite{ref65} and evaluated over Grid'5000.
1266 The benchmark suite contains seven applications: CG, MG, EP, LU, BT, SP and FT. These applications have different computations and communications ratios and strategies which make them good testbed applications to evaluate the proposed algorithm and energy model.
1267 The benchmarks have seven different classes, S, W, A, B, C, D and E, that represent the size of the problem that the method solves. In the next sections, the class D was used for all the benchmarks in all the experiments.
1271 \caption{The characteristics of the CPUs in the selected clusters}
1274 \begin{tabular}{|*{7}{c|}}
1276 & & Max & Min & Diff. & & \\
1277 Cluster & CPU & Freq. & Freq. & Freq. & Cores & Dynamic power \\
1278 Name & model & GHz & GHz & GHz & per CPU & of one core \\
1280 & Intel & & & & & \\
1281 Taurus & Xeon & 2.3 & 1.2 & 0.1 & 6 & \np[W]{35} \\
1282 & E5-2630 & & & & & \\
1284 & Intel & & & & & \\
1285 Graphene & Xeon & 2.53 & 1.2 & 0.133 & 4 & \np[W]{23} \\
1286 & X3440 & & & & & \\
1288 & Intel & & & & & \\
1289 Griffon & Xeon & 2.5 & 2 & 0.5 & 4 & \np[W]{46} \\
1290 & L5420 & & & & & \\
1292 & Intel & & & & & \\
1293 Graphite & Xeon & 2 & 1.2 & 0.1 & 8 & \np[W]{35} \\
1294 & E5-2650 & & & & & \\
1297 \label{table:grid5000-1}
1301 \subsection{The experimental results of the scaling algorithm on a Grid}
1303 In this section, the results of applying the scaling factors selection algorithm
1304 to the NAS parallel benchmarks are presented.
1305 As mentioned previously, the experiments
1306 were conducted over two sites of Grid'5000, Lyon and Nancy sites.
1307 Two scenarios were considered while selecting the clusters from these two sites :
1309 \item In the first scenario, nodes from two sites and three heterogeneous clusters were selected. The two sites are connected
1310 via a long distance network.
1311 \item In the second scenario nodes from three clusters located in one site, Nancy's site, were selected.
1315 for using these two scenarios is to evaluate the influence of long distance communications (higher latency) on the performance of the
1316 scaling factors selection algorithm. Indeed, in the first scenario the computations to communications ratio
1317 is very low due to the higher communication times which reduces the effect of the DVFS operations.
1319 The NAS parallel benchmarks are executed over
1320 16 and 32 nodes for each scenario. The number of participating computing nodes from each cluster
1321 is different because all the selected clusters do not have the same available number of nodes and all benchmarks do not require the same number of computing nodes.
1322 Table~\ref{tab:sc} shows the number of nodes used from each cluster for each scenario.
1326 \caption{The different grid scenarios}
1328 \begin{tabular}{|*{4}{c|}}
1330 \multirow{2}{*}{Scenario name} & \multicolumn{3}{c|} {The participating clusters} \\ \cline{2-4}
1331 & Cluster & Site & Nodes per cluster \\
1333 \multirow{3}{*}{Two sites / 16 nodes} & Taurus & Lyon & 5 \\ \cline{2-4}
1334 & Graphene & Nancy & 5 \\ \cline{2-4}
1335 & Griffon & Nancy & 6 \\
1337 \multirow{3}{*}{Two sites / 32 nodes} & Taurus & Lyon & 10 \\ \cline{2-4}
1338 & Graphene & Nancy & 10 \\ \cline{2-4}
1339 & Griffon &Nancy & 12 \\
1341 \multirow{3}{*}{One site / 16 nodes} & Graphite & Nancy & 4 \\ \cline{2-4}
1342 & Graphene & Nancy & 6 \\ \cline{2-4}
1343 & Griffon & Nancy & 6 \\
1345 \multirow{3}{*}{One site / 32 nodes} & Graphite & Nancy & 4 \\ \cline{2-4}
1346 & Graphene & Nancy & 14 \\ \cline{2-4}
1347 & Griffon & Nancy & 14 \\
1354 The NAS parallel benchmarks are executed over these two platforms
1355 with different number of nodes, as in Table~\ref{tab:sc}.
1356 The overall energy consumption of all the benchmarks solving the class D instance and
1357 using the proposed frequency selection algorithm is measured
1358 using Equation~\ref{eq:energy-grid}.
1360 The energy consumptions and the execution times for all the benchmarks are
1361 presented in Figures~\ref{fig:exp-time-energy} (a) and (b) respectively.
1362 For the majority of the benchmarks, the energy consumed while executing the NAS benchmarks over one site on 16 and 32 nodes is lower than the energy consumed while using two sites.
1363 The long distance communications between the two distributed sites increase the idle times, which lead to more static energy consumption.
1365 The execution times of these benchmarks
1366 over one site with 16 and 32 nodes are also lower than those of the two sites
1367 scenario. Moreover, most of the benchmarks running over the one site scenario have their execution times approximately halved when the number of computing nodes is doubled from 16 to 32 nodes (linear speed up according to the number of the nodes).
1369 However, the execution times and the energy consumptions of the EP and MG
1370 benchmarks, which have no or small communications, are not significantly
1371 affected in both scenarios, even when the number of nodes is doubled. On the
1372 other hand, the communication times of the rest of the benchmarks increase when
1373 using long distance communications between two sites or when increasing the number of
1377 The energy saving percentage is computed as the ratio between the reduced
1378 energy consumption, Equation~\ref{eq:energy-grid}, and the original energy consumption,
1379 Equation~\ref{eq:eorginal-grid}, for all the benchmarks as in Figure~\ref{fig:eng_s}.
1380 This figure shows that the energy saving percentages of the one site scenario for
1381 16 and 32 nodes are bigger than those of the two sites scenario which is due
1382 to the higher computations to communications ratio in the first scenario
1383 than in the second one. Moreover, the frequency selecting algorithm selects smaller frequencies when the computation times are bigger than the communication times which
1384 results in a lower energy consumption. Indeed, the dynamic consumed power
1385 is exponentially related to the CPU's frequency value. On the other hand, the increase in the number of computing nodes can
1386 increase the communication times and thus produces less energy saving depending on the
1387 benchmarks being executed. The results of the benchmarks CG, MG, BT and FT show more
1388 energy saving percentage in the one site scenario when executed over 16 nodes than on 32 nodes. LU and SP consume more energy with 16 nodes than with 32 nodes on one site because their computations to communications ratio is not affected by the increase of the number of local communications.
1392 \includegraphics[width=.7\textwidth]{fig/ch3/eng_con_scenarios.eps}\\~~~~~~~~~(a)\\
1393 \includegraphics[width=.7\textwidth]{fig/ch3/time_scenarios.eps}\\~~~~~~~~~(b)
1394 \caption{ (a) energy consumption and (b) execution time of NAS Benchmarks over different scenarios}
1395 \label{fig:exp-time-energy}
1400 \includegraphics[width=.7\textwidth]{fig/ch3/eng_s.eps}
1401 \caption{The energy reduction percentages while executing the NAS benchmarks over different scenarios}
1407 \includegraphics[width=.7\textwidth]{fig/ch3/per_d.eps}
1408 \caption{The performance degradation percentages of the NAS benchmarks over different scenarios}
1414 \includegraphics[width=.7\textwidth]{fig/ch3/dist.eps}
1415 \caption{The trade-off distance percentages between the energy reduction and the performance of the NAS benchmarks
1416 over different scenarios}
1417 \label{fig:dist-grid}
1420 The energy saving percentage is reduced for all the benchmarks because of the long distance communications in the two sites
1421 scenario, except for the EP benchmark which has no communication. Therefore, the energy saving percentage of this benchmark is
1422 dependent on the maximum difference between the computing powers of the heterogeneous computing nodes, for example
1423 in the one site scenario, the graphite cluster is selected but in the two sites scenario
1424 this cluster is replaced with the Taurus cluster which is more powerful.
1425 Therefore, the energy savings of the EP benchmark are bigger in the two sites scenario due
1426 to the higher maximum difference between the computing powers of the nodes.
1428 In fact, high differences between the nodes' computing powers make the proposed frequencies selecting
1429 algorithm select smaller frequencies for the powerful nodes which
1430 produces less energy consumption and thus more energy saving.
1431 The best energy saving percentage was obtained in the one site scenario with 16 nodes, the energy consumption was on average reduced up to 30\%.
1433 Figure \ref{fig:per_d} presents the performance degradation percentages for all the benchmarks over the two scenarios.
1434 The performance degradation percentage for the benchmarks running on two sites with
1435 16 and 32 nodes is on average equal to 8.3\% and 4.7\% respectively.
1436 For this scenario, the proposed scaling algorithm selects smaller frequencies for the executions with 32 nodes without significantly degrading their performance because the communication times are high with 32 nodes which results in smaller computations to communications ratio. On the other hand, the performance degradation percentage for the benchmarks running on one site with
1437 16 and 32 nodes is on average equal to 3.2\% and 10.6\% respectively. In contrary to the two sites scenario, when the number of computing nodes is increased in the one site scenario, the performance degradation percentage is increased. Therefore, doubling the number of computing
1438 nodes when the communications occur in high speed network does not decrease the computations to
1439 communication ratio.
1441 The performance degradation percentage of the EP benchmark after applying the scaling factors selection algorithm is the highest in comparison to
1442 the other benchmarks. Indeed, in the EP benchmark, there are no communication and slack times and its
1443 performance degradation percentage only depends on the frequencies values selected by the algorithm for the computing nodes.
1444 The rest of the benchmarks showed different performance degradation percentages which decrease
1445 when the communication times increase and vice versa.
1447 Figure \ref{fig:dist-grid} presents the distance percentage between the energy saving and the performance degradation for each benchmark over both scenarios. The trade-off distance percentage can be
1448 computed as in Equation~\ref{eq:max-grid}. The one site scenario with 16 nodes gives the best energy and performance
1449 trade-off, on average it is equal to 26.8\%. The one site scenario using both 16 and 32 nodes had better energy and performance
1450 trade-off comparing to the two sites scenario because the former has high speed local communications
1451 which increase the computations to communications ratio and the latter uses long distance communications which decrease this ratio.
1453 Finally, the best energy and performance trade-off depends on all of the following:
1454 1) the computations to communications ratio when there are communications and slack times, 2) the heterogeneity of the computing powers of the nodes and 3) the heterogeneity of the consumed static and dynamic powers of the nodes.
1459 \subsection{The experimental results over multi-core clusters}
1462 The clusters of Grid'5000 have different number of cores embedded in their nodes
1463 as shown in Table~\ref{table:grid5000-1}. In
1464 this section, the proposed scaling algorithm is evaluated over the Grid'5000 platform while using multi-core nodes selected according to the one site scenario described in Section
1469 \caption{The multi-core scenarios}
1470 \begin{tabular}{|*{4}{c|}}
1472 Scenario name & Cluster name & Nodes per cluster &
1473 Cores per node \\ \hline
1474 \multirow{3}{*}{One core per node} & Graphite & 4 & 1 \\ \cline{2-4}
1475 & Graphene & 14 & 1 \\ \cline{2-4}
1476 & Griffon & 14 & 1 \\ \hline
1477 \multirow{3}{*}{Multi-core per node} & Graphite & 1 & 4 \\ \cline{2-4}
1478 & Graphene & 4 & 3 or 4 \\ \cline{2-4}
1479 & Griffon & 4 & 3 or 4 \\ \hline
1482 \label{table:sen-mc}
1486 \includegraphics[width=.7\textwidth]{fig/ch3/time.eps}
1487 \caption{The execution times of the NAS benchmarks running over the one core and the multi-core scenarios}
1492 \includegraphics[width=.7\textwidth]{fig/ch3/eng_con.eps}
1493 \caption{The energy consumptions and execution times of the NAS benchmarks over one core and multi-core per node architectures}
1494 \label{fig:eng-cons-mc}
1497 The one site scenario uses 32 cores from multi-core nodes instead of 32 distinct nodes. For example if
1498 the participating number of cores from a certain cluster is equal to 14,
1499 in the multi-core 4 nodes are selected and 3 or 4 cores from each node are used. The platforms with one
1500 core per node and multi-core nodes are shown in Table~\ref{table:sen-mc}.
1501 The energy consumptions and execution times of running class D of the NAS parallel
1502 benchmarks over these two different platforms are presented
1503 in Figures \ref{fig:eng-cons-mc} and \ref{fig:time-mc} respectively.
1505 The execution times for most of the NAS benchmarks are higher over the multi-core per node scenario
1506 than over the single core per node scenario. Indeed,
1507 the communication times are higher in the one site multi-core scenario than in the latter scenario because all the cores of a node share the same node network link which can be saturated when running communication bound applications. Moreover, the cores of a node share the memory bus which can be also saturated and might become a bottleneck.
1508 Moreover, the energy consumptions of the NAS benchmarks are lower over the
1509 one core scenario than over the multi-core scenario because
1510 the first scenario had less execution time than the latter which results in less static energy being consumed.
1511 The computations to communications ratios of the NAS benchmarks are higher over
1512 the one site one core scenario when compared to the ratio of the multi-core scenario.
1513 More energy reduction can be gained when this ratio is big because it pushes the proposed scaling algorithm to select smaller frequencies that decrease the dynamic power consumption. These experiments also showed that the energy
1514 consumption and the execution times of the EP and MG benchmarks do not change significantly over these two
1515 scenarios because there are no or small communications. Contrary to EP and MG, the energy consumptions and the execution times of the rest of the benchmarks vary according to the communication times that are different from one scenario to the other.
1518 \includegraphics[width=.7\textwidth]{fig/ch3/eng_s_mc.eps}
1519 \caption{The energy saving percentages of running NAS benchmarks over one core and multi-core scenarios}
1520 \label{fig:eng-s-mc}
1525 \includegraphics[width=.7\textwidth]{fig/ch3/per_d_mc.eps}
1526 \caption{The performance degradation percentages of running NAS benchmarks over one core and multi-core scenarios}
1527 \label{fig:per-d-mc}
1532 \includegraphics[width=.7\textwidth]{fig/ch3/dist_mc.eps}
1533 \caption{The trade-off distance percentages of running NAS benchmarks over one core and multi-core scenarios}
1536 The energy saving percentages of all the NAS benchmarks running over these two scenarios are presented in Figure~\ref{fig:eng-s-mc}.
1537 It shows that the energy saving percentages in the one
1538 core and the multi-core scenarios
1539 are approximately equivalent, on average they are equal to 25.9\% and 25.1\% respectively.
1540 The energy consumption is reduced at the same rate in the two scenarios when compared to the energy consumption of the executions without DVFS.
1542 The performance degradation percentages of the NAS benchmarks are presented in
1543 Figure~\ref{fig:per-d-mc}. It shows that the performance degradation percentages are higher for the NAS benchmarks executed over the one core per node scenario (on average equal to 10.6\%) than over the multi-core scenario (on average equal to 7.5\%). The performance degradation percentages over the multi-core scenario are lower because the computations to communications ratios are smaller than the ratios of the other scenario.
1545 The trade-off distances percentages of the NAS benchmarks over both scenarios are presented
1546 in~Figure~\ref{fig:dist-mc}. These trade-off distances between energy consumption reduction and performance are used to verify which scenario is the best in both terms at the same time. The figure shows that the trade-off distance percentages are on average bigger over the multi-core scenario (17.6\%) than over the one core per node scenario (15.3\%).
1549 \subsection{Experiments with different static power scenarios}
1552 In Section~\ref{ch3:4}, since it was not possible to measure the static power consumed by a CPU, the static power was assumed to be equal to 20\% of the measured dynamic power. This power is consumed during the whole execution time, during computation and communication times. Therefore, when the DVFS operations are applied by the scaling algorithm and the CPUs' frequencies lowered, the execution time might increase and consequently the consumed static energy will be increased too.
1554 The aim of this section is to evaluate the scaling algorithm while assuming different values of static powers.
1555 In addition to the previously used percentage of static power, two new static power ratios, 10\% and 30\% of the measured dynamic power of the core, are used in this section.
1556 The experiments have been executed with these two new static power scenarios over the one site one core per node scenario.
1557 In these experiments, the class D of the NAS parallel benchmarks were executed over the Nancy site. 16 computing nodes from the three clusters, Graphite, Graphene and Griffon, were used in this experiment.
1564 \includegraphics[width=.7\textwidth]{fig/ch3/eng_pow.eps}
1565 \caption{The energy saving percentages for the nodes executing the NAS benchmarks over the three power scenarios}
1570 \includegraphics[width=.7\textwidth]{fig/ch3/per_pow.eps}
1571 \caption{The performance degradation percentages for the NAS benchmarks over the three power scenarios}
1577 \includegraphics[width=.7\textwidth]{fig/ch3/dist_pow.eps}
1578 \caption{The trade-off distance percentages between the energy reduction and the performance of the NAS benchmarks over the three power scenarios}
1579 \label{fig:dist-pow}
1585 \includegraphics[scale=0.7]{fig/ch3/three_scenarios2.pdf}
1586 \caption{Comparing the selected frequency scaling factors for the MG benchmark over the three static power scenarios}
1590 The energy saving percentages of the NAS benchmarks with the three static power scenarios are presented
1591 in Figure~\ref{fig:eng-pow}. This figure shows that the 10\% of static power scenario
1592 gives the biggest energy saving percentages in comparison to the 20\% and 30\% static power
1593 scenarios. The small value of the static power consumption makes the proposed
1594 scaling algorithm select smaller frequencies for the CPUs.
1595 These smaller frequencies reduce the dynamic energy consumption more than increasing the consumed static energy which gives less overall energy consumption.
1596 The energy saving percentages of the 30\% static power scenario is the smallest between the other scenarios, because the scaling algorithm selects bigger frequencies for the CPUs which increases the energy consumption. Figure \ref{fig:fre-pow} demonstrates that the proposed scaling algorithm selects the best frequency scaling factors according to the static power consumption ratio being used.
1598 The performance degradation percentages are presented in Figure~\ref{fig:per-pow}.
1599 The 30\% static power scenario had less performance degradation percentage because the scaling algorithm
1600 had selected big frequencies for the CPUs. While,
1601 the inverse happens in the 10\% and 20\% scenarios because the scaling algorithm had selected CPUs' frequencies smaller than those of the 30\% scenario. The trade-off distance percentage for the NAS benchmarks with these three static power scenarios
1602 are presented in Figure~\ref{fig:dist-pow}.
1603 It shows that the best trade-off
1604 distance percentage is obtained with the 10\% static power scenario and this percentage
1605 is decreased for the other two scenarios because the scaling algorithm had selected different frequencies according to the static power values.
1607 In the EP benchmark, the energy saving, performance degradation and trade-off
1608 distance percentages for these static power scenarios are not significantly different because there is no communication in this benchmark. Therefore, the static power is only consumed during computation and the proposed scaling algorithm selects similar frequencies for the three scenarios. On the other hand, for the rest of the benchmarks, the scaling algorithm selects the values of the frequencies according to the communication times of each benchmark because the static energy consumption increases proportionally to the communication times.
1612 \subsection{Comparison between the proposed frequencies selecting algorithm and the EDP method}
1615 Finding the frequencies that give the best trade-off between the energy consumption and the performance for a parallel
1616 application is not a trivial task. Many algorithms have been proposed to tackle this problem.
1617 In this section, the proposed frequencies selecting algorithm is compared to a method that uses the well known energy and delay product objective function, $EDP=energy \times delay$, that has been used by many researchers \cite{ref80,ref81,ref82}.
1618 This objective function was also used by Spiliopoulos et al. algorithm \cite{ref67} where they select the frequencies that minimize the EDP product and apply them with DVFS operations to the multi-core
1619 architecture. Their online algorithm predicts the energy consumption and execution time of a processor before using the EDP method.
1621 To fairly compare the proposed frequencies scaling algorithm to Spiliopoulos et al. algorithm, called Maxdist and EDP respectively, both algorithms use the same energy model, Equation~\ref{eq:energy-grid} and
1622 execution time model, Equation~\ref{eq:perf-grid}, to predict the energy consumption and the execution time for each computing node.
1623 Moreover, both algorithms start the search space from the upper bound computed as in Equation~\ref{eq:Fint}.
1624 Finally, the resulting EDP algorithm is an exhaustive search algorithm that tests all the possible frequencies, starting from the initial frequencies (upper bound),
1625 and selects the vector of frequencies that minimize the EDP product.
1626 Both algorithms were applied to the class D of the NAS benchmarks running over 16 nodes.
1627 The participating computing nodes are distributed according to the two scenarios described in Section~\ref{ch3:4:1}.
1628 The experimental results, the energy saving, performance degradation and trade-off distance percentages, are
1629 presented in Figures~\ref{fig:edp-eng}, \ref{fig:edp-perf} and \ref{fig:edp-dist} respectively.
1632 \includegraphics[width=.7\textwidth]{fig/ch3/edp_eng}
1633 \caption{The energy reduction percentages induced by the Maxdist method and the EDP method}
1639 \includegraphics[width=.7\textwidth]{fig/ch3/edp_per}
1640 \caption{The performance degradation percentages induced by the Maxdist method and the EDP method}
1641 \label{fig:edp-perf}
1646 \includegraphics[width=.7\textwidth]{fig/ch3/edp_dist}
1647 \caption{The trade-off distance percentages between the energy consumption reduction and the performance for the Maxdist method and the EDP method}
1648 \label{fig:edp-dist}
1652 As shown in these figures, the proposed frequencies selection algorithm, Maxdist, outperforms the EDP algorithm in terms of energy consumption reduction and performance for all of the benchmarks executed over the two scenarios.
1653 The proposed algorithm gives better results than the EDP method because it
1654 maximizes the energy saving and the performance at the same time.
1655 Moreover, the proposed scaling algorithm gives the same weight for these two metrics.
1656 Whereas, the EDP algorithm gives sometimes negative trade-off values for some benchmarks in the two sites scenarios.
1657 These negative trade-off values mean that the performance degradation percentage is higher than the energy saving percentage.
1658 The high positive values of the trade-off distance percentage mean that the energy saving percentage is much higher than the performance degradation percentage.
1659 The complexity of both algorithms, Maxdist and EDP, are of order $O(N \cdot M_i \cdot F_j)$ and
1660 $O(N \cdot M_i \cdot F_j^2)$ respectively, where $N$ is the number of the clusters, $M_i$ is the number of nodes and $F_j$ is the
1661 maximum number of available frequencies of node $j$. When Maxdist is applied to a benchmark that is being executed over 32 nodes distributed between Nancy and Lyon sites, it takes on average $0.01$ $ms$ to compute the best frequencies while the EDP method is on average ten times slower over the same architecture.
1664 \section{Conclusion}
1666 In this chapter, two new online frequency scaling factors selecting algorithms have been presented. They select the best possible vectors of frequency scaling factors that give the
1667 maximum distance (optimal trade-off) between the predicted energy and the
1668 predicted performance curves for a heterogeneous cluster and grid. Both algorithms use a
1669 new energy models for measuring and predicting the energy consumption of message passing
1670 applications with iterations running over a heterogeneous local cluster and a grid platform.
1671 Firstly, the proposed scaling factors selection algorithm for a heterogeneous local cluster is applied to the class C of the NAS parallel benchmarks and simulated by SimGrid.
1672 The results of the simulations showed that the algorithm on average reduces by 29.8\% the energy
1673 consumption of the NAS benchmarks executed over 8 nodes while limiting the degradation of the performance by 3.8\%. The algorithm also selects different scaling factors according to
1674 the percentage of the computing and communication times, and according to the
1675 values of the static and dynamic powers of the CPUs.
1676 Secondly, the proposed scaling factors selection algorithm for a grid is applied to the class D of the NAS parallel benchmarks and executed over the Grid5000 testbed platform.
1677 The experiments executed on 16 nodes distributed over three clusters, showed that the algorithm on average reduces by 30\% the energy consumption
1678 of all the NAS benchmarks while on average only degrading by 3.2\% their performance.
1679 The algorithm was also evaluated in different scenarios that vary in the distribution of the computing nodes between different clusters' sites or use multi-core per node architecture or consume different static power values. The algorithm selects different vectors of frequencies according to the
1680 computations and communication times ratios, and the values of the static and measured dynamic powers of the CPUs. Thus, the simulation and the real results are comparable in term of energy saving and performance degradation percentages.
1681 Finally, both algorithms were compared to a method that uses
1682 the well known energy and delay product as an objective function. The comparison results showed
1683 that the proposed algorithms outperform the latter by selecting vectors of frequencies that give a better