[petsc-users] An issue of extraction of factorization matrices in sparse direct solver
Xiaoye S. Li
xsli at lbl.gov
Mon Oct 24 16:47:15 CDT 2022
There are some utility routines for printing L\U in superlu_dist:
SRC/dutil_dist.c
1. 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.
2. 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
3. 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/
> <http://www.cse.buffalo.edu/~knepley/>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20221024/75dd26cc/attachment.html>
More information about the petsc-users
mailing list