<div dir="ltr"><div dir="ltr">On Thu, Oct 27, 2022 at 12:00 PM 赵刚 <<a href="mailto:zhaog6@lsec.cc.ac.cn">zhaog6@lsec.cc.ac.cn</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p>
        Thank you Sherry for the triangular matrices extraction ways, it's very useful, I'll try to do this in SuperLU_DIST.
</p>
<p>
        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).</p></blockquote><div>I think the way to do it would be to add support for this as the ASCII Mat Viewer for that type. It would be a good contribution I think.</div><div><br></div><div>  Thanks,</div><div><br></div><div>     Matt </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<p>
        Best Regards,
</p>
<p>
        Gang
</p>
<br>
<br>
<blockquote name="replyContent" style="padding-left:5px;margin-left:5px;border-left:2px solid rgb(182,182,182);margin-right:0px">
        -----原始邮件-----<br>
<b>发件人:</b><span id="m_-3505429527845685684rc_from">"Xiaoye S. Li" <<a href="mailto:xsli@lbl.gov" target="_blank">xsli@lbl.gov</a>></span><br>
<b>发送时间:</b><span id="m_-3505429527845685684rc_senttime">2022-10-25 05:47:15 (星期二)</span><br>
<b>收件人:</b> "Matthew Knepley" <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>><br>
<b>抄送:</b> "赵刚" <<a href="mailto:zhaog6@lsec.cc.ac.cn" target="_blank">zhaog6@lsec.cc.ac.cn</a>>, <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>主题:</b> Re: [petsc-users] An issue of extraction of factorization matrices in sparse direct solver<br>
<br>
        <div dir="ltr">
                <div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">
                        There are some utility routines for printing L\U in superlu_dist: SRC/dutil_dist.c
                </div>
                <div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">
                        <ol dir="auto" style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif">
                                <li style="margin-left:15px">
                                        You can output the L factor to a file with the triplet format by using<br>
<a href="https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L675" target="_blank">https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L675</a><br>
but use line 755 instead of line 753.
                                </li>
                                <li style="margin-left:15px">
                                        You can convert the L factor to CSR or triplet using <a href="https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L815" target="_blank">https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L815</a><br>
<a href="https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1075" target="_blank">https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1075</a><br>
but need to make sure you only use 1 MPI to call superlu_dist
                                </li>
                                <li style="margin-left:15px">
                                        You can modify<br>
<a href="https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1229" target="_blank">https://github.com/xiaoyeli/superlu_dist/blob/324d65fced6ce8abf0eb900223cba0207d538db7/SRC/dutil_dist.c#L1229</a><br>
to generate CSR/triplet for the U factor as well.
                                </li>
                        </ol>
                </div>
                <div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">
                        <br>
                </div>
                <div style="font-family:verdana,sans-serif;font-size:small;color:rgb(0,0,0)">
                        Sherry Li
                </div>
        </div>
<br>
        <div class="gmail_quote">
                <div dir="ltr" class="gmail_attr">
                        On Sun, Oct 23, 2022 at 3:38 AM Matthew Knepley <<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>> wrote:<br>
                </div>
                <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                        <div dir="ltr">
                                <div dir="ltr">
                                        On Sun, Oct 23, 2022 at 2:58 AM 赵刚 <<a href="mailto:zhaog6@lsec.cc.ac.cn" target="_blank">zhaog6@lsec.cc.ac.cn</a>> wrote:<br>
                                </div>
                                <div class="gmail_quote">
                                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                                Dear developers,<br>
<br>
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.
                                        </blockquote>
                                        <div>
                                                <br>
                                        </div>
                                        <div>
                                                SuperLU stores these matrices in its own format. If you want to do I/O with them, you would probably have to
                                        </div>
                                        <div>
                                                extract them from the Petsc Mat and call SuperLU I/O functions, if they exist.
                                        </div>
                                        <div>
                                                <br>
                                        </div>
                                        <div>
                                                  Thanks,
                                        </div>
                                        <div>
                                                <br>
                                        </div>
                                        <div>
                                                     Matt
                                        </div>
                                        <div>
                                                 
                                        </div>
                                        <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
                                                Best Regards,<br>
Gang
                                        </blockquote>
                                </div>
-- <br>
                                <div dir="ltr">
                                        <div dir="ltr">
                                                <div>
                                                        <div dir="ltr">
                                                                <div>
                                                                        <div dir="ltr">
                                                                                <div>
                                                                                        What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
                                                                                </div>
                                                                                <div>
                                                                                        <br>
                                                                                </div>
                                                                                <div>
                                                                                        <a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br>
                                                                                </div>
                                                                        </div>
                                                                </div>
                                                        </div>
                                                </div>
                                        </div>
                                </div>
                        </div>
                </blockquote>
        </div>
</blockquote></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div><div><br></div><div><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div></div></div>