1 \documentclass{article}
2 \usepackage[utf8]{inputenc}
3 \usepackage{amsfonts,amssymb}
7 \usepackage{algpseudocode}
10 \algnewcommand\algorithmicinput{\textbf{Input:}}
11 \algnewcommand\Input{\item[\algorithmicinput]}
13 \algnewcommand\algorithmicoutput{\textbf{Output:}}
14 \algnewcommand\Output{\item[\algorithmicoutput]}
16 \newcommand{\Time}[1]{\mathit{Time}_\mathit{#1}}
17 \newcommand{\Prec}{\mathit{prec}}
18 \newcommand{\Ratio}{\mathit{Ratio}}
20 \title{A scalable multisplitting algorithm for solving large sparse linear systems}
26 \author{Raphaël Couturier \and Lilia Ziane Khodja}
31 %%%%%%%%%%%%%%%%%%%%%%%%
32 %%%%%%%%%%%%%%%%%%%%%%%%
36 In this paper we revisit the krylov multisplitting algorithm presented in
37 \cite{huang1993krylov} which uses a scalar method to minimize the krylov
38 iterations computed by a multisplitting algorithm. Our new algorithm is based on
39 a parallel multisplitting algorithm with few blocks of large size using a
40 parallel GMRES method inside each block and on a parallel krylov minimization in
41 order to improve the convergence. Some large scale experiments with a 3D Poisson
42 problem are presented. They show the obtained improvements compared to a
43 classical GMRES both in terms of number of iterations and execution times.
47 %%%%%%%%%%%%%%%%%%%%%%%%
48 %%%%%%%%%%%%%%%%%%%%%%%%
51 \section{Introduction}
53 Iterative methods are used to solve large sparse linear systems of equations of
54 the form $Ax=b$ because they are easier to parallelize than direct ones. Many
55 iterative methods have been proposed and adapted by many researchers. For
56 example, the GMRES method and the Conjugate Gradient method are very well known
57 and used by many researchers ~\cite{S96}. Both the method are based on the
58 Krylov subspace which consists in forming a basis of the sequence of successive
59 matrix powers times the initial residual.
61 When solving large linear systems with many cores, iterative methods often
62 suffer from scalability problems. This is due to their need for collective
63 communications to perform matrix-vector products and reduction operations.
64 Preconditionners can be used in order to increase the convergence of iterative
65 solvers. However, most of the good preconditionners are not sclalable when
66 thousands of cores are used.
69 Traditionnal iterative solvers have global synchronizations that penalize the
70 scalability. Two possible solutions consists either in using asynchronous
71 iterative methods~\cite{ref18} or to use multisplitting algorithms. In this
72 paper, we will reconsider the use of a multisplitting method. In opposition to
73 traditionnal multisplitting method that suffer from slow convergence, as
74 proposed in~\cite{huang1993krylov}, the use of a minimization process can
75 drastically improve the convergence.
80 %%%%%%%%%%%%%%%%%%%%%%%
82 %%%%%%%%%%%%%%%%%%%%%%%
83 The key idea of the multisplitting method for solving a large system
84 of linear equations $Ax=b$ consists in partitioning the matrix $A$ in
87 A = M_l - N_l,~l\in\{1,\ldots,L\},
90 where $M_l$ are nonsingular matrices. Then the linear system is solved
91 by iteration based on the multisplittings as follows
93 x^{k+1}=\displaystyle\sum^L_{l=1} E_l M^{-1}_l (N_l x^k + b),~k=1,2,3,\ldots
96 where $E_l$ are non-negative and diagonal weighting matrices such that
97 $\sum^L_{l=1}E_l=I$ ($I$ is an identity matrix). Thus the convergence
98 of such a method is dependent on the condition
100 \rho(\displaystyle\sum^L_{l=1}E_l M^{-1}_l N_l)<1.
104 The advantage of the multisplitting method is that at each iteration
105 $k$ there are $L$ different linear sub-systems
107 v_l^k=M^{-1}_l N_l x_l^{k-1} + M^{-1}_l b,~l\in\{1,\ldots,L\},
110 to be solved independently by a direct or an iterative method, where
111 $v_l^k$ is the solution of the local sub-system. Thus, the
112 calculations of $v_l^k$ may be performed in parallel by a set of
113 processors. A multisplitting method using an iterative method for
114 solving the $L$ linear sub-systems is called an inner-outer iterative
115 method or a two-stage method. The results $v_l^k$ obtained from the
116 different splittings~(\ref{eq04}) are combined to compute the solution
117 $x^k$ of the linear system by using the diagonal weighting matrices
119 x^k = \displaystyle\sum^L_{l=1} E_l v_l^k,
122 In the case where the diagonal weighting matrices $E_l$ have only zero
123 and one factors (i.e. $v_l^k$ are disjoint vectors), the
124 multisplitting method is non-overlapping and corresponds to the block
126 %%%%%%%%%%%%%%%%%%%%%%%
128 %%%%%%%%%%%%%%%%%%%%%%%
130 \section{Related works}
133 A general framework for studying parallel multisplitting has been presented in
134 \cite{o1985multi} by O'Leary and White. Convergence conditions are given for the
135 most general case. Many authors improved multisplitting algorithms by proposing
136 for example an asynchronous version \cite{bru1995parallel} and convergence
137 conditions \cite{bai1999block,bahi2000asynchronous} in this case or other
138 two-stage algorithms~\cite{frommer1992h,bru1995parallel}.
140 In \cite{huang1993krylov}, the authors proposed a parallel multisplitting
141 algorithm in which all the tasks except one are devoted to solve a sub-block of
142 the splitting and to send their local solution to the first task which is in
143 charge to combine the vectors at each iteration. These vectors form a Krylov
144 basis for which the first task minimizes the error function over the basis to
145 increase the convergence, then the other tasks receive the update solution until
146 convergence of the global system.
150 In \cite{couturier2008gremlins}, the authors proposed practical implementations
151 of multisplitting algorithms that take benefit from multisplitting algorithms to
152 solve large scale linear systems. Inner solvers could be based on scalar direct
153 method with the LU method or scalar iterative one with GMRES.
155 In~\cite{prace-multi}, the authors have proposed a parallel multisplitting
156 algorithm in which large block are solved using a GMRES solver. The authors have
157 performed large scale experimentations upto 32.768 cores and they conclude that
158 asynchronous multisplitting algorithm could more efficient than traditionnal
159 solvers on exascale architecture with hunders of thousands of cores.
162 %%%%%%%%%%%%%%%%%%%%%%%%
163 %%%%%%%%%%%%%%%%%%%%%%%%
166 \section{A two-stage method with a minimization}
167 Let $Ax=b$ be a given sparse and large linear system of $n$ equations
168 to solve in parallel on $L$ clusters, physically adjacent or
169 geographically distant, where $A\in\mathbb{R}^{n\times n}$ is a square
170 and nonsingular matrix, $x\in\mathbb{R}^{n}$ is the solution vector
171 and $b\in\mathbb{R}^{n}$ is the right-hand side vector. The
172 multisplitting of this linear system is defined as follows:
176 A & = & [A_{1}, \ldots, A_{L}]\\
177 x & = & [X_{1}, \ldots, X_{L}]\\
178 b & = & [B_{1}, \ldots, B_{L}]
183 where for $l\in\{1,\ldots,L\}$, $A_l$ is a rectangular block of size
184 $n_l\times n$ and $X_l$ and $B_l$ are sub-vectors of size $n_l$, such
185 that $\sum_ln_l=n$. In this case, we use a row-by-row splitting
186 without overlapping in such a way that successive rows of the sparse
187 matrix $A$ and both vectors $x$ and $b$ are assigned to one cluster.
188 So, the multisplitting format of the linear system is defined as
191 \forall l\in\{1,\ldots,L\} \mbox{,~} \displaystyle\sum_{i=1}^{l-1}A_{li}X_i + A_{ll}X_l + \displaystyle\sum_{i=l+1}^{L}A_{li}X_i = B_l,
194 where $A_{li}$ is a block of size $n_l\times n_i$ of the rectangular
195 matrix $A_l$, $X_i\neq X_l$ is a sub-vector of size $n_i$ of the
196 solution vector $x$ and $\sum_{i<l}n_i+\sum_{i>l}n_i+n_l=n$, for all
197 $i\in\{1,\ldots,l-1,l+1,\ldots,L\}$.
199 The multisplitting method proceeds by iteration for solving the linear
200 system in such a way each sub-system
204 A_{ll}X_l = Y_l \mbox{,~such that}\\
205 Y_l = B_l - \displaystyle\sum_{i=1,i\neq l}^{L}A_{li}X_i,
210 is solved independently by a cluster of processors and communication
211 are required to update the right-hand side vectors $Y_l$, such that
212 the vectors $X_i$ represent the data dependencies between the
213 clusters. In this work, we use the parallel GMRES method~\cite{ref34}
214 as an inner iteration method to solve the
215 sub-systems~(\ref{sec03:eq03}). It is a well-known iterative method
216 which gives good performances to solve sparse linear systems in
217 parallel on a cluster of processors.
219 It should be noted that the convergence of the inner iterative solver
220 for the different linear sub-systems~(\ref{sec03:eq03}) does not
221 necessarily involve the convergence of the multisplitting method. It
222 strongly depends on the properties of the sparse linear system to be
223 solved and the computing
224 environment~\cite{o1985multi,ref18}. Furthermore, the multisplitting
225 of the linear system among several clusters of processors increases
226 the spectral radius of the iteration matrix, thereby slowing the
227 convergence. In this paper, we based on the work presented
228 in~\cite{huang1993krylov} to increase the convergence and improve the
229 scalability of the multisplitting methods.
231 In order to accelerate the convergence, we implement the outer
232 iteration of the multisplitting solver as a Krylov subspace method
233 which minimizes some error function over a Krylov subspace~\cite{S96}.
234 The Krylov space of the method that we used is spanned by a basis
235 composed of successive solutions issued from solving the $L$
236 splittings~(\ref{sec03:eq03})
238 S=\{x^1,x^2,\ldots,x^s\},~s\leq n,
241 where for $j\in\{1,\ldots,s\}$, $x^j=[X_1^j,\ldots,X_L^j]$ is a
242 solution of the global linear system. The advantage of such a Krylov
243 subspace is that we need neither an orthogonal basis nor
244 synchronizations between the different clusters to generate this
247 The multisplitting method is periodically restarted every $s$
248 iterations with a new initial guess $\tilde{x}=S\alpha$ which
249 minimizes the error function $\|b-Ax\|_2$ over the Krylov subspace
250 spanned by the vectors of $S$. So, $\alpha$ is defined as the
251 solution of the large overdetermined linear system
256 where $R=AS$ is a dense rectangular matrix of size $n\times s$ and
257 $s\ll n$. This leads us to solve the system of normal equations
262 which is associated with the least squares problem
264 \text{minimize}~\|b-R\alpha\|_2,
267 where $R^T$ denotes the transpose of the matrix $R$. Since $R$ (i.e.
268 $AS$) and $b$ are split among $L$ clusters, the symmetric positive
269 definite system~(\ref{sec03:eq06}) is solved in parallel. Thus, an
270 iterative method would be more appropriate than a direct one to solve
271 this system. We use the parallel conjugate gradient method for the
272 normal equations CGNR~\cite{S96,refCGNR}.
274 \begin{algorithm}[!t]
275 \caption{A two-stage linear solver with inner iteration GMRES method}
276 \begin{algorithmic}[1]
277 \Input $A_l$ (local sparse matrix), $B_l$ (local right-hand side), $x^0$ (initial guess)
278 \Output $X_l$ (local solution vector)\vspace{0.2cm}
279 \State Load $A_l$, $B_l$, $x^0$
280 \State Initialize the minimizer $\tilde{x}^0=x^0$
281 \For {$k=1,2,3,\ldots$ until the global convergence}
282 \State Restart with $x^0=\tilde{x}^{k-1}$: \textbf{for} $j=1,2,\ldots,s$ \textbf{do}
283 \State\hspace{0.5cm} Inner iteration solver: \Call{InnerSolver}{$x^0$, $j$}
284 \State\hspace{0.5cm} Construct the basis $S$: add the column vector $X_l^j$ to the matrix $S_l^k$
285 \State\hspace{0.5cm} Exchange the local solution vector $X_l^j$ with the neighboring clusters
286 \State\hspace{0.5cm} Compute the dense matrix $R$: $R_l^{k,j}=\sum^L_{i=1}A_{li}X_i^j$
287 \State\textbf{end for}
288 \State Minimization $\|b-R\alpha\|_2$: \Call{UpdateMinimizer}{$S_l$, $R$, $b$, $k$}
289 \State Local solution of the linear system $Ax=b$: $X_l^k=\tilde{X}_l^k$
290 \State Exchange the local minimizer $\tilde{X}_l^k$ with the neighboring clusters
295 \Function {InnerSolver}{$x^0$, $j$}
296 \State Compute the local right-hand side: $Y_l = B_l - \sum^L_{i=1,i\neq l}A_{li}X_i^0$
297 \State Solving the local splitting $A_{ll}X_l^j=Y_l$ using the parallel GMRES method, such that $X_l^0$ is the initial guess
298 \State \Return $X_l^j$
303 \Function {UpdateMinimizer}{$S_l$, $R$, $b$, $k$}
304 \State Solving the normal equations $(R^k)^TR^k\alpha^k=(R^k)^Tb$ in parallel by $L$ clusters using the parallel CGNR method
305 \State Compute the local minimizer: $\tilde{X}_l^k=S_l^k\alpha^k$
306 \State \Return $\tilde{X}_l^k$
312 The main key points of the multisplitting method to solve a large
313 sparse linear system are given in Algorithm~\ref{algo:01}. This
314 algorithm is based on a two-stage method with a minimization using the
315 GMRES iterative method as an inner solver. It is executed in parallel
316 by each cluster of processors. The matrices and vectors with the
317 subscript $l$ represent the local data for the cluster $l$, where
318 $l\in\{1,\ldots,L\}$. The two-stage solver uses two different parallel
319 iterative algorithms: the GMRES method to solve each splitting on a
320 cluster of processors, and the CGNR method executed in parallel by all
321 clusters to minimize the function error over the Krylov subspace
322 spanned by $S$. The algorithm requires two global synchronizations
323 between the $L$ clusters. The first one is performed at line~$12$ in
324 Algorithm~\ref{algo:01} to exchange the local values of the vector
325 solution $x$ (i.e. the minimizer $\tilde{x}$) required to restart the
326 multisplitting solver. The second one is needed to construct the
327 matrix $R$ of the Krylov subspace. We choose to perform this latter
328 synchronization $s$ times in every outer iteration $k$ (line~$7$ in
329 Algorithm~\ref{algo:01}). This is a straightforward way to compute the
330 matrix-matrix multiplication $R=AS$. We implement all
331 synchronizations by using the MPI collective communication
335 \section{Experiments}
337 In order to illustrate the interest of our algorithm. We have compared our
338 algorithm with the GMRES method which a very well used method in many
339 situations. We have chosen to focus on only one problem which is very simple to
340 implement: a 3 dimension Poisson problem.
345 \nabla u&=f \mbox{~in~} \omega\\
346 u &=0 \mbox{~on~} \Gamma=\partial \omega
351 After discretization, with a finite difference scheme, a seven point stencil is
352 used. It is well-known that the spectral radius of matrices representing such
353 problems are very close to 1. Moreover, the larger the number of discretization
354 points is, the closer to 1 the spectral radius is. Hence, to solve a matrix
355 obtained for a 3D Poisson problem, the number of iterations is high. Using a
356 preconditioner it is possible to reduce the number of iterations but
357 preconditioners are not scalable when using many cores.
359 Doing many experiments with many cores is not easy and require to access to a
360 supercomputer with several hours for developping a code and then improving
361 it. In the following we presented some experiments we could achieved out on the
362 Hector architecture, the previous UK's high-end computing resource, funded by
363 the UK Research Councils, which has been stopped in the early 2014.
365 In the experiments we report the size of the 3D poisson considered
368 The first column shows the size of the problem The size is chosen in order to
369 have approximately 50,000 components per core. The second column represents the
370 number of cores used. In parenthesis, there is the decomposition used for the
371 Krylov multisplitting. The third column and the sixth column respectively show
372 the execution time for the GMRES and the Kyrlow multisplitting code. The fourth
373 and the seventh column describes the number of iterations. For the
374 multisplitting code, the total number of inner iterations is represented in
377 We also give the other parameters: the restart for the GRMES method....
381 \begin{tabular}{|c|c||c|c|c||c|c|c||c|}
383 \multirow{2}{*}{Pb size}&\multirow{2}{*}{Nb. cores} & \multicolumn{3}{c||}{GMRES} & \multicolumn{3}{c||}{Krylov Multisplitting} & \multirow{2}{*}{Ratio}\\
385 & & Time (s) & nb Iter. & $\Delta$ & Time (s)& nb Iter. & $\Delta$ & \\
388 $590^3$ & 4096 (2x2048) & 462.6 & 55,494 & 4.92e-7 & 74.1 & 1,101(8,211) & 6.62e-08 & 6.25 \\
390 $743^3$ & 8192 (2x4096) & 704.4 & 87,822 & 4.80e-07 & 151.2 & 3,061(14,914) & 5.87e-08 & 4.65 \\
392 $743^3$ & 8192 (4x2048) & 704.4 & 87,822 & 4.80e-07 & 110.3 & 1,531(12,721) & 1.47e-07& 6.39 \\
401 \section{Conclusion and perspectives}
403 Other applications (=> other matrices)\\
409 %%%%%%%%%%%%%%%%%%%%%%%%
410 %%%%%%%%%%%%%%%%%%%%%%%%
412 \bibliographystyle{plain}
413 \bibliography{biblio}