topic Intel MKL PARDISO : reordering once, factorizing multiple times in IntelĀ® oneAPI Math Kernel Library
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1253109#M30832
<P>Hi all,</P>
<P>I have been using MKL PARDISO for two months now to solve linear systems within a Fortran-coded non-linear Finite Element software. At the moment I try to optimize the code and in particular the calls to MKL PARDISO.</P>
<P>In my problem, the coefficient matrix (tangent stiffness matrix) has a constant sparsity pattern, however the coefficients values change at each nonlinear iteration.</P>
<P>If I am correct, in this case it makes sense to reorder and symbolically factorize (phase 11) only once -at the beginning- and then factorize (phase 22) each time the coefficients change.</P>
<P>If I do so, I get no errors but the results become wrong after the first iteration.</P>
<P>Conversely, the results are correct if I perform the two phases 11+22 at each nonlinear iteration.</P>
<P>Is my hypothesis fundamentally wrong, to want to perform phase 11 only once? Or is there something else going on here that I do not see?</P>
<P>Thank you very much for your help!</P>
<P>ML</P>
<P>PS: I am NOT using the DSS interface</P>
<P>PPS: I have already tried to set iparm(5)=2 to save the permutation vector computed in phase 11</P>Thu, 04 Feb 2021 11:37:44 GMTmlucio892021-02-04T11:37:44ZIntel MKL PARDISO : reordering once, factorizing multiple times
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1253109#M30832
<P>Hi all,</P>
<P>I have been using MKL PARDISO for two months now to solve linear systems within a Fortran-coded non-linear Finite Element software. At the moment I try to optimize the code and in particular the calls to MKL PARDISO.</P>
<P>In my problem, the coefficient matrix (tangent stiffness matrix) has a constant sparsity pattern, however the coefficients values change at each nonlinear iteration.</P>
<P>If I am correct, in this case it makes sense to reorder and symbolically factorize (phase 11) only once -at the beginning- and then factorize (phase 22) each time the coefficients change.</P>
<P>If I do so, I get no errors but the results become wrong after the first iteration.</P>
<P>Conversely, the results are correct if I perform the two phases 11+22 at each nonlinear iteration.</P>
<P>Is my hypothesis fundamentally wrong, to want to perform phase 11 only once? Or is there something else going on here that I do not see?</P>
<P>Thank you very much for your help!</P>
<P>ML</P>
<P>PS: I am NOT using the DSS interface</P>
<P>PPS: I have already tried to set iparm(5)=2 to save the permutation vector computed in phase 11</P>Thu, 04 Feb 2021 11:37:44 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1253109#M30832mlucio892021-02-04T11:37:44ZRe: Intel MKL PARDISO : reordering once, factorizing multiple times
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1253638#M30848
<P>Hello,</P>
<P>Your general line of thinking is correct but there are important details to understand.</P>
<P>1) If you use matching or scaling, then the result of phase 1 actually depends on your matrix values. So it is almost impossible (and PARDISO cannot do it now) re-use the phase 1's information in this case. So, you need to turn off these features.</P>
<P>2) Second, without special notification PARDISO cannot work like you tried, with calling phase 22 once, then "silently" changing the matrix values and then calling phase 22 again.</P>
<P>3) What PARDISO can do for you is three things. <BR />First, if you want to keep older matrices and the number of different matrices is small, you can use mnum/maxfct parameters to force PARDISO store multiple factorizations in a single handle. <STRONG>I believe though it is not your case.</STRONG><BR />Second, there is so called "low rank" feature of PARDISO, see <A href="https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/sparse-solver-routines/onemkl-pardiso-parallel-direct-sparse-solver-interface.html" target="_blank">https://software.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/sparse-solver-routines/onemkl-pardiso-parallel-direct-sparse-solver-interface.html</A> (section "Low Rank Update"). You can specify which part of matrix values change (possibly, all of them) and then call phase 22 with this information. Then factorization will be re-computed only for the part which changed. <STRONG>But you need to know the location of the changes. If the changes are for all matrix values, it won't bring any benefit.</STRONG></P>
<P>Third, if the matrix values are changing smoothly and not much, you can only do iterative refinement (essentially, use the previous matrix factors as a good approximation to the inverse). Then you only call phase 33 with iterative refinement, without re-doing factorization at all. For exmaple, you can re-compute factorization from scratch once you matrix changes are too large and not every nonlinear iteration. Just set the number of iteration steps to be reasonable (iparm(8)).</P>
<P>I hope there is something useful for you in my reply.</P>
<P>Best,<BR />Kirill</P>
<P> </P>
<P> </P>Sat, 06 Feb 2021 00:02:47 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1253638#M30848Kirill_V_Intel2021-02-06T00:02:47ZRe: Intel MKL PARDISO : reordering once, factorizing multiple times
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1254441#M30867
<P>Hi <LI-USER uid="111125"></LI-USER> ,</P>
<P>Thank you very much for your answer. As you pointed out, I think my only option for the moment is probably to perform phase 1 and 2 together, each time.</P>
<P>However, I'll give iterative refinement a thought for the future.</P>
<P>Have a nice day,</P>
<P>ML</P>Tue, 09 Feb 2021 12:29:19 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1254441#M30867mlucio892021-02-09T12:29:19ZRe:Intel MKL PARDISO : reordering once, factorizing multiple times
https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1256284#M30900
<P>Hi Marco,</P><P><BR /></P><P>Thanks for the confirmation.</P><P>As your issue has been resolved, we are closing this thread. If you require additional assistance from Intel, please start a new thread. Any further interaction in this thread will be considered community only</P><P><BR /></P><P>Regards</P><P>Prasanth</P><BR />Tue, 16 Feb 2021 05:32:51 GMThttps://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Intel-MKL-PARDISO-reordering-once-factorizing-multiple-times/m-p/1256284#M30900PrasanthD_intel2021-02-16T05:32:51Z