1 \chapterauthor{Rachid Habel}{T\'el\'ecom SudParis, France}
2 \chapterauthor{Pierre Fortin, Fabienne J\'ez\'equel and Jean-Luc Lamotte}{Laboratoire d'Informatique de Paris 6, Université Pierre et Marie Curie, France}
4 %\chapterauthor{Fabienne J\'ez\'equel}{Laboratoire d'Informatique de Paris 6, University Paris 6}
5 %\chapterauthor{Jean-Luc Lamotte}{Laboratoire d'Informatique de Paris 6, University Paris 6}
6 \chapterauthor{Stan Scott}{School of Electronics, Electrical Engineering \& Computer Science,
7 The Queen's University of Belfast, United Kingdom}
9 %\newcommand{\fixme}[1]{{\bf #1}}
11 \chapter[Numerical validation and GPU performance in atomic physics]{Numerical validation and performance optimization on GPUs of an application in atomic physics}
14 \section{Introduction}\label{ch15:intro}
15 As described in Chapter~\ref{chapter1}, GPUs are characterized by hundreds
16 of cores and theoretically perform one order of magnitude better than CPUs.
17 An important factor to consider when programming on GPUs
19 data transfers between CPU memory and GPU memory. Thus, to have good
21 GPUs, applications should be coarse-grained and have a high arithmetic
23 ($i.e.$ the ratio of arithmetic operations to memory operations).
24 Another important aspect of GPU programming is that floating-point
25 operations are preferably performed in single precision\index{precision!single precision}, if the
26 validity of results is not impacted by that format.
27 The GPU compute power for floating-point operations is indeed greater in
28 single precision\index{precision!single precision} than in double precision\index{precision!double precision}.
29 The peak performance ratio between single precision\index{precision!single precision} and double
30 precision varies for example for NVIDIA GPUs from $12$ for the first Tesla
32 to $2$ for the Fermi GPUs (C2050 and C2070)
33 and to $3$ for the latest Kepler architecture (K20/K20X).
34 As far as AMD GPUs are concerned, the latest AMD GPU (Tahiti HD 7970)
35 presents a ratio of $4$.
36 Moreover, GPU internal memory accesses and CPU-GPU data transfers are
37 faster in single precision\index{precision!single precision} than in double precision\index{precision!double precision},
38 because of the different format lengths.
40 This chapter describes the deployment on GPUs of PROP, a program of the
41 2DRMP~\cite{FARM_2DRMP,2DRMP} suite which models electron collisions
42 with H-like atoms and ions at intermediate energies. 2DRMP operates successfully on serial
43 computers, high performance clusters and supercomputers. The primary
44 purpose of the PROP program is to propagate a global
45 R-matrix~\cite{Burke_1987}, $\Re$, in the two-electron configuration
47 The propagation needs to be performed for all collision energies,
48 for instance hundreds of energies,
49 which are independent.
50 Propagation equations are dominated by matrix multiplications involving sub-matrices of $\Re$.
51 However, the matrix multiplications are not
52 straightforward in the sense that $\Re$ dynamically changes the designation of its rows and
53 columns and increases in size as the propagation proceeds \cite{VECPAR}.
55 In a preliminary investigation PROP was selected by GENCI\footnote{GENCI: Grand Equipement National
56 de Calcul Intensif, \url{www.genci.fr}} and
57 CAPS\footnote{CAPS is a software company providing products and solutions
58 for manycore application programming and deployment,
59 \url{www.caps-entreprise.com}},
60 following their first call for projects in 2009-2010
62 deploying applications on hybrid systems based on GPUs.
64 recast the propagation equations with larger matrices.
65 For matrix products the GPU performance gain over CPU increases indeed
66 with the matrix size, since the
67 CPU-GPU transfer overhead becomes less significant and since CPUs are
68 still more efficient for fine computation grains.
69 Then, using HMPP\index{HMPP}\footnote{
70 HMPP or {\em CAPS compiler}, see: \url{www.caps-entreprise.com/hmpp.html}},
72 hybrid and parallel compiler, CAPS
73 developed a version of PROP, in
74 which matrix multiplications are performed on
75 the GPU or the CPU, depending on the matrix size.
76 Unfortunately this partial GPU implementation of PROP does not offer
77 significant acceleration.
79 The work described in this chapter, which is based on a study presented in \cite{PF_PDSEC2011}, aims at
80 improving PROP performance on
81 GPUs by exploring two directions. First, because the original version of PROP is written
82 in double precision\index{precision!double precision},
83 we study the numerical stability of PROP in single precision\index{precision!single precision}.
84 Second, we deploy the whole
85 computation code of PROP on
86 GPUs to avoid the overhead generated by
88 and we propose successive improvements
89 (including a specific one to the Fermi architecture)
90 in order to optimize the GPU code.
95 \section{2DRMP and the PROP program}
97 \subsection{Principles of R-matrix propagation}
98 2DRMP~\cite{FARM_2DRMP,2DRMP} is part of the CPC library\footnote{CPC:
99 Computer Physics Communications,
100 \url{http://cpc.cs.qub.ac.uk/}}.
101 It is a suite of seven
102 programs aimed at creating virtual experiments on high performance and grid
103 architectures to enable the study of electron scattering from H-like
104 atoms and ions at intermediate energies. The 2DRMP suite uses the
105 two-dimensional $R$-matrix propagation approach~\cite{Burke_1987}.
106 In 2DRMP the two-electron configuration space ($r_1$,$r_2$) is
107 divided into sectors.
108 Figure~\ref{prop} shows the division of the two-electron configuration
109 space ($r_1$,$r_2$) into 4 vertical $strips$ representing 10 $sectors$.
110 The key computation in 2DRMP, performed by the PROP program, is the
111 propagation of a global
112 $R$-matrix, $\Re$, from sector to sector across the internal region, as shown in Fig.~\ref{prop}.
116 \includegraphics*[width=0.65\linewidth]{Chapters/chapter15/figures/prop.pdf}
117 \caption{\label{prop} Subdivision of the configuration space
118 ($r_1$,$r_2$) into a set of connected sectors.}
124 \includegraphics*[width=0.8\linewidth]{Chapters/chapter15/figures/Domain.pdf}
125 \caption{\label{domain} Propagation of the R-matrix from domain D to domain D'.}
129 We consider the general situation in
130 Fig.~\ref{domain} where we assume that we already know
131 the global $R$-matrix, $\Re^{I}$, associated with the boundary defined
132 by edges 5, 2, 1 and 6
133 in domain $D$ and we wish to
134 evaluate the new global $R$-matrix, $\Re^{O}$, associated with edges 5, 3, 4 and 6
135 in domain $D'$ following propagation across subregion $d$.
136 Input edges are denoted by I (edges 1 and~2), output edges by O (edges 3 and 4) and
137 common edges by X (edges 5 and~6).
138 Because of symmetry, only the lower half of domains $D$ and $D'$ has to be considered.
139 The global $R$-matrices, $\Re^{I}$ in domain $D$ and $\Re^{O}$ in
140 domain $D'$, can be written as:
142 \Re^{I} = \left(\begin{array}{cc}
143 \Re_{II}^{I} & \Re_{IX}^{I}\\
144 \Re_{XI}^{I} & \Re_{XX}^{I}
147 \Re^{O} = \left(\begin{array}{cc}
148 \Re_{OO}^{O} & \Re_{OX}^{O}\\
149 \Re_{XO}^{O} & \Re_{XX}^{O}
156 From the set of local $R$-matrices, $\mathbf{R}_{ij}$ ($i,j\in \{1,2,3,4\}$)
158 with subregion $d$, we can define
161 \mathbf{r}_{II} = \left(\begin{array}{cc}
162 \mathbf{R}_{11} & \mathbf{R}_{12}\\
163 \mathbf{R}_{21} & \mathbf{R}_{22}
164 \end{array}\right), \label{eqaa} &
165 \mathbf{r}_{IO} = \left(\begin{array}{cc}
166 \mathbf{R}_{13} & \mathbf{R}_{14}\\
167 \mathbf{R}_{23} & \mathbf{R}_{24}
168 \end{array}\right), \label{eqbb}\\
169 \mathbf{r}_{OI} = \left(\begin{array}{cc}
170 \mathbf{R}_{31} & \mathbf{R}_{32}\\
171 \mathbf{R}_{41} & \mathbf{R}_{42}
172 \end{array}\right), \label{eqcc} &
173 \mathbf{r}_{OO} = \left(\begin{array}{cc}
174 \mathbf{R}_{33} & \mathbf{R}_{34}\\
175 \mathbf{R}_{43} & \mathbf{R}_{44}
176 \end{array}\right),\label{eqdd}
179 where $I$ represents the input edges 1 and 2, and $O$ represents
180 the output edges 3 and 4 (see Fig.~\ref{domain}).
181 The propagation across each sector is characterized by equations~(\ref{eq1}) to (\ref{eq4}).
184 \Re^{O}_{OO} &=& \mathbf{r}_{OO} - \mathbf{r}_{IO}^T (r_{II} + \Re^{I}_{II})^{-1}\mathbf{r}_{IO}, \label{eq1} \\
185 \Re^{O}_{OX} &=& \mathbf{r}_{IO}^T (\mathbf{r}_{II} + \Re^{I}_{II})^{-1}\Re^{I}_{IX}, \label{eq2} \\
186 \Re^{O}_{XO} &=& \Re^{I}_{XI}(\mathbf{r}_{II} + \Re^{I}_{II})^{-1}\mathbf{r}_{IO}, \label{eq3} \\
187 \Re^{O}_{XX} &=& \Re^{I}_{XX} - \Re^{I}_{XI}(\mathbf{r}_{II} +\Re^{I}_{II})^{-1}\Re^{I}_{IX}. \label{eq4}
191 The matrix inversions are not explicitly performed. To compute
192 $(r_{II} + \Re^{I}_{II})^{-1}\mathbf{r}_{IO}$ and $(\mathbf{r}_{II} + \Re^{I}_{II})^{-1}\Re^{I}_{IX}$,
193 two linear systems are solved.
198 While equations (\ref{eq1})-(\ref{eq4}) can be applied to the
199 propagation across a general subregion two special situations should be
200 noted: propagation across a diagonal subregion and propagation across
201 a subregion bounded by the $r_{1}$-axis at the beginning of a new
204 In the case of a diagonal subregion, from symmetry considerations,
205 edge 2 is identical to edge 1 and edge 3 is identical to edge~4.
206 Accordingly, with only one input edge and one output edge equations
207 (\ref{eqaa})-(\ref{eqdd}) become:
210 \mathbf{r}_{II} = 2\mathbf{R}_{11}, \
211 \mathbf{r}_{IO} = 2\mathbf{R}_{14}, \label{eq4b}\\
212 \mathbf{r}_{OI} = 2\mathbf{R}_{41}, \
213 \mathbf{r}_{OO} = 2\mathbf{R}_{44}. \label{eq4d}
216 In the case of a subregion bounded by the $r_1$-axis at the beginning
217 of a new strip, we note that the input boundary $I$ consists of only
218 one edge. When propagating across the first subregion in the second
219 strip there is no common boundary $X$: in this case only equation
220 (\ref{eq1}) needs to be solved.
224 Having obtained the global $R$-matrix $\Re$ on the boundary of the
225 innermost subregion (labeled $0$ in Fig.~\ref{prop}), $\Re$ is propagated across
226 each subregion in the order indicated in Fig.~\ref{prop},
227 working systematically from the
228 $r_1$-axis at the bottom of each strip across all subregions to the
233 \subsection{Description of the PROP program}
238 \begin{tabular}{|c|c|c|c|c|c|}
240 \multirow{2}{0.09\linewidth}{\centering Data set} &
241 \multirow{2}{0.15\linewidth}{\centering
242 Local $R$-\\matrix size} &
243 \multirow{2}{0.07\linewidth}{\centering Strips} &
244 \multirow{2}{0.09\linewidth}{\centering Sectors} &
245 \multirow{2}{0.19\linewidth}{\centering Final global \\$R$-matrix size} &
246 \multirow{2}{0.15\linewidth}{\centering Scattering\\energies} \\
249 Small & 90x90 & 4 & 10 & 360x360 & 6\\
251 Medium & 90x90 & 4 & 10 & 360x360 & 64\\
253 Large & 383x383 & 20 & 210 & 7660x7660 & 6\\
255 Huge & 383x383 & 20 & 210 & 7660x7660 & 64\\ \hline
257 \caption{\label{data-sets}Characteristics of four data sets}
261 The PROP program computes the propagation of the $R$-matrix across the sectors of the internal region.
262 Table~\ref{data-sets} shows four different
263 data sets used in this study and highlights the principal parameters of the PROP program.
264 PROP execution can be described by Algorithm~\ref{prop-algo}.
265 First, amplitude arrays and
266 correction data are read from data files generated by the preceding
267 program of the 2DRMP suite.
268 Then, local $R$-matrices are constructed from amplitude arrays.
269 Correction data is used to compute correction vectors added to the diagonal of the local
270 $R$-matrices. The local $R$-matrices, together with the input $R$-matrix,
272 computed on the previous sector, are used to compute the current output
275 At the end of a sector evaluation,
276 the output $R$-matrix becomes the input $R$-matrix
277 for the next evaluation.
280 %% \caption{\label{prop-algo}PROP algorithm}
281 %% \begin{algorithmic}
282 %% \FOR{all scattering energies}
284 %% \STATE Read amplitude arrays
285 %% \STATE Read correction data
286 %% \STATE Construct local $R$-matrices
287 %% \STATE From $\Re^{I}$ and local $R$-matrices, compute $\Re^{O}$
288 %% \STATE $\Re^{O}$ becomes $\Re^{I}$ for the next sector
290 %% \STATE Compute physical $R$-Matrix
296 \caption{\label{prop-algo}PROP algorithm}
298 \For{all scattering energies} {
300 Read amplitude arrays\;
301 Read correction data\;
302 Construct local $R$-matrices\;
303 From $\Re^{I}$ and local $R$-matrices, compute $\Re^{O}$\;
304 $\Re^{O}$ becomes $\Re^{I}$ for the next sector\;
306 Compute physical $R$-Matrix \;
312 On the first sector, there is no input $R$-matrix yet. To bootstrap
313 the propagation, the first output $R$-matrix is constructed using only
314 one local $R$-matrix. On the last sector, that is, on the boundary of
315 the inner region, a physical $R$-matrix corresponding to the output
316 $R$-matrix is computed and stored into an output file.
318 In the PROP program, sectors are characterized into four types,
319 depending on the computation performed:
321 \item the starting sector (labeled 0 in Fig.~\ref{prop})
322 \item the axis sectors (labeled 1, 3 and 6 in Fig.~\ref{prop})
323 \item the diagonal sectors (labeled 2, 5 and 9 in Fig.~\ref{prop})
324 \item the off-diagonal sectors (labeled 4, 7 and 8 in Fig.~\ref{prop}).
328 The serial version of PROP is implemented in Fortran~90 and uses
329 for linear algebra operations BLAS\index{BLAS} and LAPACK\index{LAPACK} routines
330 which are fully optimized for x86 architecture.
333 serially propagates the $R$-matrix for
334 all scattering energies.
335 Since the propagations for these different
336 energies are independent, there also
337 exists an embarrassingly parallel version of
339 that spreads the computations of
341 among multiple CPU nodes via
346 \subsection{CAPS implementation}
349 In order to handle larger matrices, and thus obtain better GPU speedup, CAPS
350 recast equations (\ref{eq1}) to (\ref{eq4}) into one equation.
351 The output $R$-matrix $\Re^{O}$ defined by equation~(\ref{eq:RI_RO}) is now computed as follows.
352 \begin{equation}\label{eq_CAPS_1}
353 \Re^{O} = \Re^{O^{\ \prime}} + U A^{-1} V,
355 \begin{equation}\label{eq_CAPS_2}
357 \Re^{O^{\ \prime}}= \left(\begin{array}{cc}
358 \mathbf{r}_{OO} & 0\\
359 0 & \Re^I_{XX} \end{array}\right), \
360 U= \left(\begin{array}{c}
361 \mathbf-{r}_{IO}^{T}\\
362 \Re^I_{XI} \end{array}\right),
364 \begin{equation}\label{eq_CAPS_3}
365 A= \mathbf{r}_{II} + \Re^I_{II} \ {\rm and} \
366 V= (\mathbf{r}_{IO}\ \ \ -\Re^I_{IX}).
369 To compute $W=A^{-1}V$, no matrix inversion is performed. The matrix
370 system $AW=V$ is solved.
371 This reimplementation of PROP reduces the number of equations to be
372 solved and the number of matrix copies for evaluating each sector.
373 For instance, for an off-diagonal sector,
374 copies fall from 22 to 5, matrix multiplications from 4 to~1 and calls
375 to a linear equation solver from 2 to 1.
377 To implement this version, CAPS
378 used HMPP\index{HMPP}, a
379 commercial hybrid and parallel compiler,
380 based on compiler directives like the new OpenACC\index{OpenACC} standard\footnote{See: \url{www.openacc-standard.org}}.
381 If the matrices are large enough (the limit sizes are experimental parameters),
382 they are multiplied on the GPU, otherwise on the CPU.
384 used the MKL BLAS\index{BLAS} implementation on an Intel Xeon
385 x5560 quad core CPU (2.8 GHz)
386 and the CUBLAS\index{CUBLAS} library (CUDA 2.2) on one Tesla C1060 GPU.
387 On the large data set (see Table~\ref{data-sets}), CAPS
388 obtained a speedup of 1.15 for the GPU
389 version over the CPU one (with multi-threaded MKL calls on the four
390 CPU cores). This limited gain in performance is mainly
391 due to the use of double precision\index{precision!double precision} computation
392 and to the small or medium sizes of most matrices.
393 For these matrices, the computation gain on
395 strongly affected by the overhead
396 generated by transferring these matrices from
397 the CPU memory to the GPU memory to perform each matrix multiplication and then
398 transferring the result back to the CPU memory.
400 Our goal is to speedup PROP more significantly by porting the whole
401 code to the GPU and therefore avoiding
403 intermediate data transfers between
404 the host (CPU) and the GPU. We will also study the
405 stability of PROP in single precision\index{precision!single precision} because
406 single precision\index{precision!single precision} computation is faster on the GPU
407 and CPU-GPU data transfers are twice as fast as those performed in
408 double precision\index{precision!double precision}.
412 \section{Numerical validation\index{numerical validation} of PROP in single precision\index{precision!single precision}}
413 \label{single-precision}
418 \begin{tabular}{|c|c|}
420 relative error interval & \# occurrences \\
424 [1.E-8, 1.E-6) & 1241 \\
426 [1.E-6, 1.E-4) & 48728 \\
428 [1.E-4, 1.E-2) & 184065 \\
430 [1.E-2, 1) & 27723 \\
434 [100, $+\infty$) & 1 \\
438 \caption{\label{sp-distrib}Error distribution for medium case in single precision\index{precision!single precision}}
443 Floating-point input data, computation and output data of PROP are
444 originally in double precision\index{precision!double precision} format.
445 PROP produces a standard $R$-matrix H-file \cite{FARM_2DRMP}
446 and a collection of Rmat00X files (where X
447 ranges from 0 to the number of scattering energies - 1)
448 holding the physical R-matrix for each
450 The H-file and the Rmat00X files are binary input files of the FARM program \cite{FARM_2DRMP}
451 (last program of the 2DRMP suite).
452 Their text equivalent are the prop.out
453 and the prop00X.out files.
454 To study the validity of PROP results in single precision\index{precision!single precision},
456 reference results are
457 generated by running the serial version of PROP in double precision\index{precision!double precision}.
458 Data used in the most costly computation parts are read from input files in
459 double precision\index{precision!double precision} format and then
460 cast to single precision\index{precision!single precision} format.
461 PROP results (input of FARM) are computed in single precision\index{precision!single precision} and written
462 into files in double precision\index{precision!double precision}.
464 \subsection{Medium case study}
467 \includegraphics*[width=0.9\linewidth]{Chapters/chapter15/figures/error.pdf}
468 \caption{\label{fig:sp-distrib} Error distribution for medium case in single precision\index{precision!single precision}}
472 The physical $R$-matrices, in
473 the prop00X.out files, are compared to the
474 reference ones for the medium case (see Table~\ref{data-sets}).
476 error distribution is
477 given in Fig.~\ref{fig:sp-distrib}.
478 We focus on the largest errors.
480 \item Errors greater than 100: the only impacted value is of order 1.E-6
481 and is negligible compared to the other ones
482 in the same prop00X.out file.
484 \item Errors between 1 and 100: the values corresponding to the
485 largest errors are of order 1.E-3 and are negligible compared to
486 the majority of the other values which range between 1.E-2 and
489 \item Errors between 1.E-2 and 1: the largest errors ($\ge$ 6\%)
490 impact values the order of magnitude of which is at most 1.E-1.
491 These values are negligible.
492 Relative errors of approximately 5\% impact values the order of
493 magnitude of which is at most 1.E2.
494 For instance, the value 164 produced by the reference version of
495 PROP becomes 172 in the single precision\index{precision!single precision} version.
499 To study the impact of the single precision\index{precision!single precision} version of PROP on the
500 FARM program, the cross-section
501 results files corresponding to
504 {1s2s}, {1s2p}, {1s3s}, {1s3p}, {1s3d},
505 {1s4s}, {2p4d} are compared to the reference ones.
506 Table~\ref{sp-farm} shows that all cross-section files are impacted by
507 errors. Indeed in the {2p4d} file, four relative errors are
508 greater than one and the maximum relative error is 1.60.
509 However the largest errors impact negligible values. For example, the maximum
510 error (1.60) impacts a reference value which is 4.5E-4. The largest
511 values are impacted by low errors. For instance, the maximum value
512 (1.16) is impacted by a relative error of the order 1.E-3.
516 \begin{tabular}{|c|c||c|c|} \hline
517 file & largest relative error & file & largest relative error\\ \hline
518 {1s1s} & 0.02& {1s3p} & 0.11 \\ \hline
519 {1s2s} & 0.06 & {1s3d} & 0.22 \\ \hline
520 {1s2p} & 0.08 & {1s4s} & 0.20 \\ \hline
521 {1s3s} & 0.17 &2p4d & 1.60 \\ \hline
523 \caption{\label{sp-farm}Impact on FARM of the single precision\index{precision!single precision} version of PROP}
527 To examine in more detail the impact of PROP on FARM,
528 cross sections above the ionization threshold (1 Ryd)
529 are compared in single and
530 double precision\index{precision!double precision} for
531 transitions amongst the 1s, \dots 4s, 2p, \dots 4p, 3d, 4d target states.
532 This comparison is carried out by generating 45 plots. In all the
533 plots, results in single and double precision\index{precision!double precision} match except for few
534 scattering energies which are very close to pseudo-state thresholds.
535 For example Fig.~\ref{1s2p} and \ref{1s4d} present the scattering energies corresponding to the
536 {1s2p} and {1s4d} cross-sections computed in single and double precision\index{precision!double precision}. For some cross-sections,
537 increasing a threshold parameter from 1.E-4 to 1.E-3 in the FARM
539 results in energies close to threshold being avoided
541 the cross-sections in double and single precision\index{precision!single precision} match more
543 This is the case for instance for cross-section 1s2p (see Fig.~\ref{1s2p3}).
544 However for other cross-sections (such as 1s4d) some problematic energies remain even if the
545 threshold parameter in the FARM
546 program is increased to 1.E-3 (see Fig.~\ref{1s4d3}). A higher
547 threshold parameter would be required for such cross-sections.
551 \subfigure[threshold = 1.E-4]{
552 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s2p.pdf}
555 \subfigure[threshold = 1.E-3]{
556 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s2p3.pdf}
559 \label{fig:1s2p_10sectors}
560 \caption{1s2p cross-section, 10 sectors}
565 \subfigure[threshold = 1.E-4]{
566 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s4d.pdf}
569 \subfigure[threshold = 1.E-3]{
570 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s4d3.pdf}
573 \label{fig:1s4d_10sectors}
574 \caption{1s4d cross-section, 10 sectors}
577 As a conclusion, the medium case study shows that the execution of
578 PROP in single precision\index{precision!single precision} leads to a few inexact scattering energies to
579 be computed by the FARM program for some cross-sections.
580 Thanks to a suitable threshold parameter in the FARM program these problematic energies may possibly
582 Instead of investigating deeper the choice of such a parameter for the medium case, we analyze the
583 single precision\index{precision!single precision} computation in a more
584 realistic case in Sect.~\ref{huge}.
586 The conclusion of the medium case study is that running PROP in single
587 precision gives relatively stable results provided that suitable
588 parameter values are used in the FARM program in order to skip the
589 problematic energies that are too close to the pseudo-state
590 thresholds. To verify if this conclusion is still valid with a larger
591 data set, the single precision\index{precision!single precision} computation is analyzed in a more
592 realistic case in Sect.~\ref{huge}.
595 \subsection{Huge case study}\label{huge}
600 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s2pHT.pdf}
601 \caption{\label{1s2pHT}1s2p cross-section, threshold = 1.E-4, 210 sectors}
606 \includegraphics*[width=.76\linewidth]{Chapters/chapter15/figures/1s2pHT.pdf}
607 \caption{\label{1s4dHT}1s4d cross-section, threshold = 1.E-4, 210 sectors}
610 We study here the impact on FARM of the PROP program run in
611 single precision\index{precision!single precision} for the huge case (see Table~\ref{data-sets}).
614 atomic target states 1s \dots 7i are explored, which
616 406 comparison plots.
617 It should be noted that in this case, over the same energy range above the ionization threshold, the density of pseudo-state thresholds is significantly increased compared to the medium case.
618 As expected, all the plots exhibit large differences between single and double
619 precision cross-sections.
620 For example Fig.~\ref{1s2pHT} and \ref{1s4dHT} present the 1s2p and 1s4d cross-sections computed in
621 single and double precision\index{precision!double precision} for the huge case.
622 We can conclude that PROP in single precision\index{precision!single precision} gives invalid results
623 for realistic simulation cases above the ionization threshold.
624 Therefore the deployment of PROP on GPU, described in Sect.~\ref{gpu-implem},
625 has been carried out in double precision\index{precision!double precision}.
627 \section{Towards a complete deployment of PROP on GPUs}
630 We now detail how PROP has been progressively deployed on
631 GPUs in double precision\index{precision!double precision} in order to avoid the
632 expensive memory transfers between the host and the GPU.
633 Different versions with successive improvements and optimizations are presented.
634 We use CUDA~\cite{CUDA_ProgGuide} for GPU programming, as well as the
635 CUBLAS\index{CUBLAS}~\cite{CUBLAS}
636 and MAGMA \cite{MAGMA} libraries for linear algebra operations.
637 Since PROP is written in Fortran 90, {\em wrappers\index{wrapper}} in C are used to
638 enable calls to CUDA kernels from PROP routines.
641 \subsection{Computing the output $R$-matrix on GPU}
646 \includegraphics[width=0.7\linewidth]{Chapters/chapter15/figures/offdiagonal_nb.pdf}
647 \caption{\label{offdiagonal} The six steps of an off-diagonal sector
651 As mentioned in Algorithm~\ref{prop-algo}, evaluating a sector
652 mainly consists in constructing local $R$-matrices and in computing
653 one output $R$-matrix, $\Re^{O}$. In this first step of the porting
654 process, referred to as GPU V1\label{gpuv1},
655 we only consider the computation of $\Re^{O}$ on the GPU.
656 We distinguish the following six steps, related to equations
657 (\ref{eq_CAPS_1}), (\ref{eq_CAPS_2}) and (\ref{eq_CAPS_3}), and illustrated in
658 Fig.~\ref{offdiagonal} for an off-diagonal sector.
661 \item[Step 1] (``Input copies''):~data are copied from $\Re^{I}$
662 to temporary arrays ($A$, $U$, $V$) and to $\Re^{O}$.
663 These copies, along with possible scalings or transpositions, are
664 implemented as CUDA kernels which can be applied to two
665 matrices of any size and starting at any offset.
666 Memory accesses are coalesced\index{coalesced memory accesses} \cite{CUDA_ProgGuide} in order to
667 provide the best performance for such memory-bound kernels.
668 \item[Step 2] (``Local copies''):~data are copied from
669 local $R$-matrices to temporary arrays ($U$, $V$) and to $\Re^{O}$.
670 Moreover data from local $R$-matrix
672 is added to matrix $A$ (via a CUDA kernel) and zeroes are written in
673 $\Re^{O}$ where required.
674 \item[Step 3] (``Linear system solving''):~matrix $A$ is factorized
675 using the MAGMA DGETRF\index{MAGMA functions!DGETRF}
676 routine and the result is stored in-place.
677 \item[Step 4] (``Linear system solving'' cont.):~the matrix system
678 of linear equations $AW$ = $V$ is solved using the MAGMA DGETRS\index{MAGMA functions!DGETRS}
679 routine. The solution is stored in matrix $V$.
680 \item[Step 5] (``Output matrix product''):~matrix $U$
681 is multiplied by matrix $V$ using the CUBLAS\index{CUBLAS} DGEMM
682 routine. The result is stored in a temporary matrix~$t$.
683 \item[Step 6] (``Output add''):~$t$ is added to $\Re^{O}$ (CUDA
687 All the involved matrices are stored in the GPU memory. Only the
688 local $R$-matrices are first constructed on the host and then sent
689 to the GPU memory, since these matrices vary from sector to sector.
690 The evaluation of the axis and diagonal sectors is similar.
691 However, fewer operations and copies are required because of
692 symmetry considerations \cite{2DRMP}.
694 \subsection{Constructing the local $R$-matrices on GPU}
698 \includegraphics[width=0.7\linewidth]{Chapters/chapter15/figures/amplitudes_nb.pdf}
699 \caption{\label{amplitudes} Constructing the local $R$-matrix R34
700 from the $j$ amplitude array associated with edge 4 and the $i$
701 amplitude array associated with edge~3.}
704 Local $R$-matrices are constructed using two three dimensional arrays,
705 $i$ and $j$. Each three dimensional array contains four
706 matrices corresponding to the surface amplitudes associated with the
707 four edges of a sector. Those matrices are named {\em amplitude arrays}.
708 $j$ amplitude arrays are read from data files and $i$ amplitude arrays
709 are obtained by scaling each row of the $j$ amplitude arrays.
710 The main part of the construction of a local $R$-matrix,
711 presented in Fig.~\ref{amplitudes},
712 is a matrix product between
713 one $i$ amplitude array and one transposed $j$ amplitude array
714 which is performed by a single DGEMM
715 BLAS\index{BLAS} call.
716 In this version, hereafter referred to as GPU
717 V2\label{gpuv2}, $i$ and $j$ amplitude arrays are transferred to the
718 GPU memory and the required matrix multiplications are performed on
719 the GPU (via CUBLAS\index{CUBLAS} routines).
722 The involved matrices having medium sizes (either $3066 \times 383$ or
724 performing these matrix multiplications
725 on the GPU is expected to be faster than on the CPU.
726 However, this implies a greater communication volume
727 between the CPU and the GPU
728 since the $i$ and $j$ amplitude arrays are larger than the local
730 It can be noticed that correction data are also used in the
731 construction of a local $R$-matrix,
732 but this is a minor part in the
733 computation. However, these correction data also have to be
734 transferred from the CPU to the GPU for each sector.
736 \subsection{Scaling amplitude arrays on GPU}
738 should be worthwhile to try to reduce the CPU-GPU data
739 transfers of the GPU V2, where the $i$ and $j$ amplitude arrays are
740 constructed on the host and then sent to the GPU memory for each sector.
741 In this new version, hereafter referred to as GPU V3\label{gpuv3}, we
742 transfer only the $j$ amplitude arrays and the
743 required scaling factors (stored in one 1D array) to the GPU memory,
744 so that the $i$ amplitude arrays are
745 then directly computed on the GPU by multiplying the $j$ amplitude
746 arrays by these scaling factors (via a CUDA kernel).
747 Therefore, we save the transfer of four $i$ amplitude arrays on
748 each sector by transferring only this 1D array of scaling factors.
749 Moreover, scaling $j$ amplitude arrays is expected to be faster on the
750 GPU than on the CPU, thanks to the massively parallel architecture of
751 the GPU and thanks to its higher internal memory bandwidth.
753 \subsection{Using double-buffering\index{double-buffering} to overlap I/O and computation}
757 \includegraphics[width=0.8\linewidth]{Chapters/chapter15/figures/C1060_V3_IO_COMP.pdf}
758 \caption{\label{overlapping} Compute and I/O times for the GPU V3 on
762 As described in Algorithm~\ref{prop-algo}, there are two main steps in
763 the propagation across a sector: reading amplitude arrays
764 and correction data from I/O files and
765 evaluating the current sector.
766 Fig.~\ref{overlapping} shows the I/O times and the evaluation times
767 of each sector for the huge case execution (210 sectors, 20 strips) of the GPU V3
769 Whereas the times required by the off-diagonal sectors are similar
770 within each of the 20 strips,
771 the times for diagonal sectors of each strip
772 are the shortest ones, the times for the axis sectors being
774 The I/O times are roughly constant among all strips.
775 The evaluation time is equivalent to the I/O
776 time for the first sectors. But this evaluation time grows
777 linearly with the strip number, and rapidly exceeds the I/O
780 It is thus interesting to use a double-buffering\index{double-buffering} technique to overlap the
781 I/O time with the evaluation time:
782 for each sector, the evaluation of sector $n$ is performed
783 (on GPU) simultaneously with the reading of data for sector
784 $n+1$ (on CPU). This requires the duplication in the CPU memory of all the
786 used for storing data read from I/O files for each sector.
787 This version, hereafter referred to as GPU
788 V4\label{gpuv4}, uses POSIX threads\index{POSIX threads}. Two threads are
789 executed concurrently: an I/O thread that reads data from I/O files
790 for each sector, and a computation thread, dedicated to the propagation
791 of the global $R$-matrix, that performs successively for each sector
792 all necessary computations on GPU,
793 as well as all required CPU-GPU data transfers.
794 The evaluation of a sector uses the data read for this sector as well
795 as the global $R$-matrix computed on the previous sector.
796 This dependency requires synchronizations between the I/O thread and
797 the computation thread which are implemented through standard POSIX
801 \subsection{Matrix padding\index{padding}}
803 performance and the MAGMA DGETRF\index{MAGMA functions!DGETRF}/DGETRS\index{MAGMA functions!DGETRS}
804 performance is reduced when the sizes (or
805 the leading dimensions) of the matrix are not multiples of the inner blocking size \cite{NTD10a}.
806 This inner blocking size can be 32 or 64, depending on the computation
807 and on the underlying
808 GPU architecture \cite{MAGMA,NTD10b}.
809 In this version (GPU V5\label{gpuv5}),
810 the matrices are therefore padded with $0.0$ (and $1.0$ on the diagonal for the linear systems)
811 so that their sizes are
813 This corresponds indeed to the optimal size for the matrix product on the
814 Fermi architecture \cite{NTD10b}. And as far as linear system solving is
815 concerned, all the matrices have sizes which are multiples of 383: we
816 therefore use padding\index{padding} to obtain multiples of 384 (which are
817 again multiples of 64).
818 It can be noticed that this padding\index{padding} has to be performed dynamically
819 as the matrices increase in size during the propagation
821 maximum required storage space is however allocated only once in the
826 \section{Performance results}
827 \subsection{PROP deployment on GPU}
831 \begin{tabular}{|c||c|c||}
833 PROP version & \multicolumn{2}{c|}{Execution time} \\
836 CPU version: 1 core & \multicolumn{2}{c|}{201m32s} \\
838 CPU version: 4 cores & \multicolumn{2}{c|}{113m28s} \\
840 GPU version & C1060 & C2050 \\
842 GPU V1 (\S~\ref{gpuv1}) & 79m25s & 66m22s \\
844 GPU V2 (\S~\ref{gpuv2}) & 47m58s & 29m52s \\
846 GPU V3 (\S~\ref{gpuv3}) & 41m28s & 23m46s \\
848 GPU V4 (\S~\ref{gpuv4}) & 27m21s & 13m55s\\
850 GPU V5 (\S~\ref{gpuv5}) & 24m27s & 12m39s \\
854 \caption{Execution time of PROP on CPU and GPU}
861 %% \begin{tabular}{|c||c|c||}
863 %% PROP version & \multicolumn{2}{c|}{Execution time} \\
865 %% CPU version & 1 core & 4 cores \\\hline
866 %% & {201m32s} & {113m28s} \\ \hline \hline
867 %% GPU version & C1060 & C2050 \\
869 %% GPU V1 (\ref{gpuv1}) & 79m25s & 66m22s \\
871 %% GPU V2 (\ref{gpuv2}) & 47m58s & 29m52s \\
873 %% GPU V3 (\ref{gpuv3}) & 41m28s & 23m46s \\
875 %% GPU V4 (\ref{gpuv4}) & 27m21s & 13m55s\\
877 %% GPU V5 (\ref{gpuv5}) & 24m27s & 12m39s \\
881 %% \caption{Execution time of the successive GPU versions}
882 %% \label{table:time}
887 \subfigure[Speedup over 1 CPU core]{
888 \includegraphics*[width=0.76
889 \linewidth]{Chapters/chapter15/figures/histo_speedup_1core.pdf}
890 \label{fig:speedup_1core}
893 \subfigure[Speedup over 4 CPU cores]{
894 \includegraphics*[width=0.76
895 \linewidth]{Chapters/chapter15/figures/histo_speedup_4cores.pdf}
896 \label{fig:speedup_4cores}
899 \caption{Speedup of the successive GPU versions.}
902 Table~\ref{table:time} presents
904 of PROP on CPUs and GPUs,
905 each version solves the propagation equations in the
906 form~(\ref{eq_CAPS_1}-\ref{eq_CAPS_3}) as proposed by CAPS.
907 Fig.~\ref{fig:speedup_1core} (respectively \ref{fig:speedup_4cores})
908 shows the speedup of the successive GPU versions
909 over one CPU core (respectively four CPU cores).
910 We use here Intel Q8200 quad-core CPUs (2.33 GHz), one C1060 GPU and
911 one C2050 (Fermi) GPU, located at
912 UPMC (Universit\'e Pierre et Marie Curie, Paris, France).
913 As a remark, the execution times measured on the C2050 would be the same
914 on the C2070 and on the C2075, the only difference between these GPUs
915 being their memory size and their TDP (Thermal Design Power)\index{TDP (Thermal Design Power)}.
916 We emphasize that the execution times correspond to the
917 complete propagation for all six energies of the large case (see
918 Table~\ref{data-sets}), that is to say to the complete execution of
920 Since energies are independent, execution times for more energies
921 (e.g. the huge case) should be proportional
922 to those reported in Table~\ref{table:time}.
924 These tests, which have been performed with CUDA 3.2, CUBLAS\index{CUBLAS} 3.2 and
926 show that the successive GPU versions of PROP offer
927 increasing, and at the end interesting, speedups.
929 V2 shows that it is worth increasing slightly the
930 CPU-GPU communication volume in order to perform
931 large enough matrix products on the GPU.
932 This communication volume can fortunately be
933 reduced thanks to~V3,
934 which also accelerates the computation of
935 amplitude arrays thanks to the GPU.
937 double-buffering\index{double-buffering} technique implemented in V4
938 effectively enables the overlapping of
939 I/O operations with computation, while the
940 padding\index{padding} implemented in V5 also improves the computation times.
942 is noticed that the padding\index{padding}
943 does offer much more performance gain with,
944 for example, CUDA 3.1 and the MAGMA DGEMM\index{MAGMA functions!DGEMM}~\cite{NTD10b}: the
945 speedup with respect to one
946 CPU core was increased from 6.3 to 8.1 on C1060, and from 9.5 to 14.3
948 Indeed since CUBLAS\index{CUBLAS} 3.2 performance has been improved for non block multiple
949 matrix sizes through MAGMA code~\cite{NTD10a}.
950 Although for all versions the C2050 (with its improved
951 double precision\index{precision!double precision} performance) offers up to almost
952 double speedup compared to
953 the C1060, the performance obtained with both architectures justifies the use of
954 the GPU for such an application.
956 \subsection{PROP execution profile}
960 \includegraphics*[width=0.64\linewidth]{Chapters/chapter15/figures/CPU_1_CORE_TIMES.pdf}
961 \caption{CPU (1 core) execution times for the off-diagonal sectors of the large case.}
962 \label{fig:CPU-timing}
967 \subfigure[GPU V5 on one C1060]{
968 \includegraphics*[width=0.64\linewidth]{Chapters/chapter15/figures/GPU_V5_C1060_TIMES.pdf}
971 \subfigure[GPU V5 on one C2050]{
972 \includegraphics*[width=0.64\linewidth]{Chapters/chapter15/figures/GPU_V5_C2050_TIMES.pdf}
973 \label{fermi-timing}}
975 \caption{GPU execution times for the off-diagonal sectors of
977 \label{fig:profileGPU}
980 We detail here the execution profile on
981 the CPU and the GPU for the evaluation of all off-diagonal sectors
982 (the most representative ones) for a complete energy propagation.
983 Fig.~\ref{fig:CPU-timing} and \ref{fig:profileGPU} show CPU and GPU execution times for the
984 171 off-diagonal sectors of the large case (see Table \ref{data-sets}).
985 ``Copying, adding, scaling'' corresponds to the amplitude
986 array construction (scaling) as well as to steps 1, 2 and 6 in
987 Sect.~\ref{gpu-RO}, all implemented via CUDA kernels.
988 ``CPU-GPU transfers''
989 aggregate transfer times for the $j$ amplitude
990 arrays and the scaling factors, as well as for the correction data.
991 ``Amplitude matrix product'' corresponds to the DGEMM call to
992 construct the local R-matrices from the $i$ and $j$ amplitude
994 ``Linear system solving'' and ``Output matrix product'' correspond
995 respectively to steps 3-4 and to step 5 in Sect.~\ref{gpu-RO}.
997 On one CPU core (see Fig.~\ref{fig:CPU-timing}),
998 matrix products for the construction of the local
999 $R$-matrices require the same
1000 computation time during the whole propagation. Likewise the CPU time required by
1001 matrix products for the output $R$-matrix is constant within each
1002 strip. But as the global $R$-matrix is propagated from strip to
1004 the matrices $U$ and $V$ increase, so does their multiplication time.
1005 The time required to solve the linear system increases
1006 slightly during the propagation.
1007 These three operations (``Amplitude matrix product'', ``Output matrix
1008 product'' and ``Linear system solving'') are clearly dominant in terms
1010 time compared to the other remaining operations, which justify our
1011 primary focus on such three linear algebra operations.
1014 On the C1060 (see Fig.~\ref{GPU-timing}), we have
1015 generally managed to obtain a similar speedup for all operations
1016 (around 8, which corresponds to Fig.~\ref{fig:speedup_1core}). Only the linear system solving
1017 presents a lower speedup (around~4).
1018 The CUDA kernels and the remaining CPU-GPU transfers make a minor contribution
1019 to the overall computation time and do not require
1020 additional improvements.
1022 On the C2050 (see Fig.~\ref{fermi-timing}), additional speedup is
1023 obtained for all operations, except for the
1024 CPU-GPU transfers and the linear system solving.
1025 The CPU-GPU transfers are mainly due to the $j$ amplitude arrays, and
1026 currently still correspond to minor times. When required, the
1027 double-buffering\index{double-buffering} technique may also be used to overlap such transfers with computation on the GPU.
1031 \section{Propagation of multiple concurrent energies on GPU}\index{concurrent kernel execution}
1033 Finally, we present here an improvement that can
1034 benefit from the Fermi architecture, as well as from the newest Kepler
1036 both of which enable the concurrent execution of multiple
1037 CUDA kernels\index{concurrent kernel execution}, thus offering additional speedup on
1038 GPUs for small or medium computation grain kernels.
1039 In our case, the performance gain on the GPU is indeed limited
1040 since most matrices have small or medium sizes.
1041 By using multiple streams within one CUDA context~\cite{CUDA_ProgGuide},
1042 we can propagate multiple energies
1043 concurrently\index{concurrent kernel execution} on the Fermi GPU.
1044 It can be noticed that all GPU computations for all streams are
1045 launched by the same host thread. We therefore rely here on the {\em legacy
1046 API} of CUBLAS\index{CUBLAS}~\cite{CUBLAS} (like MAGMA)
1047 without thread safety problems.
1048 A {\em breadth first} issue order is used for kernel
1049 launchs \cite{CUDA_stream}: for a given GPU kernel, all kernel launchs
1050 are indeed issued together in the host thread, using one stream for each
1051 concurrent energy, in order to maximize concurrent kernel
1052 execution\index{concurrent kernel execution}.
1053 Of course, the memory available on the GPU must be large enough to
1054 store all data structures required by each energy.
1055 Moreover, multiple streams are also used within the
1056 propagation of each single energy
1057 in order to enable concurrent executions among the required kernels.
1062 \begin{tabular}{|c|c||c|c|c|c|c|}
1064 \multirow{4}{0.18\linewidth}{Medium case} & Number of &
1065 \multirow{2}{0.07\linewidth}{\centering 1} &
1066 \multirow{2}{0.07\linewidth}{\centering 2} &
1067 \multirow{2}{0.07\linewidth}{\centering 4} &
1068 \multirow{2}{0.07\linewidth}{\centering 8} &
1069 \multirow{2}{0.07\linewidth}{\centering 16} \\
1070 & energies & & & & & \\
1072 & Time (s) & 11.18 & 6.87 & 5.32 & 4.96 & 4.76 \\
1074 & Speedup & - & 1.63 & 2.10 & 2.26 & 2.35 \\
1077 \multirow{4}{0.18\linewidth}{Large case} & Number of &
1078 \multirow{2}{0.07\linewidth}{\centering 1} &
1079 \multicolumn{2}{c|}{\multirow{2}{0.07\linewidth}{\centering 2}} &
1080 \multicolumn{2}{c|}{\multirow{2}{0.07\linewidth}{\centering 3}} \\
1081 & energies & & \multicolumn{2}{c|}{~} & \multicolumn{2}{c|}{~} \\
1083 & Time (s) & 509.51 & \multicolumn{2}{c|}{451.49} & \multicolumn{2}{c|}{436.72} \\
1085 & Speedup & - & \multicolumn{2}{c|}{1.13} & \multicolumn{2}{c|}{1.17} \\
1088 \caption{\label{t:perfs_V6} Performance results with multiple
1090 on one C2070 GPU. GPU initialization times are not considered here. }
1094 In order to have enough GPU memory to run two or three concurrent
1095 energies for the large case, we use one C2070 GPU
1096 (featuring 6GB of memory)
1097 with one Intel X5650 hex-core CPU, CUDA 4.1 and CUBLAS\index{CUBLAS} 4.1, as
1098 well as the latest MAGMA release (version 1.3.0).
1099 Substantial changes have been required
1100 in the MAGMA calls with respect to the previous versions of PROP that were using MAGMA 0.2.
1101 Table~\ref{t:perfs_V6} presents the speedups
1102 obtained on the Fermi GPU for multiple concurrent
1103 energies (up to sixteen since this is the maximum number of concurrent
1104 kernel launches currently supported \cite{CUDA_ProgGuide}).
1105 With the medium case, speedups greater than 2 are obtained with four
1106 concurrent energies or more.
1107 With the more realistic large case, the performance gain is lower mainly because of
1108 the increase in matrix sizes, which implies a better GPU usage
1109 with only one energy on the GPU. The concurrent execution of multiple
1110 kernels\index{concurrent kernel execution} is also limited by other operations on the
1111 GPU \cite{CUDA_ProgGuide,CUDA_stream} and by the current MAGMA code which
1112 prevents concurrent MAGMA calls in different streams.
1113 Better speedups can be here expected on the latest Kepler GPUs which
1114 offer additional compute power, and whose {\em Hyper-Q} feature may help
1115 improve further the GPU utilization with concurrent energies.
1116 On the contrary, the same code on the C1060 shows no speedup
1117 since the concurrent kernel launches are serialized on this previous GPU architecture.
1126 \section{Conclusion and future work}
1129 In this chapter, we have presented our methodology and our results in
1131 a GPU of an application (the PROP program) in atomic physics.
1133 We have started by studying the numerical stability of PROP using
1134 single precision\index{precision!single precision} arithmetic. This has shown that PROP
1135 using single precision\index{precision!single precision}, while relatively stable for some small cases,
1136 gives unsatisfactory results for realistic simulation cases above the
1137 ionization threshold where there is a
1138 significant density of pseudo-states. It is
1139 expected that this may not be the case below the ionization threshold
1140 where the actual target states are less dense. This requires further
1144 therefore deployed the PROP code in double precision\index{precision!double precision} on
1145 a GPU, with successive improvements. The different GPU versions
1146 each offer increasing speedups over the CPU version.
1147 Compared to the single (respectively four) core(s) CPU version, the
1148 optimal GPU implementation
1149 gives a speedup of 8.2 (resp. 4.6) on one C1060 GPU,
1150 and a speedup of 15.9 (resp. 9.0) on one
1151 C2050 GPU with improved double precision\index{precision!double precision} performance.
1152 An additional gain of around 15\%
1153 can also be obtained on one Fermi GPU
1154 with large memory (C2070) thanks to concurrent kernel execution.
1157 cannot be directly compared with the 1.15 speedup
1158 obtained with the HMPP\index{HMPP} version, since in our tests the CPUs are
1159 different and the CUBLAS\index{CUBLAS} versions are more recent.
1160 However, the programming effort required
1161 progressively to deploy PROP on GPUs clearly offers improved and interesting speedups for this
1162 real-life application in double precision\index{precision!double precision} with varying-size matrices.
1165 We are currently working on a hybrid CPU-GPU version that spreads the
1166 computations of the independent energies on both the CPU
1167 and the GPU. This will enable
1168 multiple energy execution on the CPU, with
1169 one or several core(s) dedicated to each energy (via multi-threaded
1170 BLAS\index{BLAS} libraries). Multiple
1171 concurrent energies may also be propagated on each Fermi GPU.
1172 By merging this work with the current MPI PROP program, we will
1173 obtain a scalable hybrid CPU-GPU version.
1174 This final version will offer an additional level of parallelism
1176 standard in order to exploit multiple
1177 nodes with multiple CPU cores and possibly multiple GPU cards.
1179 \putbib[Chapters/chapter15/biblio]