]> AND Private Git Repository - Krylov_multi.git/blob - krylov_multi.tex
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
12-01-2014
[Krylov_multi.git] / krylov_multi.tex
1 \documentclass{article}
2 \usepackage[utf8]{inputenc}
3 \usepackage{amsfonts,amssymb}
4 \usepackage{amsmath}
5 \usepackage{graphicx}
6 %\usepackage{algorithmic}
7 %\usepackage[ruled,english,boxed,linesnumbered]{algorithm2e}
8 %\usepackage[english]{algorithme}
9 \usepackage{algorithm}
10 \usepackage{algpseudocode}
11
12
13 \title{A scalable multisplitting algorithm for solving large sparse linear systems} 
14
15
16
17 \begin{document}
18 \author{Raphaël Couturier \and Lilia Ziane Khodja}
19
20 \maketitle
21
22
23 %%%%%%%%%%%%%%%%%%%%%%%%
24 %%%%%%%%%%%%%%%%%%%%%%%%
25
26
27 \begin{abstract}
28 In  this  paper we  revist  the  krylov  multisplitting algorithm  presented  in
29 \cite{huang1993krylov}  which  uses  a  scalar  method to  minimize  the  krylov
30 iterations computed by a multisplitting algorithm. Our new algorithm is based on
31 a  parallel multisplitting  algorithm  with few  blocks  of large  size using  a
32 parallel GMRES method inside each block and on a parallel krylov minimization in
33 order to improve the convergence. Some large scale experiments with a 3D Poisson
34 problem  are presented.   They  show  the obtained  improvements  compared to  a
35 classical GMRES both in terms of number of iterations and execution times.
36 \end{abstract}
37
38
39 %%%%%%%%%%%%%%%%%%%%%%%%
40 %%%%%%%%%%%%%%%%%%%%%%%%
41
42
43 \section{Introduction}
44
45 Iterative methods are used to solve  large sparse linear systems of equations of
46 the form  $Ax=b$ because they are  easier to parallelize than  direct ones. Many
47 iterative  methods have  been proposed  and  adapted by  many researchers.   For
48 example, the GMRES method and the  Conjugate Gradient method are very well known
49 and  used by  many researchers  ~\cite{S96}. Both  the method  are based  on the
50 Krylov subspace which consists in forming  a basis of the sequence of successive
51 matrix powers times the initial residual.
52
53 When  solving large  linear systems  with  many cores,  iterative methods  often
54 suffer  from scalability problems.   This is  due to  their need  for collective
55 communications  to  perform  matrix-vector  products and  reduction  operations.
56 Preconditionners can be  used in order to increase  the convergence of iterative
57 solvers.   However, most  of the  good preconditionners  are not  sclalable when
58 thousands of cores are used.
59
60
61 A completer...
62 On ne peut pas parler de tout...\\
63
64
65
66
67 %%%%%%%%%%%%%%%%%%%%%%%
68 %% BEGIN
69 %%%%%%%%%%%%%%%%%%%%%%%
70 The key idea  of the multisplitting method for  solving a large system
71 of linear equations $Ax=b$ consists  in partitioning the matrix $A$ in
72 $L$ several ways
73 \begin{equation}
74 A = M_l - N_l,~l\in\{1,\ldots,L\},
75 \label{eq01}
76 \end{equation}
77 where $M_l$ are nonsingular matrices. Then the linear system is solved
78 by iteration based on the multisplittings as follows
79 \begin{equation}
80 x^{k+1}=\displaystyle\sum^L_{l=1} E_l M^{-1}_l (N_l x^k + b),~k=1,2,3,\ldots
81 \label{eq02}
82 \end{equation}
83 where $E_l$ are non-negative and diagonal weighting matrices such that
84 $\sum^L_{l=1}E_l=I$ ($I$ is an identity matrix).  Thus the convergence
85 of such a method is dependent on the condition
86 \begin{equation}
87 \rho(\displaystyle\sum^L_{l=1}E_l M^{-1}_l N_l)<1.
88 \label{eq03}
89 \end{equation}
90
91 The advantage of  the multisplitting method is that  at each iteration
92 $k$ there are $L$ different linear sub-systems
93 \begin{equation}
94 v_l^k=M^{-1}_l N_l x_l^{k-1} + M^{-1}_l b,~l\in\{1,\ldots,L\},
95 \label{eq04}
96 \end{equation}
97 to be solved  independently by a direct or  an iterative method, where
98 $v_l^k$  is   the  solution  of   the  local  sub-system.   Thus,  the
99 calculations  of $v_l^k$  may be  performed in  parallel by  a  set of
100 processors.   A multisplitting  method using  an iterative  method for
101 solving the $L$ linear  sub-systems is called an inner-outer iterative
102 method or a  two-stage method.  The results $v_l^k$  obtained from the
103 different splittings~(\ref{eq04}) are combined to compute the solution
104 $x^k$ of the linear system by using the diagonal weighting matrices
105 \begin{equation}
106 x^k = \displaystyle\sum^L_{l=1} E_l v_l^k,
107 \label{eq05}
108 \end{equation}    
109 In the case where the diagonal weighting matrices $E_l$ have only zero
110 and   one   factors  (i.e.   $v_l^k$   are   disjoint  vectors),   the
111 multisplitting method is non-overlapping  and corresponds to the block
112 Jacobi method.
113 %%%%%%%%%%%%%%%%%%%%%%%
114 %% END
115 %%%%%%%%%%%%%%%%%%%%%%%
116
117 \section{Related works}
118
119
120 A general framework  for studying parallel multisplitting has  been presented in
121 \cite{o1985multi} by O'Leary and White. Convergence conditions are given for the
122 most general case.  Many authors improved multisplitting algorithms by proposing
123 for  example  an  asynchronous  version  \cite{bru1995parallel}  and  convergence
124 conditions  \cite{bai1999block,bahi2000asynchronous}   in  this  case   or  other
125 two-stage algorithms~\cite{frommer1992h,bru1995parallel}.
126
127 In  \cite{huang1993krylov},  the  authors  proposed  a  parallel  multisplitting
128 algorithm in which all the tasks except  one are devoted to solve a sub-block of
129 the splitting  and to send their  local solution to  the first task which  is in
130 charge to  combine the vectors at  each iteration.  These vectors  form a Krylov
131 basis for  which the first task minimizes  the error function over  the basis to
132 increase the convergence, then the other tasks receive the update solution until
133 convergence of the global system. 
134
135
136
137 In \cite{couturier2008gremlins}, the  authors proposed practical implementations
138 of multisplitting algorithms that take benefit from multisplitting algorithms to
139 solve large scale linear systems. Inner  solvers could be based on scalar direct
140 method with the LU method or scalar iterative one with GMRES.
141
142 In~\cite{prace-multi},  the  authors  have  proposed a  parallel  multisplitting
143 algorithm in which large block are solved using a GMRES solver. The authors have
144 performed large scale experimentations upto  32.768 cores and they conclude that
145 asynchronous  multisplitting algorithm  could more  efficient  than traditionnal
146 solvers on exascale architecture with hunders of thousands of cores.
147
148
149 %%%%%%%%%%%%%%%%%%%%%%%%
150 %%%%%%%%%%%%%%%%%%%%%%%%
151
152
153 \section{A two-stage method with a minimization}
154 Let $Ax=b$ be a given sparse  and large linear system of $n$ equations
155 to  solve  in  parallel   on  $L$  clusters,  physically  adjacent  or
156 geographically distant, where $A\in\mathbb{R}^{n\times n}$ is a square
157 and  nonsingular matrix, $x\in\mathbb{R}^{n}$  is the  solution vector
158 and   $b\in\mathbb{R}^{n}$  is   the  right-hand   side   vector.  The
159 multisplitting of this linear system is defined as follows:
160 \begin{equation}
161 \left\{
162 \begin{array}{lll}
163 A & = & [A_{1}, \ldots, A_{L}]\\
164 x & = & [X_{1}, \ldots, X_{L}]\\
165 b & = & [B_{1}, \ldots, B_{L}]
166 \end{array}
167 \right.
168 \label{sec03:eq01}
169 \end{equation}  
170 where for  $l\in\{1,\ldots,L\}$, $A_l$ is a rectangular  block of size
171 $n_l\times n$ and $X_l$ and  $B_l$ are sub-vectors of size $n_l$, such
172 that  $\sum_ln_l=n$.  In this  case,  we  use  a row-by-row  splitting
173 without overlapping in  such a way that successive  rows of the sparse
174 matrix $A$ and  both vectors $x$ and $b$ are  assigned to one cluster.
175 So,  the multisplitting  format of  the  linear system  is defined  as
176 follows:
177 \begin{equation}
178 \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, 
179 \label{sec03:eq02}
180 \end{equation} 
181 where $A_{li}$ is  a block of size $n_l\times  n_i$ of the rectangular
182 matrix  $A_l$, $X_i\neq  X_l$ is  a sub-vector  of size  $n_i$  of the
183 solution vector  $x$ and $\sum_{i<l}n_i+\sum_{i>l}n_i+n_l=n$,  for all
184 $i\in\{1,\ldots,l-1,l+1,\ldots,L\}$.
185
186 The multisplitting method proceeds by iteration for solving the linear
187 system in such a way each sub-system
188 \begin{equation}
189 \left\{
190 \begin{array}{l}
191 A_{ll}X_l = Y_l \mbox{,~such that}\\
192 Y_l = B_l - \displaystyle\sum_{i=1,i\neq l}^{L}A_{li}X_i,
193 \end{array}
194 \right.
195 \label{sec03:eq03}
196 \end{equation}
197 is solved  independently by a cluster of  processors and communication
198 are required  to update the  right-hand side vectors $Y_l$,  such that
199 the  vectors  $X_i$  represent   the  data  dependencies  between  the
200 clusters. In this work,  we use the parallel GMRES method~\cite{ref34}
201 as     an     inner    iteration     method     for    solving     the
202 sub-systems~(\ref{sec03:eq03}).  It  is a well-known  iterative method
203 which  gives good performances  for solving  sparse linear  systems in
204 parallel on a cluster of processors.
205
206 It should be noted that  the convergence of the inner iterative solver
207 for  the  different  linear  sub-systems~(\ref{sec03:eq03})  does  not
208 necessarily involve  the convergence of the  multisplitting method. It
209 strongly depends on  the properties of the sparse  linear system to be
210 solved                 and                the                computing
211 environment~\cite{o1985multi,ref18}.  Furthermore,  the multisplitting
212 of the  linear system among  several clusters of  processors increases
213 the  spectral radius  of  the iteration  matrix,  thereby slowing  the
214 convergence.  In   this  paper,  we   based  on  the   work  presented
215 in~\cite{huang1993krylov} to increase  the convergence and improve the
216 scalability of the multisplitting methods.
217
218 In  order  to  accelerate  the  convergence, we  implement  the  outer
219 iteration  of the multisplitting  solver as  a Krylov  subspace method
220 which minimizes some error function over a Krylov subspace~\cite{S96}.
221 The Krylov  space of  the method that  we used  is spanned by  a basis
222 composed  of   successive  solutions  issued  from   solving  the  $L$
223 splittings~(\ref{sec03:eq03})
224 \begin{equation}
225 S=\{x^1,x^2,\ldots,x^s\},~s\leq n,
226 \label{sec03:eq04}
227 \end{equation}
228 where   for  $j\in\{1,\ldots,s\}$,  $x^j=[X_1^j,\ldots,X_L^j]$   is  a
229 solution of the  global linear system.%The advantage such a method is that the Krylov subspace does not need to be spanned by an orthogonal basis.
230 The advantage  of such a  Krylov subspace is  that we need  neither an
231 orthogonal basis  nor synchronizations between  the different clusters
232 to generate this basis.
233
234 The  multisplitting   method  is  periodically   restarted  every  $s$
235 iterations  with   a  new  initial   guess  $\tilde{x}=S\alpha$  which
236 minimizes  the error  function $\|b-Ax\|_2$  over the  Krylov subspace
237 spanned  by  the vectors  of  $S$.  So,  $\alpha$  is  defined as  the
238 solution of the large overdetermined linear system
239 \begin{equation}
240 R\alpha=b,
241 \label{sec03:eq05}
242 \end{equation}
243 where $R=AS$  is a  dense rectangular matrix  of size $n\times  s$ and
244 $s\ll n$. This leads us to solve the system of normal equations
245 \begin{equation}
246 R^TR\alpha=R^Tb,
247 \label{sec03:eq06}
248 \end{equation}
249 which is associated with the least squares problem
250 \begin{equation}
251 \text{minimize}~\|b-R\alpha\|_2,
252 \label{sec03:eq07}
253 \end{equation}  
254 where  $R^T$  denotes the  transpose  of  the  matrix $R$.  Since  $R$
255 (i.e.  $AS$) and  $b$  are  split among  $L$  clusters, the  symmetric
256 positive    definite    system~(\ref{sec03:eq06})    is   solved    in
257 parallel. Thus, an  iterative method would be more  appropriate than a
258 direct  one for  solving this  system. We  use the  parallel conjugate
259 gradient method for the normal equations CGNR~\cite{S96,refCGNR}.
260
261 \begin{algorithm}[!t]
262 \caption{A two-stage linear solver with inner iteration GMRES method}
263 \begin{algorithmic}[1]
264 \State Load $A_l$, $B_l$, initial guess $x^0$
265 \State Initialize the minimizer $\tilde{x}^0=x^0$
266 \For {$k=1,2,3,\ldots$ until the global convergence}
267 \State Restart with $x^0=\tilde{x}^{k-1}$: \textbf{for} $j=1,2,\ldots,s$ \textbf{do}
268 \State\hspace{0.5cm} Inner iteration solver: \Call{InnerSolver}{$x^0$, $j$}
269 \State\hspace{0.5cm} Construct the basis $S$: add the column vector $X_l^j$ to the matrix $S_l$
270 \State\hspace{0.5cm} Exchange the local solution vector $X_l^j$ with the neighboring clusters
271 \State\hspace{0.5cm} Compute the dense matrix $R$: $R_l^j=\sum^L_{i=1}A_{li}X_i^j$ 
272 \State\textbf{end for} 
273 \State Minimization $\|b-R\alpha\|_2$: \Call{UpdateMinimizer}{$S_l$, $R$, $b$}
274 \State Local solution of the linear system $Ax=b$: $X_l^k=\tilde{X}_l^k$
275 \State Exchange the local minimizer $\tilde{X}_l^k$ with the neighboring clusters
276 \EndFor
277
278 \Statex
279
280 \Function {InnerSolver}{$x^0$, $j$}
281 \State Compute the local right-hand side: $Y_l = B_l - \sum^L_{i=1,i\neq l}A_{li}X_i^0$
282 \State Solving the local splitting $A_{ll}X_l^j=Y_l$ with the parallel GMRES method, such that $X_l^0$ is the initial guess.
283 \State \Return $X_l^j$
284 \EndFunction
285
286 \Statex
287
288 \Function {UpdateMinimizer}{$S_l$, $R$, $b$, $k$}
289 \State Solving the normal equations $R^TR\alpha=R^Tb$ in parallel by $L$ clusters using the parallel CGNR method
290 \State Compute the local minimizer: $\tilde{X}_l^k=S_l\alpha$
291 \State \Return $\tilde{X}_l^k$
292 \EndFunction
293 \end{algorithmic}
294 \label{algo:01}
295 \end{algorithm}
296
297 The main  key points  of the multisplitting  method for  solving large
298 sparse  linear  systems are  given  in Algorithm~\ref{algo:01}.   This
299 algorithm is based on a two-stage method with a minimization using the
300 GMRES iterative method as an  inner solver. It is executed in parallel
301 by  each cluster  of processors.   The matrices  and vectors  with the
302 subscript  $l$ represent  the local  data for  the cluster  $l$, where
303 $l\in\{1,\ldots,L\}$. The two-stage solver uses two different parallel
304 iterative algorithms: the GMRES method for solving each splitting on a
305 cluster of processors, and the CGNR method executed in parallel by all
306 clusters for  minimizing the function  error over the  Krylov subspace
307 spanned by  $S$.  The  algorithm requires two  global synchronizations
308 between the $L$  clusters. The first one is  performed at line~$12$ in
309 Algorithm~\ref{algo:01}  to exchange  the local  values of  the vector
310 solution $x$ (i.e. the  minimizer $\tilde{x}$) required to restart the
311 multisplitting  solver. The  second  one is  needed  to construct  the
312 matrix $R$ of  the Krylov subspace.  We choose  to perform this latter
313 synchronization $s$  times in every  outer iteration $k$  (line~$7$ in
314 Algorithm~\ref{algo:01}). This is a straightforward way to compute the
315 matrix-matrix    multiplication     $R=AS$.     We    implement    all
316 synchronizations   by   using   the   MPI   collective   communication
317 subroutines.
318
319
320
321
322 %%%%%%%%%%%%%%%%%%%%%%%%
323 %%%%%%%%%%%%%%%%%%%%%%%%
324
325 \bibliographystyle{plain}
326 \bibliography{biblio}
327
328 \end{document}