X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/kahina_paper2.git/blobdiff_plain/359a1184d00307a809c1f182403eea464e9d61d8..624cd6c9fc05e8de555dc396531fe50e990f9d1b:/paper.tex diff --git a/paper.tex b/paper.tex index 4a9d058..9810500 100644 --- a/paper.tex +++ b/paper.tex @@ -406,19 +406,19 @@ The abstract goes here. \section{Introduction} -Polynomials are mathematical algebraic structures used in science and engineering to capture physical phenomena and to express any outcome in the form of a function of some unknown variables. Formally speaking, a polynomial $p(x)$ of degree \textit{n} having $n$ coefficients in the complex plane \textit{C} is : +Polynomials are mathematical algebraic structures that play an important role in science and engineering by capturing physical phenomena and by expressing any outcome as a function of some unknown variables. Formally speaking, a polynomial $p(x)$ of degree \textit{n} having $n$ coefficients in the complex plane \textit{C} is : %%\begin{center} \begin{equation} {\Large p(x)=\sum_{i=0}^{n}{a_{i}x^{i}}}. \end{equation} %%\end{center} -The root finding problem consists in finding the values of all the $n$ values of the variable $x$ for which \textit{p(x)} is nullified. Such values are called zeros of $p$. If zeros are $\alpha_{i},\textit{i=1,...,n}$ the $p(x)$ can be written as : +The root finding problem consists in finding the values of all the $n$ different values of the variable $x$ for which \textit{p(x)} is null. Such values are called zeros of $p$. If zeros are $\alpha_{i},\textit{i=1,...,n}$ then $p(x)$ can be written as : \begin{equation} {\Large p(x)=a_{n}\prod_{i=1}^{n}(x-\alpha_{i}), a_{0} a_{n}\neq 0}. \end{equation} -The problem of finding the roots of polynomials is encountered in different applications. Most of the numerical methods that deal with this problem are simultaneous ones. These methods start from the initial approximations of all the roots of the polynomial and give a sequence of approximations that converge to the roots of the polynomial. The first method of this group is Durand-Kerner method: +The problem of finding the roots of polynomials can be encountered in numerous applications. Most of the numerical methods that deal with this problem are simultaneous ones, i.e that find concurrently all of $n$ zeroes. These methods start from the initial approximations of all the roots of the polynomial and give a sequence of approximations that converge to the roots of the polynomial. The first method of this group is Durand-Kerner method: \begin{equation} \label{DK} DK: z_i^{k+1}=z_{i}^{k}-\frac{P(z_i^{k})}{\prod_{i\neq j}(z_i^{k}-z_j^{k})}, i = 1, . . . , n, @@ -442,15 +442,15 @@ point $z$. %Aberth, Ehrlich and Farmer-Loizou~\cite{Loizou83} have proved that %the Ehrlich-Aberth method (EA) has a cubic order of convergence for simple roots whereas the Durand-Kerner has a quadratic order of %convergence. -The main problem of the simultaneous methods is that the necessary time needed for the convergence is increased with the increasing of the degree of the polynomial. Many authors have treated the problem of implementation of simultaneous methods in parallel. Freeman [10] implemented and compared DK, EA and another method of the fourth order proposed by Farmer +The main problem of the simultaneous methods is that the necessary time needed for the convergence is increased with the increasing of the degree of the polynomial. Many authors have treated the problem of implementing simultaneous methods in parallel. Freeman [10] implemented and compared DK, EA and another method of the fourth order proposed by Farmer and Loizou [9], on a 8-processor linear chain, for polynomials of degree up to 8. The third method often diverges, but the first two methods have speed-up equal to 5.5. Later, Freeman and Bane [11] considered asynchronous algorithms, in which each processor continues to update its approximations even though the latest values of other $z^{k}_{i}$ have not been received from the other processors, in contrast with synchronous algorithms where it would wait those values before -making a new iteration. Couturier and al. [12] proposed two methods of parallelization for a shared memory architecture with \textit{OpenMP} and for distributed memory one with \textit{MPI}. They were able to compute the roots of sparse polynomials of degree 10,000 in 116 seconds with \textit{OpenMP} and 135 seconds with \textit{MPI} only 8 personal computers and 2 communications per iteration. Comparing to the sequential implementation where it takes up to 3,300 seconds to obtain the same results, the authors show an interesting speedup. +making a new iteration. Couturier and al. [12] proposed two methods of parallelization for a shared memory architecture with \textit{OpenMP} and for distributed memory one with \textit{MPI}. They were able to compute the roots of sparse polynomials of degree 10,000 in 116 seconds with \textit{OpenMP} and 135 seconds with \textit{MPI} only by using 8 personal computers and 2 communications per iteration. Comparing to the sequential implementation where it takes up to 3,300 seconds to obtain the same results, the authors show an interesting speedup. -Very few works had been performed since this last work until the appearing of the Compute Unified Device Architecture (CUDA) [13], a parallel computing platform and a programming model invented by NVIDIA. The computing power of GPUs (Graphics Processing Unit) has exceeded that of CPUs. However, CUDA adopts a totally new computing architecture to use the hardware resources provided by GPU in order to offer a stronger computing ability to the massive data computing. Ghidouche and al [14] proposed an implementation of the Durand-Kerner method on GPU. Their main result showed that a parallel CUDA implementation is about 10 times faster than the sequential implementation on a single CPU for sparse polynomials of degree 48,000. +Very few work had been performed since then until the appearing of the Compute Unified Device Architecture (CUDA) [13], a parallel computing platform and a programming model invented by NVIDIA. The computing power of GPUs (Graphics Processing Unit) has exceeded that of CPUs. However, CUDA adopts a totally new computing architecture to use the hardware resources provided by GPU in order to offer a stronger computing ability to the massive data computing. Ghidouche and al [14] proposed an implementation of the Durand-Kerner method on GPU. Their main result showed that a parallel CUDA implementation is about 10 times faster than the sequential implementation on a single CPU for sparse polynomials of degree 48,000. -Finding polynomial roots rapidly and accurately is the main objective of our work. In this paper we propose the parallelization of Ehrlich-Aberth method using a parallel programming paradigms (OpenMP, MPI) on GPUs. We consider two architectures: Shared memory with OpenMP API based on threads from the same system process, which each thread is attached to one GPU and after the various memory allocation, each thread throws its part of calculation ( to do this you must first load on the GPU required data and after Suddenly repatriate the result on the host). Distributed memory with MPI: The MPI library is often used for parallel programming [11] in -cluster systems because it is a message-passing programming language. Each GPU are attached to one process MPI, and a loop is in charge of the distribution of tasks between the MPI processes. this solution can be used on one GPU, or executed on a distributed cluster of GPUs, employing the Message Passing Interface (MPI) to communicate between separate CUDA cards. This solution permits scaling of the problem size to larger classes than would be possible on a single device and demonstrates the performance which users might expect from future +Finding polynomial roots rapidly and accurately is the main objective of our work. In this paper we propose the parallelization of Ehrlich-Aberth method using parallel programming paradigms (OpenMP, MPI) on GPUs. We consider two architectures: shared memory with OpenMP API and distributed memory MPI API. The first approach is based on threads from the same system process, with each thread attached to one GPU and after the various memory allocations, each thread launches its part of computations. To do this we must first load on the GPU required data and after the computations are carried, repatriate the result on the host. The second approach i.e distributed memory with MPI relies on the MPI library which is often used for parallel programming [11] in +cluster systems because it is a message-passing programming language. Each GPU is attached to one MPI process, and a loop is in charge of the distribution of tasks between the MPI processes. This solution can be used on one GPU, or executed on a distributed cluster of GPUs, employing the Message Passing Interface (MPI) to communicate between separate CUDA cards. This solution permits scaling of the problem size to larger classes than would be possible on a single device and demonstrates the performance which users might expect from future HPC architectures where accelerators are deployed. This paper is organized as follows, in section 2 we recall the Ehrlich-Aberth method. In section 3 we present EA algorithm on single GPU. In section 4 we propose the EA algorithm implementation on MGPU for (OpenMP-CUDA) approach and (MPI-CUDA) approach. In section 5 we present our experiments and discus it. Finally, Section~\ref{sec6} concludes this paper and gives some hints for future research directions in this topic. @@ -785,23 +785,25 @@ to $10^{-7}$. The initialization values of the vector solution of the methods are given in %Section~\ref{sec:vec_initialization}. -\subsection{Test with (CUDA OpenMP) approach} +\subsection{Test with Multi-GPU (CUDA OpenMP) approach} -In this part we performed a set of experiments with (CUDA OpenMP) approach on full and sparse polynomials of different degrees. +In this part we performed a set of experiments on Multi-GPU (CUDA OpenMP) approach for full and sparse polynomials of different degrees, compare it with Single GPU (CUDA). \subsubsection{Execution times in seconds of the Ehrlich-Aberth method for solving sparse polynomials on GPUs using shared memory paradigm with OpenMP} - In this test we report the execution time of the EA algorithm, on single GPU and Multi-GPU with (2,3,4) GPUs, for different sparse polynomial degrees ranging from 100,000 to 1,400,000 -\begin{figure}[htbp] + In this experiments we report the execution time of the EA algorithm, on single GPU and Multi-GPU with (2,3,4) GPUs, for different sparse polynomial degrees ranging from 100,000 to 1,400,000 +\begin{figure}[htbp] \centering \includegraphics[angle=-90,width=0.5\textwidth]{Sparse_omp} \caption{Execution times in seconds of the Ehrlich-Aberth method for solving sparse polynomials on GPUs using shared memory paradigm with OpenMP} \label{fig:01} \end{figure} -in this figure~\ref{fig:01} shows that (CUDA OpenMP) Multi-GPU approach reduce the execution time up to the scale 100 whereas single GPU is of scale 1000 for polynomial who exceed 1,000,000. It shows the advantage to use OpenMP parallel paradigm to connect the performances of several GPUs and solve a high polynomial of degrees. + +This figure~\ref{fig:01} shows that (CUDA OpenMP) Multi-GPU approach reduce the execution time up to the scale 100 whereas single GPU is of scale 1000 for polynomial who exceed 1,000,000. It shows the advantage to use OpenMP parallel paradigm to connect the performances of several GPUs and solve a polynomial of high degrees. \subsubsection{Execution times in seconds of the Ehrlich-Aberth method for solving full polynomials on GPUs using shared memory paradigm with OpenMP} +This experiments shows the execution time of the EA algorithm, on single GPU (CUDA) and Multi-GPU (CUDA OpenMP) approach for full polynomials of degrees ranging from 100,000 to 1,400,000 \begin{figure}[htbp] \centering @@ -810,6 +812,12 @@ in this figure~\ref{fig:01} shows that (CUDA OpenMP) Multi-GPU approach reduce t \label{fig:03} \end{figure} +The second test with full polynomial shows a very important saving of time, for a polynomial of degrees 1,4M (CUDA OpenMP) approach with 4 GPUs compute and solve it 4 times as fast as single GPU. We notice that curves are positioned one below the other one, more the number of used GPUs increases more the execution time decreases. + +\subsection{Test with Multi-GPU (CUDA MPI) approach} +In this part we perform a set of experiment to compare Multi-GPU (CUDA MPI) approach with single GPU, for solving full and sparse polynomials of degrees ranging from 100,000 to 1,400,000. + +\subsubsection{Execution times in seconds of the Ehrlich-Aberth method for solving sparse polynomials on GPUs using distributed memory paradigm with MPI} \begin{figure}[htbp] \centering @@ -817,7 +825,10 @@ in this figure~\ref{fig:01} shows that (CUDA OpenMP) Multi-GPU approach reduce t \caption{Execution times in seconds of the Ehrlich-Aberth method for solving sparse polynomials on GPUs using distributed memory paradigm with MPI} \label{fig:02} \end{figure} - +~\\ +This figure shows 4 curves of execution time of EA algorithm, a curve with single GPU, 3 curves with Multi-GPUs (2, 3, 4) GPUs. We see clearly that the curve with single GPU is above the other curves, which shows consumption in execution time compared to the Multi-GPU. We can see the approach Multi-GPU (CUDA MPI) reduces the execution time up to the scale 100 for polynomial of degrees more than 1,000,000 whereas single GPU is of the scale 1000. +\\ +\subsubsection{Execution times in seconds of the Ehrlich-Aberth method for solving full polynomials on GPUs using distributed memory paradigm with MPI} \begin{figure}[htbp] \centering