X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/rce2015.git/blobdiff_plain/feda1be54f4c3fca6e201e6791bd285548372ede..9b8612a74b1682a47832402cd8871ab7f7fc9c69:/paper.tex diff --git a/paper.tex b/paper.tex index f1f47bf..b11da8c 100644 --- a/paper.tex +++ b/paper.tex @@ -96,25 +96,26 @@ performed. With some applications, it is difficult, if not impossible, to build accurate performance models. That is why another solution is to use a simulation tool which allows us to change many parameters of the architecture (network bandwidth, latency, number of processors) and to simulate the execution of such -applications. We have decided to use SimGrid as it enables to benchmark MPI -applications. +applications. The main contribution of this paper is to show that the use of a +simulation tool (here we have decided to use the SimGrid toolkit) can really +help developpers to better tune their applications for a given multi-core +architecture. -In this paper, we focus our attention on two parallel iterative algorithms based +In particular we focus our attention on two parallel iterative algorithms based on the Multisplitting algorithm and we compare them to the GMRES algorithm. -These algorithms are used to solve libear systems. Two different variants of +These algorithms are used to solve linear systems. Two different variants of the Multisplitting are studied: one using synchronoous iterations and another -one with asynchronous iterations. For each algorithm we have tested different -parameters to see their influence. We strongly recommend people interested -by investing into a new expensive hardware architecture to benchmark -their applications using a simulation tool before. - - - +one with asynchronous iterations. For each algorithm we have simulated +different architecture parameters to evaluate their influence on the overall +execution time. The obtain simulated results confirm the real results +previously obtained on different real multi-core architectures and also confirm +the efficiency of the asynchronous multisplitting algorithm compared to the +synchronous GMRES method. \end{abstract} %\keywords{Algorithm; distributed; iterative; asynchronous; simulation; simgrid; -%performance} +%performance} \keywords{ Performance evaluation, Simulation, SimGrid, Synchronous and asynchronous iterations, Multisplitting algorithms} \maketitle @@ -131,28 +132,28 @@ are often very important. So, in this context it is difficult to optimize a given application for a given architecture. In this way and in order to reduce the access cost to these computing resources it seems very interesting to use a simulation environment. The advantages are numerous: development life cycle, -code debugging, ability to obtain results quickly,~\ldots. In counterpart, the simulation results need to be consistent with the real ones. +code debugging, ability to obtain results quickly~\ldots. In counterpart, the simulation results need to be consistent with the real ones. In this paper we focus on a class of highly efficient parallel algorithms called \emph{iterative algorithms}. The parallel scheme of iterative methods is quite simple. It generally involves the division of the problem into several \emph{blocks} that will be solved in parallel on multiple processing -units. Each processing unit has to compute an iteration, to send/receive some +units. Each processing unit has to compute an iteration to send/receive some data dependencies to/from its neighbors and to iterate this process until the -convergence of the method. Several well-known methods demonstrate the +convergence of the method. Several well-known studies demonstrate the convergence of these algorithms~\cite{BT89,bahi07}. In this processing mode a task cannot begin a new iteration while it has not received data dependencies -from its neighbors. We say that the iteration computation follows a synchronous -scheme. In the asynchronous scheme a task can compute a new iteration without -having to wait for the data dependencies coming from its neighbors. Both -communication and computations are asynchronous inducing that there is no more -idle time, due to synchronizations, between two iterations~\cite{bcvc06:ij}. -This model presents some advantages and drawbacks that we detail in -section~\ref{sec:asynchro} but even if the number of iterations required to -converge is generally greater than for the synchronous case, it appears that -the asynchronous iterative scheme can significantly reduce overall execution -times by suppressing idle times due to synchronizations~(see~\cite{bahi07} -for more details). +from its neighbors. We say that the iteration computation follows a +\textit{synchronous} scheme. In the asynchronous scheme a task can compute a new +iteration without having to wait for the data dependencies coming from its +neighbors. Both communication and computations are \textit{asynchronous} +inducing that there is no more idle time, due to synchronizations, between two +iterations~\cite{bcvc06:ij}. This model presents some advantages and drawbacks +that we detail in section~\ref{sec:asynchro} but even if the number of +iterations required to converge is generally greater than for the synchronous +case, it appears that the asynchronous iterative scheme can significantly +reduce overall execution times by suppressing idle times due to +synchronizations~(see~\cite{bahi07} for more details). Nevertheless, in both cases (synchronous or asynchronous) it is very time consuming to find optimal configuration and deployment requirements for a given @@ -223,22 +224,22 @@ consult~\cite{myBCCV05c,bahi07,ccl09:ij}. \label{sec:04} \subsection{Synchronous and asynchronous two-stage methods for sparse linear systems} \label{sec:04.01} -In this paper we focus on two-stage multisplitting methods in their both versions (synchronous and asynchronous)~\cite{Frommer92,Szyld92,Bru95}. These iterative methods are based on multisplitting methods~\cite{O'leary85,White86,Alefeld97} and use two nested iterations: the outer iteration and the inner iteration. Let us consider the following sparse linear system of $n$ equations in $\mathbb{R}$ +In this paper we focus on two-stage multisplitting methods in their both versions (synchronous and asynchronous)~\cite{Frommer92,Szyld92,Bru95}. These iterative methods are based on multisplitting methods~\cite{O'leary85,White86,Alefeld97} and use two nested iterations: the outer iteration and the inner iteration. Let us consider the following sparse linear system of $n$ equations in $\mathbb{R}$: \begin{equation} Ax=b, \label{eq:01} \end{equation} -where $A$ is a sparse square and nonsingular matrix, $b$ is the right-hand side and $x$ is the solution of the system. Our work in this paper is restricted to the block Jacobi splitting method. This approach of multisplitting consists in partitioning the matrix $A$ into $L$ horizontal band matrices of order $\frac{n}{L}\times n$ without overlapping (i.e. sub-vectors $\{x_\ell\}_{1\leq\ell\leq L}$ are disjoint). Two-stage multisplitting methods solve the linear system~(\ref{eq:01}) iteratively as follows +where $A$ is a sparse square and nonsingular matrix, $b$ is the right-hand side and $x$ is the solution of the system. Our work in this paper is restricted to the block Jacobi splitting method. This approach of multisplitting consists in partitioning the matrix $A$ into $L$ horizontal band matrices of order $\frac{n}{L}\times n$ without overlapping (i.e. sub-vectors $\{x_\ell\}_{1\leq\ell\leq L}$ are disjoint). Two-stage multisplitting methods solve the linear system~(\ref{eq:01}) iteratively as follows: \begin{equation} x_\ell^{k+1} = A_{\ell\ell}^{-1}(b_\ell - \displaystyle\sum^{L}_{\substack{m=1\\m\neq\ell}}{A_{\ell m}x^k_m}),\mbox{~for~}\ell=1,\ldots,L\mbox{~and~}k=1,2,3,\ldots \label{eq:02} \end{equation} -where $x_\ell$ are sub-vectors of the solution $x$, $b_\ell$ are the sub-vectors of the right-hand side $b$, and $A_{\ell\ell}$ and $A_{\ell m}$ are diagonal and off-diagonal blocks of matrix $A$ respectively. The iterations of these methods can naturally be computed in parallel such that each processor or cluster of processors is responsible for solving one splitting as a linear sub-system +where $x_\ell$ are sub-vectors of the solution $x$, $b_\ell$ are the sub-vectors of the right-hand side $b$, and $A_{\ell\ell}$ and $A_{\ell m}$ are diagonal and off-diagonal blocks of matrix $A$ respectively. The iterations of these methods can naturally be computed in parallel such that each processor or cluster of processors is responsible for solving one splitting as a linear sub-system: \begin{equation} A_{\ell\ell} x_\ell = c_\ell,\mbox{~for~}\ell=1,\ldots,L, \label{eq:03} \end{equation} -where right-hand sides $c_\ell=b_\ell-\sum_{m\neq\ell}A_{\ell m}x_m$ are computed using the shared vectors $x_m$. In this paper, we use the well-known iterative method GMRES ({\it Generalized Minimal RESidual})~\cite{saad86} as an inner iteration to approximate the solutions of the different splittings arising from the block Jacobi multisplitting of matrix $A$. The algorithm in Figure~\ref{alg:01} shows the main key points of our block Jacobi two-stage method executed by a cluster of processors. In line~\ref{solve}, the linear sub-system~(\ref{eq:03}) is solved in parallel using GMRES method where $\MIG$ and $\TOLG$ are the maximum number of inner iterations and the tolerance threshold for GMRES respectively. The convergence of the two-stage multisplitting methods, based on synchronous or asynchronous iterations, is studied by many authors for example~\cite{Bru95,bahi07}. +where right-hand sides $c_\ell=b_\ell-\sum_{m\neq\ell}A_{\ell m}x_m$ are computed using the shared vectors $x_m$. In this paper, we use the well-known iterative method GMRES ({\it Generalized Minimal RESidual})~\cite{saad86} as an inner iteration to approximate the solutions of the different splittings arising from the block Jacobi multisplitting of matrix $A$. The algorithm in Figure~\ref{alg:01} shows the main key points of our block Jacobi two-stage method executed by a cluster of processors. In line~\ref{solve}, the linear sub-system~(\ref{eq:03}) is solved in parallel using GMRES method where $\MIG$ and $\TOLG$ are the maximum number of inner iterations and the tolerance threshold for GMRES respectively. The convergence of the two-stage multisplitting methods, based on synchronous or asynchronous iterations, has been studied by many authors for example~\cite{Bru95,bahi07}. \begin{figure}[t] %\begin{algorithm}[t] @@ -259,19 +260,19 @@ where right-hand sides $c_\ell=b_\ell-\sum_{m\neq\ell}A_{\ell m}x_m$ are compute %\end{algorithm} \end{figure} -In this paper, we propose two algorithms of two-stage multisplitting methods. The first algorithm is based on the asynchronous model which allows the communications to be overlapped by computations and reduces the idle times resulting from the synchronizations. So in the asynchronous mode, our two-stage algorithm uses asynchronous outer iterations and asynchronous communications between clusters. The communications (i.e. lines~\ref{send} and~\ref{recv} in Figure~\ref{alg:01}) are performed by message passing using MPI non-blocking communication routines. The convergence of the asynchronous iterations is detected when all clusters have locally converged +In this paper, we propose two algorithms of two-stage multisplitting methods. The first algorithm is based on the asynchronous model which allows communications to be overlapped by computations and reduces the idle times resulting from the synchronizations. So in the asynchronous mode, our two-stage algorithm uses asynchronous outer iterations and asynchronous communications between clusters. The communications (i.e. lines~\ref{send} and~\ref{recv} in Figure~\ref{alg:01}) are performed by message passing using MPI non-blocking communication routines. The convergence of the asynchronous iterations is detected when all clusters have locally converged: \begin{equation} k\geq\MIM\mbox{~or~}\|x_\ell^{k+1}-x_\ell^k\|_{\infty }\leq\TOLM, \label{eq:04} \end{equation} -where $\MIM$ is the maximum number of outer iterations and $\TOLM$ is the tolerance threshold for the two-stage algorithm. +where $\MIM$ is the maximum number of outer iterations and $\TOLM$ is the tolerance threshold for the two-stage algorithm. -The second two-stage algorithm is based on synchronous outer iterations. We propose to use the Krylov iteration based on residual minimization to improve the slow convergence of the multisplitting methods. In this case, a $n\times s$ matrix $S$ is set using solutions issued from the inner iteration +The second two-stage algorithm is based on synchronous outer iterations. We propose to use the Krylov iteration based on residual minimization to improve the slow convergence of the multisplitting methods. In this case, a $n\times s$ matrix $S$ is set using solutions issued from the inner iteration: \begin{equation} S=[x^1,x^2,\ldots,x^s],~s\ll n. \label{eq:05} \end{equation} -At each $s$ outer iterations, the algorithm computes a new approximation $\tilde{x}=S\alpha$ which minimizes the residual +At each $s$ outer iterations, the algorithm computes a new approximation $\tilde{x}=S\alpha$ which minimizes the residual: \begin{equation} \min_{\alpha\in\mathbb{R}^s}{\|b-AS\alpha\|_2}. \label{eq:06} @@ -304,11 +305,11 @@ The algorithm in Figure~\ref{alg:02} includes the procedure of the residual mini %\end{algorithm} \end{figure} -\subsection{Simulation of two-stage methods using SimGrid framework} +\subsection{Simulation of the two-stage methods using SimGrid toolkit} \label{sec:04.02} One of our objectives when simulating the application in Simgrid is, as in real -life, to get accurate results (solutions of the problem) but also ensure the +life, to get accurate results (solutions of the problem) but also to ensure the test reproducibility under the same conditions. According to our experience, very few modifications are required to adapt a MPI program for the Simgrid simulator using SMPI (Simulator MPI). The first modification is to include SMPI @@ -316,7 +317,7 @@ libraries and related header files (smpi.h). The second modification is to suppress all global variables by replacing them with local variables or using a Simgrid selector called "runtime automatic switching" (smpi/privatize\_global\_variables). Indeed, global variables can generate side -effects on runtime between the threads running in the same process, generated by +effects on runtime between the threads running in the same process and generated by Simgrid to simulate the grid environment. %\RC{On vire cette phrase ?} \RCE {Si c'est la phrase d'avant sur les threads, je pense qu'on peut la retenir car c'est l'explication du pourquoi Simgrid n'aime pas les variables globales. Si c'est pas bien dit, on peut la reformuler. Si c'est la phrase ci-apres, effectivement, on peut la virer si elle preterais a discussion}The @@ -345,19 +346,19 @@ In addition, the following arguments are given to the programs at runtime: \begin{itemize} \item maximum number of inner and outer iterations; \item inner and outer precisions; - \item maximum number of the gmres's restarts in the Arnorldi process; - \item maximum number of iterations qnd the tolerance threshold in classical GMRES; + \item maximum number of the GMRES restarts in the Arnorldi process; + \item maximum number of iterations and the tolerance threshold in classical GMRES; \item tolerance threshold for outer and inner-iterations; - \item matrix size (N$_{x}$, N$_{y}$ and N$_{z}$) respectively on x, y, z axis; - \item matrix diagonal value = 6.0 for synchronous Krylov multisplitting experiments and 6.2 for asynchronous block Jacobi experiments; \RC{CE tu vérifies, je dis ca de tête} + \item matrix size (N$_{x}$, N$_{y}$ and N$_{z}$) respectively on $x, y, z$ axis; + \item matrix diagonal value is fixed to $6.0$ for synchronous Krylov multisplitting experiments and $6.2$ for asynchronous block Jacobi experiments; \RC{CE tu vérifies, je dis ca de tête} \item matrix off-diagonal value; \item execution mode: synchronous or asynchronous; \RCE {C'est ok la liste des arguments du programme mais si Lilia ou toi pouvez preciser pour les arguments pour CGLS ci dessous} \RC{Vu que tu n'as pas fait varier ce paramètre, on peut ne pas en parler} \item Size of matrix S; - \item Maximum number of iterations and tolerance threshold for CGLS. + \item Maximum number of iterations and tolerance threshold for CGLS. \end{itemize} -It should also be noticed that both solvers have been executed with the Simgrid selector -cfg=smpi/running\_power which determines the computational power (here 19GFlops) of the simulator host machine. +It should also be noticed that both solvers have been executed with the Simgrid selector \texttt{-cfg=smpi/running\_power} which determines the computational power (here 19GFlops) of the simulator host machine. %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%% @@ -367,30 +368,30 @@ It should also be noticed that both solvers have been executed with the Simgrid In this section, experiments for both Multisplitting algorithms are reported. First the 3D Poisson problem used in our experiments is described. -\subsection{3D Poisson} +\subsection{The 3D Poisson problem} -We use our two-stage algorithms to solve the well-known Poisson problem $\nabla^2\phi=f$~\cite{Polyanin01}. In three-dimensional Cartesian coordinates in $\mathbb{R}^3$, the problem takes the following form +We use our two-stage algorithms to solve the well-known Poisson problem $\nabla^2\phi=f$~\cite{Polyanin01}. In three-dimensional Cartesian coordinates in $\mathbb{R}^3$, the problem takes the following form: \begin{equation} \frac{\partial^2}{\partial x^2}\phi(x,y,z)+\frac{\partial^2}{\partial y^2}\phi(x,y,z)+\frac{\partial^2}{\partial z^2}\phi(x,y,z)=f(x,y,z)\mbox{~in the domain~}\Omega \label{eq:07} \end{equation} -such that +such that: \begin{equation*} \phi(x,y,z)=0\mbox{~on the boundary~}\partial\Omega \end{equation*} -where the real-valued function $\phi(x,y,z)$ is the solution sought, $f(x,y,z)$ is a known function and $\Omega=[0,1]^3$. The 3D discretization of the Laplace operator $\nabla^2$ with the finite difference scheme includes 7 points stencil on the computational grid. The numerical approximation of the Poisson problem on three-dimensional grid is repeatedly computed as $\phi=\phi^\star$ such that +where the real-valued function $\phi(x,y,z)$ is the solution sought, $f(x,y,z)$ is a known function and $\Omega=[0,1]^3$. The 3D discretization of the Laplace operator $\nabla^2$ with the finite difference scheme includes 7 points stencil on the computational grid. The numerical approximation of the Poisson problem on three-dimensional grid is repeatedly computed as $\phi=\phi^\star$ such that: \begin{equation} \begin{array}{ll} \phi^\star(x,y,z)=&\frac{1}{6}(\phi(x-h,y,z)+\phi(x,y-h,z)+\phi(x,y,z-h)\\&+\phi(x+h,y,z)+\phi(x,y+h,z)+\phi(x,y,z+h)\\&-h^2f(x,y,z)) \end{array} \label{eq:08} \end{equation} -until convergence where $h$ is the grid spacing between two adjacent elements in the 3D computational grid. +until convergence where $h$ is the grid spacing between two adjacent elements in the 3D computational grid. -In the parallel context, the 3D Poisson problem is partitioned into $L\times p$ sub-problems such that $L$ is the number of clusters and $p$ is the number of processors in each cluster. We apply the three-dimensional partitioning instead of the row-by-row one in order to reduce the size of the data shared at the sub-problems boundaries. In this case, each processor is in charge of parallelepipedic block of the problem and has at most six neighbors in the same cluster or in distant clusters with which it shares data at boundaries. +In the parallel context, the 3D Poisson problem is partitioned into $L\times p$ sub-problems such that $L$ is the number of clusters and $p$ is the number of processors in each cluster. We apply the three-dimensional partitioning instead of the row-by-row one in order to reduce the size of the data shared at the sub-problems boundaries. In this case, each processor is in charge of parallelepipedic block of the problem and has at most six neighbors in the same cluster or in distant clusters with which it shares data at boundaries. -\subsection{Study setup and Simulation Methodology} +\subsection{Study setup and simulation methodology} First, to conduct our study, we propose the following methodology which can be reused for any grid-enabled applications.\\ @@ -399,10 +400,12 @@ which can be reused for any grid-enabled applications.\\ the application to be tested. Numerical parallel iterative algorithms have been chosen for the study in this paper. \\ -\textbf{Step 2}: Collect the software materials needed for the -experimentation. In our case, we have two variants algorithms for the -resolution of the 3D-Poisson problem: (1) using the classical GMRES; (2) and the Multisplitting method. In addition, the Simgrid simulator has been chosen to simulate the behaviors of the -distributed applications. Simgrid is running on the Mesocentre datacenter in the University of Franche-Comte and also in a virtual machine on a simple laptop. \\ +\textbf{Step 2}: Collect the software materials needed for the experimentation. +In our case, we have two variants algorithms for the resolution of the +3D-Poisson problem: (1) using the classical GMRES; (2) and the Multisplitting +method. In addition, the Simgrid simulator has been chosen to simulate the +behaviors of the distributed applications. Simgrid is running in a virtual +machine on a simple laptop. \\ \textbf{Step 3}: Fix the criteria which will be used for the future results comparison and analysis. In the scope of this study, we retain @@ -443,23 +446,20 @@ the program output results: capacity" of the network is defined as the maximum of data that can transit from one point to another in a unit of time. \item the network latency (lat : microsecond) defined as the delay from the - start time to send the data from a source and the final time the destination - have finished to receive it. + start time to send a simple data from a source to a destination. \end{enumerate} -Upon the network characteristics, another impacting factor is the -application dependent volume of data exchanged between the nodes in the cluster -and between distant clusters. Large volume of data can be transferred and -transit between the clusters and nodes during the code execution. +Upon the network characteristics, another impacting factor is the volume of data exchanged between the nodes in the cluster +and between distant clusters. This parameter is application dependent. In a grid environment, it is common to distinguish, on the one hand, the - "intra-network" which refers to the links between nodes within a cluster and, + "intra-network" which refers to the links between nodes within a cluster and on the other hand, the "inter-network" which is the backbone link between - clusters. In practice, these two networks have different speeds. The - intra-network generally works like a high speed local network with a high - bandwith and very low latency. In opposite, the inter-network connects clusters - sometime via heterogeneous networks components throuth internet with a lower - speed. The network between distant clusters might be a bottleneck for the - global performance of the application. + clusters. In practice, these two networks have different speeds. + The intra-network generally works like a high speed local network with a + high bandwith and very low latency. In opposite, the inter-network connects + clusters sometime via heterogeneous networks components throuth internet with + a lower speed. The network between distant clusters might be a bottleneck + for the global performance of the application. \subsection{Comparison of GMRES and Krylov Multisplitting algorithms in synchronous mode} @@ -682,7 +682,7 @@ Using the Simgrid simulator flexibility, we have tried to determine the impact on the algorithms performance in varying the CPU power of the clusters nodes from 1 to 19 GFlops. The outputs depicted in the figure 6 confirm the performance gain, around 95\% for both of the two methods, -after adding more powerful CPU. +after adding more powerful CPU. \subsection{Comparing GMRES in native synchronous mode and Multisplitting algorithms in asynchronous mode}