4 CHAPTER 1. PARALLEL SPARSE SOLVER } defaulttoMUMPS(); { } matrix A = [[ 1, 2, 2, 1, 1], [ 2, 12, 0, 10 , 10], [ 2, 0, 1, 0, 2], [ 1, 10, 0, 22, 0.], [ 1, 10, 2, 0., 22]]; // solving with MUMPS // default <strong>solver</strong> : real-> MUMPS, complex -> MUMPS real[int] xx = [ 1,32,45,7,2], x(5), b(5), di(5); b=A*xx; cout
1.2. SPARSE DIRECT SOLVER 5 Installation of MUMPS To used MUMPS in FreeFem++ , you have to install MUMPS package in first. MUMPS is written in Fortran 90. The <strong>parallel</strong> version is constructing using MPI [4] for message passing and used the following libraries : BLAS [5, 6], BLACS and ScaLAPACK[7]. Therefore, we need a fortran compiler, MPI, BLAS, BLACS and ScaLAPACK to do this compilation. An installation procedure to obtain this package is given in the file README COMPILE in the directory src/<strong>solver</strong> of FreeFem++ . Creating Library of MUMPS interface for FreeFem++ : The MUMPS interface for FreeFem++ is given in file MUMPS freefem.cpp (directory src/<strong>solver</strong>/ ). This interface work with the release 3.8.3 and 3.8.4 of MUMPS. To used MUMPS in FreeFem++ , we need the library corresponding to this interface. A description to obtain this library is given in the file README COMPILE in the directory src/<strong>solver</strong> of FreeFem++ . We recall here the procedure. Go to the directory src/<strong>solver</strong> in FreeFem++ package. Edit the file makefile-<strong>sparse</strong><strong>solver</strong>.inc to yours system: comment Section 1, comment line corresponding to libraries BLAS, BLACS, ScaLAPACK, Metis, scotch in Section 2 and comment in Section 3 the paragraph corresponding to MUMPS <strong>solver</strong>. And just type make mumps in the terminal to obtain the dynamic library of interface. Now we give a short description of MUMPS parameters before describing the method to call MUMPS in FreeFem++ . MUMPS parameters: There are four input parameters in MUMPS (see [8]). Two integers SYM and PAR, a vector of integer of size 40 INCTL and a vector of real of size 15 CNTL. The first parameter gives the type of the matrix: 0 for unsymmetric matrix, 1 for symmetric positive matrix and 2 for general symmetric. The second parameter defined if the host processor work during the factorization and solves steps : PAR=1 host processor working and PAR=0 host processor not working. The parameter INCTL and CNTL is the control parameter of MUMPS. The vectors ICNTL and CNTL in MUMPS becomes with index 1 like vector in fortran. A short description of all parameter of ICNTL and CNTL is given in ffmumps fileparam.txt. For more details see the users’ guide [8]. We describe now some elements of the main parameter of ICNTL for MUMPS. input matrix parameter The input matrix is controlled by parameter ICNTL(5) and ICNTL(18). The matrix format (resp. matrix pattern and matrix entries) are controlled by INCTL(5) (resp. INCTL(18)). The different value of ICNTL(5) are 0 for assembled format and 1 for element format. In the current release of Freefem++, we consider that FE matrix or matrix is storage in assembled format. Therefore, INCTL(5) is treated as 0 value. The main option for ICNTL(18): INCLTL(18)=0 centrally on the host processor, ICNTL(18)=3 distributed the input matrix pattern and the entries (recommended option for distributed matrix by developer of MUMPS). For other values of ICNTL(18) see the user’s guide of MUMPS. These values can be used also in Freefem++. The default option implemented in FreeFem++ are ICNTL(5)=0 and ICNTL(18)=0. preprocessing parameter The preprocessed matrix Ap that will be effectively factored is defined by Ap = P Dr A Qc DcP t where P is the permutation matrix, Qc is the column permutation, Dr and Dc are diagonal matrix for respectively row and column scaling. The ordering strategy to obtain P is controlled by parameter ICNTL(7). The permutation of zero free diagonal Qc is controlled by parameter ICNTL(6). The row and column scaling is controlled by parameter ICNTL(18). These option are connected and