From 55faa62d76706179c833c9947d095d758ff28376 Mon Sep 17 00:00:00 2001 From: lilia Date: Sat, 13 Dec 2014 15:40:20 +0100 Subject: [PATCH] 13-12-2014 v01 --- krylov_multi_reviewed.tex | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/krylov_multi_reviewed.tex b/krylov_multi_reviewed.tex index 40ed640..f12f3ae 100644 --- a/krylov_multi_reviewed.tex +++ b/krylov_multi_reviewed.tex @@ -183,7 +183,7 @@ In the case where the diagonal weighting matrices $E_\ell$ have only zero and on %%% MODIFIE ************************ %%%********************************* -Let $Ax=b$ be a given large and sparse linear system of $n$ equations where $A\in\mathbb{R}^{n\times n}$ is a sparse square and non-singular matrix, $x\in\mathbb{R}^{n}$ is the solution vector and $b\in\mathbb{R}^{n}$ is the right-hand side vector. We use a multisplitting method to solve the linear system on a large computing platform in order to reduce the communications. Let the computing platform be composed of $L$ clusters of processors physically adjacent or geographically distant. In this work we apply the block Jacobi multisplitting to the linear system as follows +Let $Ax=b$ be a given large and sparse linear system of $n$ equations where $A\in\mathbb{R}^{n\times n}$ is a sparse square and non-singular matrix, $x\in\mathbb{R}^{n}$ is the solution vector and $b\in\mathbb{R}^{n}$ is the right-hand side vector. We use a multisplitting method to solve the linear system on a large computing platform in order to reduce the communications. Let the computing platform be composed of $L$ blocks of processors physically adjacent or geographically distant. In this work we apply the block Jacobi multisplitting to the linear system as follows %%%********************************* %%%********************************* @@ -201,7 +201,7 @@ b & = & [B_{1}, \ldots, B_{L}] where for $\ell\in\{1,\ldots,L\}$, $A_\ell$ is a rectangular block of size $n_\ell\times n$ and $X_\ell$ and $B_\ell$ are sub-vectors of size $n_\ell$ each, such that $\sum_\ell n_\ell=n$. %%% MODIFIE *********************** %%%******************************** -The splitting is performed row-by-row without overlapping in such a way that successive rows of sparse matrix $A$ and both vectors $x$ and $b$ are assigned to one cluster. +The splitting is performed row-by-row without overlapping in such a way that successive rows of sparse matrix $A$ and both vectors $x$ and $b$ are assigned to one block of processors. %%%******************************** %%%******************************** So, the multisplitting format of the linear system is defined as follows @@ -221,7 +221,7 @@ Y_\ell = B_\ell - \displaystyle\sum_{\substack{m=1\\m\neq \ell}}^{L}A_{\ell m}X_ \right. \label{sec03:eq03} \end{equation} -is solved independently by a {\it cluster of processors} and communications are required to update the right-hand side vectors $Y_\ell$, such that the vectors $X_m$ represent the data dependencies between the clusters. In this work, we use the parallel restarted GMRES method~\cite{ref34} as an inner iteration method to solve sub-systems~(\ref{sec03:eq03}). +is solved independently by a {\it block of processors} and communications are required to update the right-hand side vectors $Y_\ell$, such that the vectors $X_m$ represent the data dependencies between the blocks. In this work, we use the parallel restarted GMRES method~\cite{ref34} as an inner iteration method to solve sub-systems~(\ref{sec03:eq03}). %%% MODIFIE *********************** %%%******************************** GMRES is one of the most used Krylov iterative methods to solve sparse linear systems by minimizing the residuals over an orthonormal basis of a Krylov subspace. @@ -234,7 +234,7 @@ different sub-systems~(\ref{sec03:eq03}) does not necessarily involve the convergence of the multisplitting algorithm. It strongly depends on the properties of the global sparse linear system to be solved~\cite{o1985multi,ref18}. Furthermore, the splitting of the linear system -among several clusters of processors increases the spectral radius of the +among several blocks of processors increases the spectral radius of the iteration matrix, thereby slowing the convergence. In fact, the larger the number of splittings is, the larger the spectral radius is. In this paper, our work is based on the work presented in~\cite{huang1993krylov} to increase the @@ -253,7 +253,7 @@ S=\{x^1,x^2,\ldots,x^s\},~s\leq n, where for $j\in\{1,\ldots,s\}$, $x^j=[X_1^j,\ldots,X_L^j]$ is a solution of the global linear system. %%% MODIFIE *********************** %%%******************************** -The advantage of such a Krylov subspace is that we neither need an orthonormal basis nor any synchronization between clusters is necessary to orthogonalize the generated basis. This avoids to perform other synchronizations between the blocks of processors. +The advantage of such a Krylov subspace is that we neither need an orthonormal basis nor any synchronization between the different blocks is necessary to orthogonalize the generated basis. This avoids to perform other synchronizations between the blocks of processors. The multisplitting method is periodically restarted every $s$ iterations with a new initial guess $\tilde{x}=S\alpha$ which minimizes an error function, in our case it minimizes the residuals $\|b-Ax\|_2$ over the Krylov subspace spanned by vectors of $S$. So $\alpha$ is defined as the solution of the large overdetermined linear system %%%******************************** @@ -273,7 +273,7 @@ which is associated with the least squares problem \text{minimize}~\|b-R\alpha\|_2, \label{sec03:eq07} \end{equation} -where $R^T$ denotes the transpose of matrix $R$. Since $R$ (i.e. $AS$) and $b$ are split among $L$ clusters, the symmetric positive definite system~(\ref{sec03:eq06}) is solved in parallel. Thus an iterative method would be more appropriate than a direct one to solve this system. We use the parallel Conjugate Gradient method for the normal equations CGNR~\cite{S96,refCGNR}. +where $R^T$ denotes the transpose of matrix $R$. Since $R$ (i.e. $AS$) and $b$ are split among $L$ blocks, the symmetric positive definite system~(\ref{sec03:eq06}) is solved in parallel. Thus an iterative method would be more appropriate than a direct one to solve this system. We use the parallel Conjugate Gradient method for the normal equations CGNR~\cite{S96,refCGNR}. \begin{algorithm}[!t] \caption{A two-stage linear solver with inner iteration GMRES method} @@ -288,12 +288,12 @@ where $R^T$ denotes the transpose of matrix $R$. Since $R$ (i.e. $AS$) and $b$ a \For {$j=1,2,\ldots,s$} \State \label{line7}Inner iteration solver: \Call{InnerSolver}{$x^0$, $j$} \State Construct basis $S$: add column vector $X_\ell^j$ to the matrix $S_\ell^k$ -\State Exchange local values of $X_\ell^j$ with the neighboring clusters +\State Exchange local values of $X_\ell^j$ with the neighboring blocks \State Compute dense matrix $R$: $R_\ell^{k,j}=\sum^L_{i=1}A_{\ell i}X_i^j$ \EndFor \State \label{line12}Minimization $\|b-R\alpha\|_2$: \Call{UpdateMinimizer}{$S_\ell$, $R$, $b$, $k$} \State Local solution of linear system $Ax=b$: $X_\ell^k=\tilde{X}_\ell^k$ -\State Exchange the local minimizer $\tilde{X}_\ell^k$ with the neighboring clusters +\State Exchange the local minimizer $\tilde{X}_\ell^k$ with the neighboring blocks \EndFor \Statex @@ -307,7 +307,7 @@ where $R^T$ denotes the transpose of matrix $R$. Since $R$ (i.e. $AS$) and $b$ a \Statex \Function {UpdateMinimizer}{$S_\ell$, $R$, $b$, $k$} -\State Solving normal equations $(R^k)^TR^k\alpha^k=(R^k)^Tb$ in parallel by $L$ clusters using parallel CGNR method +\State Solving normal equations $(R^k)^TR^k\alpha^k=(R^k)^Tb$ in parallel by $L$ blocks using parallel CGNR method \State Compute local minimizer $\tilde{X}_\ell^k=S_\ell^k\alpha^k$ \State \Return $\tilde{X}_\ell^k$ \EndFunction @@ -315,7 +315,7 @@ where $R^T$ denotes the transpose of matrix $R$. Since $R$ (i.e. $AS$) and $b$ a \label{algo:01} \end{algorithm} -The main key points of our Krylov multisplitting method to solve a large sparse linear system are given in Algorithm~\ref{algo:01}. This algorithm is based on a two-stage method with a minimization using restarted GMRES iterative method as an inner solver. It is executed in parallel by each cluster of processors. Matrices and vectors with the subscript $\ell$ represent the local data for cluster $\ell$, where $\ell\in\{1,\ldots,L\}$. The two-stage solver uses two different parallel iterative algorithms: the GMRES method to solve each splitting~(\ref{sec03:eq03}) on a cluster of processors, and the CGNR method, executed periodically in parallel by all clusters to minimize the function error~(\ref{sec03:eq07}) over the Krylov subspace spanned by $S$. The algorithm requires two global synchronizations between $L$ clusters. The first one is performed line~\ref{line12} in Algorithm~\ref{algo:01} to exchange local values of vector solution $x$ (i.e. the minimizer $\tilde{x}$) required to restart the multisplitting solver. The second one is needed to construct the matrix $R$. We chose to perform this latter synchronization $s$ times in every outer iteration $k$ (line~\ref{line7} in Algorithm~\ref{algo:01}). This is a straightforward way to compute the sparse matrix-dense matrix multiplication $R=AS$. We implemented all synchronizations by using message passing collective communications of MPI library. +The main key points of our Krylov multisplitting method to solve a large sparse linear system are given in Algorithm~\ref{algo:01}. This algorithm is based on a two-stage method with a minimization using restarted GMRES iterative method as an inner solver. It is executed in parallel by each block of processors. Matrices and vectors with the subscript $\ell$ represent the local data for block $\ell$, where $\ell\in\{1,\ldots,L\}$. The two-stage solver uses two different parallel iterative algorithms: the GMRES method to solve each splitting~(\ref{sec03:eq03}) on a block of processors, and the CGNR method, executed periodically in parallel by all blocks to minimize the function error~(\ref{sec03:eq07}) over the Krylov subspace spanned by $S$. The algorithm requires two global synchronizations between $L$ blocks. The first one is performed line~\ref{line12} in Algorithm~\ref{algo:01} to exchange local values of vector solution $x$ (i.e. the minimizer $\tilde{x}$) required to restart the multisplitting solver. The second one is needed to construct the matrix $R$. We chose to perform this latter synchronization $s$ times in every outer iteration $k$ (line~\ref{line7} in Algorithm~\ref{algo:01}). This is a straightforward way to compute the sparse matrix-dense matrix multiplication $R=AS$. We implemented all synchronizations by using message passing collective communications of MPI library. %%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%% @@ -425,9 +425,9 @@ From these experiments, it can be observed that the multisplitting version is always faster than the GMRES version. The acceleration gain of the multisplitting version ranges between 4 and 6. It can be noticed that the number of iterations is drastically reduced with the multisplitting version even it is not -negligible. Moreover, with 8,192 cores, we can see that using 4 clusters gives a -better performance than simply using 2 clusters. In fact, we can notice that the -precision with 2 clusters is slightly better but in both cases the precision is +negligible. Moreover, with 8,192 cores, we can see that using 4 blocks of cores gives a +better performance than simply using 2 blocks. In fact, we can notice that the +precision with 2 blocks is slightly better but in both cases the precision is under the specified threshold. @@ -439,13 +439,13 @@ inner number of iterations (i.e. the GMRES iterations) for the multisplitting method. Iterations of CGNR are not taken into account. From this figure, it can be seen that the number of iterations per second is higher with GMRES but it is not so different with the multisplitting method. For the case with $8,192$ -cores, the number of iterations per second with 4 clusters is approximately +cores, the number of iterations per second with 4 blocks is approximately equals to 115. So it is not different from GMRES. \begin{figure}[htbp] \centering \includegraphics[width=0.7\textwidth]{nb_iter_sec} -\caption{Number of iterations per second with the same parameters as in Table~\ref{tab1} (weak scaling) with only 2 clusters} +\caption{Number of iterations per second with the same parameters as in Table~\ref{tab1} (weak scaling) with only 2 blocks of cores} \label{fig:01} \end{figure} @@ -467,8 +467,8 @@ We have implemented a Krylov multisplitting method to solve sparse linear systems on large-scale computing platforms. We have developed a synchronous two-stage method based on the block Jacobi multisplitting which uses GMRES iterative method as an inner iteration. Our contribution in this paper is -twofold. First we provide a multi cluster decomposition that allows us to choose -the appropriate size of the clusters according to the architecures of the +twofold. First we provide a multi block decomposition that allows us to choose +the appropriate size of the blocks according to the architecures of the supercomputer. Second, we have implemented the outer iteration of the multisplitting method as a Krylov subspace method which minimizes some error function. This increases the convergence and improves the scalability of the @@ -481,7 +481,7 @@ up-to 8,192 cores. The experimental results showed that the multisplitting metho about 4 to 6 times faster than the GMRES method for different sizes of the problem split into 2 or 4 blocks when using the multisplitting method. Indeed, the GMRES method has difficulties to scale with many cores while the Krylov -multisplitting method allows to hide latency and reduce the inter-cluster +multisplitting method allows to hide latency and reduce the inter-block communications. In future works, we plan to conduct experiments on larger numbers of cores and -- 2.39.5