[petsc-users] An issue of extraction of factorization matrices in sparse direct solver

赵刚 zhaog6 at lsec.cc.ac.cn
Thu Oct 27 10:59:54 CDT 2022


Thank you Sherry for the triangular matrices extraction ways, it's very useful, I'll try to do this in SuperLU_DIST.

In addition, Matthew, is it possible for PETSc to write interfaces that support printing `L` and `U` for SuperLU_DIST? Because it is very useful in some industrial application scenarios (store `L` and `U` in advance).




Best Regards,

Gang



-----原始邮件-----
发件人:"Xiaoye S. Li" <xsli at lbl.gov>
发送时间:2022-10-25 05:47:15 (星期二)
收件人: "Matthew Knepley" <knepley at gmail.com>
抄送: "赵刚" <zhaog6 at lsec.cc.ac.cn>, petsc-users at mcs.anl.gov
主题: Re: [petsc-users] An issue of extraction of factorization matrices in sparse direct solver


There are some utility routines for printing L\U in superlu_dist: SRC/dutil_dist.c
You can output the L factor to a file with the triplet format by using
https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L675
but use line 755 instead of line 753.
You can convert the L factor to CSR or triplet using https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L815
https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1075
but need to make sure you only use 1 MPI to call superlu_dist
You can modify
https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1229
to generate CSR/triplet for the U factor as well.


Sherry Li


On Sun, Oct 23, 2022 at 3:38 AM Matthew Knepley <knepley at gmail.com> wrote:

On Sun, Oct 23, 2022 at 2:58 AM 赵刚 <zhaog6 at lsec.cc.ac.cn> wrote:

Dear developers,

I have another question. How can I get the L and U matrices and store them in a file when I call SuperLU through PETSc? Thanks.


SuperLU stores these matrices in its own format. If you want to do I/O with them, you would probably have to
extract them from the Petsc Mat and call SuperLU I/O functions, if they exist.


  Thanks,


     Matt
 
Best Regards,
Gang
--

What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.
-- Norbert Wiener


https://www.cse.buffalo.edu/~knepley/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221027/8833f924/attachment-0001.html>


More information about the petsc-users mailing list