\usepackage{amsmath}\r
\usepackage{amsfonts}\r
\usepackage{amssymb}\r
+%%\usepackage{algorithm2e}\r
+\usepackage[ruled,vlined]{algorithm2e}\r
+%%\usepackage{algo}\r
\author{ghidouche}\r
\title{Paper1_kahina}\r
\begin{document}\r
\section{Root finding problem}\r
-we consider a polynomial of degree \textit{n} having coefficients\r
-in the complex \textit{C} and zeros $\alpha\r
-_{i},\textit{i=1,...,n}$. \\\r
+We consider a polynomial of degree \textit{n} having coefficients\r
+in the complex \textit{C} and zeros $\alpha_{i},\textit{i=1,...,n}$. \\\r
\begin{center}\r
\begin{equation}\r
{\Large p(x)=\sum{a_{i}x^{i}}=a_{n}\prod(x-\alpha_{i}),a_{0} a_{n}\neq 0}\r
read-only caches\r
\r
\subsection{A parallel implementation of the Aberth's method }\r
-\subsection{A CUDA implementation of the Aberth's method }\r
-\subsection{A GPU implementation of the Aberth's method }\r
-\subsubsection{the step to parallelize}\r
+%%\subsection{A CUDA implementation of the Aberth's method }\r
+%%\subsection{A GPU implementation of the Aberth's method }\r
+\r
+\r
+\r
+\subsubsection{A sequential Aberth algorithm}\r
+The means steps of Aberth's method can expressed as an algorithm\r
+like:\r
+ \r
+\begin{algorithm}[H]\r
+\LinesNumbered\r
+\caption{Algorithm to find root polynomial with Aberth method}\r
+\r
+\KwIn{$Z^{0}$(Initial root's vector),$\varepsilon$ (error\r
+tolerance threshold),P(Polynomial to solve)}\r
+\r
+\KwOut {Z(The solution root's vector)}\r
+\r
+\BlankLine\r
+\r
+Initialization of the parameter of the polynomial to solve\;\r
+Initialization of the solution vector $Z^{0}$\;\r
+\r
+\While {$\Delta z_{max}\succ \epsilon$}{\r
+ Let $\Delta z_{max}=0$\;\r
+\For{$j \gets 0 $ \KwTo $n$}{\r
+$ZPrec\left[j\right]=Z\left[j\right]$\;\r
+$Z\left[j\right]=H\left(j,Z\right)$\;\r
+}\r
+\r
+\For{$i \gets 0 $ \KwTo $n-1$}{\r
+$c=\frac{\left|Z\left[i\right]-ZPrec\left[i\right]\right|}{Z\left[i\right]}$\;\r
+\If{$c\succ\Delta z_{max}$ }{\r
+$\Delta z_{max}$=c\;}\r
+}\r
+}\r
+\end{algorithm}\r
+~\\ \r
+~\\ \r
+In this sequential algorithm one thread CPU execute all steps, let see the step 3 the execution of the iterative function , 2 instructions are needed, the first instruction \textit{save} the solution vector for the previous iteration, the second instruction \textit{update} or compute a new values of the roots.\r
+We have two manner to execute the iterative function, taking a Jacobi iteration who need all the previous value $z^{(k)}_{i}$ to compute the new value $z^{(k+1)}_{i}$we have:\r
+\r
+\begin{equation}\r
+H(i,z^{k+1})=\frac{p(z^{(k)}_{i})}{p'(z^{(k)}_{i})-p(z^{(k)}_{i})\sum^{n}_{j=1 j\neq i}\frac{1}{z^{(k)}_{i}-z^{(k)}_{j}}}, i=1,...,n.\r
+\end{equation}\r
+\r
+Or with the Gauss-seidel iteration, we have:\r
+\begin{equation}\r
+H(i,z^{k+1})=\frac{p(z^{(k)}_{i})}{p'(z^{(k)}_{i})-p(z^{(k)}_{i})\sum^{i-1}_{j=1}\frac{1}{z^{(k)}_{i}-z^{(k)}_{j}}+\sum^{n}_{j=i+1}\frac{1}{z^{(k)}_{i}-z^{(k)}_{j}}}, i=1,...,n.\r
+\end{equation}\r
+\r
+In formula(16) the iteration function use the $z^{k+1}_{i}$ computed in the current iteration to compute the rest of the roots, which take him to converge more quickly compare to the jacobi iteration (it's well now that the Gauss-seidel iteration converge more quickly because they used the most fresh computed root, so we used Gauss-seidel iteration.)\r
+\r
+The steps 4 of the Aberth's method compute the convergence of the roots, using(9) formula.\r
+Both steps 3 and 4 use 1 thread to compute N roots on CPU, which is faster and hard, it make the algorithm faster and hard for the large polynomial's roots finding.\r
+\r
+\paragraph{The execution time}\r
+Let $T_{i}(N)$: the time to compute one new root's value of the step 3,$T_{i}$ depend on the polynomial's degrees N, when N increase $T_{i}$ increase to.We need $N.T_{i}(N)$ to compute all the new root's value in one iteration on the step 3.\r
+\r
+Let $T_{j}$: the time to compute one root's convergence value of the step 4, we need $N.T_{j}$ to compute all the root's convergence value in one iteration on the step 4.\r
+\r
+The execution time for both steps 3 and 4 can see like:\r
+\begin{equation}\r
+T_{exe}=N(T_{i}(N)+T_{j})+O(n).\r
+\end{equation}\r
+Let Nbr\_iter the number of iteration necessary to compute all the roots,so the total execution time $Total\_time_{exe}$ can give like:\r
+\r
+\begin{equation}\r
+Total\_time_{exe}=\left[N\left(T_{i}(N)+T_{j}\right)+O(n)\right].Nbr\_iter.\r
+\end{equation}\r
+The execution time increase with the increasing of the polynomial's root, which take necessary to parallilize this step to reduce the execution time. In the following paper you explain how we parrallelize this step using GPU architecture with CUDA platform.\r
+\r
+\subsubsection{Parralelize the steps on GPU }\r
+On the CPU Aberth algorithm both steps 3 and 4 contain the loop \verb=for= , it use one thread to execute all the instruction in the loop N times.Here we explain how the GPU architecture can compute this loop and reduce the execution time.\r
+The GPU architecture affect the execution of this loop to a groups of parallel threads organized as a grid of blocks each block contain a number of threads. All threads within a block are executed concurrently in parallel. the instruction are executed as a kernel.\r
+\r
+Let nbr\_thread be the number of threads executed in parallel, so you can easily transform the (18)formula like this: \r
+\r
+\begin{equation}\r
+Total\_time_{exe}=\left[\frac{N}{nbr\_thread}\left(T_{i}(N)+T_{j}\right)+O(n)\right].Nbr\_iter.\r
+\end{equation}\r
+\r
+In theory, the $Total\_time_{exe}$ on GPU is speed up nbr\_thread times as a $Total\_time_{exe}$ on CPU. We show more details in the experiment part. \r
+~\\\r
+~\\\r
+In CUDA platform, All the instruction of the loop \verb=for= are executed by the GPU as a kernel form. A kernel is a procedure written in CUDA and defined by a heading \verb=__global__=, which means that it is to be executed by the GPU.the following algorithm see the kernels created for the step 3 and 4 of the Aberth algorithm:\r
+\r
+\begin{algorithm}[H]\r
+\LinesNumbered\r
+\caption{Algorithm to find root polynomial with Aberth method}\r
+\r
+\KwIn{$Z^{0}$(Initial root's vector),$\varepsilon$ (error\r
+tolerance threshold),P(Polynomial to solve)}\r
+\r
+\KwOut {Z(The solution root's vector)}\r
+\r
+\BlankLine\r
+\r
+Initialization of the parameter of the polynomial to solve\;\r
+Initialization of the solution vector $Z^{0}$\;\r
+\r
+\While {$\Delta z_{max}\succ \epsilon$}{\r
+ Let $\Delta z_{max}=0$\;\r
+$\prec DimGrid,DimBloc\succ kernel\_save(d\_Z^{k-1});$\r
+$\prec DimGrid,DimBloc \succ kernel\_update(d\_z^{k});$\r
+\r
+$\prec DimGrid,DimBloc\succ kernel\_testConverge (d_?z_{max},d_Z^{k},d_Z^{k-1});$\r
+}\r
+\end{algorithm}\r
+~\\ \r
+\r
+\r
+\r
+here we need to create two kernel for the step 3 \textit{Kernel\_save} is used to save vector $Z^{K-1}$ and \textit{kernel\_update} is used to update the $Z^{k}$ vector. In phase 4 a kernel is created to test the convergence of the method\r
+\r
+\r
\subsubsection{the kernel corresponding }\r
\subsubsection{Comparison between sequential algorithm and GPU algorithm }\r
\bibliographystyle{plain}\r