<div dir="ltr"><div dir="ltr">On Wed, Jul 29, 2020 at 6:30 AM Bin Liu <<a href="mailto:lbllm2018@hotmail.com">lbllm2018@hotmail.com</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">
<div lang="EN-SG">
<div class="gmail-m_4035529930107099517WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks for your suggestions. Sure. I will check my codes of MatZeroRows from a small problem. The program does not terminate during solving in distributed memory,
but repeating this error in run time. In fact, this is the entire error message repeating itself during runtime.</span></p></div></div></blockquote><div><br></div><div>Are you not checking the return codes for PETSc calls in your code?</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"><div lang="EN-SG"><div class="gmail-m_4035529930107099517WordSection1"><p class="MsoNormal"><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt"> </span></p>
<p class="MsoNormal"><a name="m_4035529930107099517__MailEndCompose"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></a></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> Matthew Knepley [mailto:<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>]
<br>
<b>Sent:</b> Wednesday, 29 July 2020 5:21 PM<br>
<b>To:</b> Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>><br>
<b>Cc:</b> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>>; <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] solving saddle point problem in distributed memory<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Tue, Jul 28, 2020 at 11:33 PM Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>> wrote:<u></u><u></u></p>
</div>
<div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">Dear Barry,<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">Thanks for your suggestions. I just tested it. I still get the same error. I attached it below:<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: --------------------- Error Message --------------------------------------------------------------
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: Object is in wrong state<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: Matrix is missing diagonal entry in the zeroed row 24214<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: See
<a href="http://www.mcs.anl.gov/petsc/documentation/faq.html" target="_blank">http://www.mcs.anl.gov/petsc/documentation/faq.html</a> for trouble shooting.<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: Petsc Release Version 3.9.1, Apr, 29, 2018
<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: ./re100 on a named kdp-MS-7850 by kdp Wed Jul 29 11:26:57 2020<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: Configure options --prefix=/home/kdp/petsc --debugging=0 --with-mpi-dir=/home/kdp/mpich --download-fblaslapack --download-metis --download-parmetis --download-hypre=/home/kdp/hypre-2.14.0.tar.gz
--download-superlu_dist<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: #1 MatZeroRows_SeqAIJ() line 1819 in /home/kdp/petsc-3.9.1/src/mat/impls/aij/seq/aij.c<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: #2 MatZeroRows() line 5710 in /home/kdp/petsc-3.9.1/src/mat/interface/matrix.c<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: #3 MatZeroRows_MPIAIJ() line 797 in /home/kdp/petsc-3.9.1/src/mat/impls/aij/mpi/mpiaij.c<u></u><u></u></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">[1]PETSC ERROR: #4 MatZeroRows() line 5710 in /home/kdp/petsc-3.9.1/src/mat/interface/matrix.c<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black"><br>
It still report missing diagonal entry. However I have epxlicitly assign 0.0 to the diagonal element of the system matrix and solve it in sequential mode without error. Where could possibly my wrong set up be? <u></u><u></u></span></p>
</div>
</div>
</blockquote>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">1) Please send the complete error message. The stack trace here is cut off.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">2) It does not look like it is failing in the solver, but in the call to MatZeroRows(), which as it says, requires diagonal elements<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">3) It looks like you are not assembling the matrix correctly in parallel<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I recommend making as small a problem as possible, running on 1 and 2 processes, and printing out the matrix using -mat_view to compare them entry-by-entry.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Thanks,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> Matt<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black">Best<u></u><u></u></span></p>
</div>
<div>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="gmail-m_4035529930107099517gmail-m_-8610359906417740984divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"> Barry Smith <<a href="mailto:bsmith@petsc.dev" target="_blank">bsmith@petsc.dev</a>><br>
<b>Sent:</b> Wednesday, July 29, 2020 10:49 AM<br>
<b>To:</b> Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a> <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
<b>Subject:</b> Re: [petsc-users] solving saddle point problem in distributed memory</span>
<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal"> No, PETSc direct solvers do not work in parallel. Only SuperLU_DIST, MUMPS, and PasTix.
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> -pc_type lu (or cholesky depending on the package) -pc_factor_mat_solver_type superlu_dist or mumps or pastix <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> to run the direct solver in parallel. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><br>
<br>
<u></u><u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p class="MsoNormal">On Jul 28, 2020, at 9:01 PM, Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>> wrote:<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Dear Barry,</span><u></u><u></u></p>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></p>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks for your explanation. Does it mean the default director solver LU in PETSc can also run in the distributed memory mode? I only used
iterative solvers with preconditioners in distributed memory before. My experience in using director solver in parallel is indeed limited, especially the saddle point problem in parallel. I have done some search online, but I did not find a working set up
at this moment. Could you give a sample setup of the direct solver for parallel run? It is really appreciated.
</span><u></u><u></u></p>
<p style="margin:0cm 0cm 0.0001pt"><a name="m_4035529930107099517_m_-8610359906417740984_x__MailEndCompose"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span></a><u></u><u></u></p>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p style="margin:0cm 0cm 0.0001pt"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> Barry Smith [<a href="mailto:bsmith@petsc.dev" target="_blank">mailto:bsmith@petsc.dev</a>]
<br>
<b>Sent:</b> Wednesday, 29 July 2020 9:48 AM<br>
<b>To:</b> Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a><br>
<b>Subject:</b> Re: [petsc-users] solving saddle point problem in distributed memory</span><u></u><u></u></p>
</div>
</div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
<p style="margin:0cm 0cm 0.0001pt"> SuperLU_DIST won't "magically" run on saddle point problems. It only does limited pivoting, realistically a parallel LU cannot always do complete pivoting or it becomes a sequential algorithm. For parallel you
need to use PCFIELDSPLIT, for sequential you can use SuperLU (not SuperLU_DIST) since it can do more pivoting, being a sequential algorithm.<u></u><u></u></p>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> Barry<u></u><u></u></p>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
<div>
<div>
<p style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
<u></u> <u></u></p>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<p style="margin:0cm 0cm 0.0001pt">On Jul 28, 2020, at 7:59 PM, Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank">lbllm2018@hotmail.com</a>> wrote:<u></u><u></u></p>
</div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Thanks for your tutorials. Yes. I tried PCFIELDSPLIT. However, it only works for sequential runs. When I run the code in distributed memory,
it reports errors. In fact, the essence of my wonder is (a) how to set up superlu_dist in petsc for solving saddle point problem in distributed memory? (b) does the direct solvers in petsc can run in distributed memory for solving saddle point problem?</span><u></u><u></u></p>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span><u></u><u></u></p>
</div>
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<div>
<p style="margin:0cm 0cm 0.0001pt"><b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span lang="EN-US" style="font-size:11pt;font-family:Calibri,sans-serif"> Stefano Zampini [<a href="mailto:stefano.zampini@gmail.com" target="_blank"><span style="color:purple">mailto:stefano.zampini@gmail.com</span></a>] <br>
<b>Sent:</b> Tuesday, 28 July 2020 6:55 PM<br>
<b>To:</b> Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank"><span style="color:purple">lbllm2018@hotmail.com</span></a>><br>
<b>Cc:</b> <a href="mailto:petsc-users@mcs.anl.gov" target="_blank"><span style="color:purple">petsc-users@mcs.anl.gov</span></a><br>
<b>Subject:</b> Re: [petsc-users] solving saddle point problem in distributed memory</span><u></u><u></u></p>
</div>
</div>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt">If you want advice you should post the error trace PETSc reports.<u></u><u></u></p>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt">Anyway, solving Stokes is not so trivial (without direct solvers, you may need mesh dependent information), but we have examples for it<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><a href="https://gitlab.com/petsc/petsc/-/blob/master/src/ksp/ksp/tutorials/ex42.c" target="_blank"><span style="color:purple">https://gitlab.com/petsc/petsc/-/blob/master/src/ksp/ksp/tutorials/ex42.c</span></a><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><a href="https://gitlab.com/petsc/petsc/-/blob/master/src/ksp/ksp/tutorials/ex43.c" target="_blank"><span style="color:purple">https://gitlab.com/petsc/petsc/-/blob/master/src/ksp/ksp/tutorials/ex43.c</span></a><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><a href="https://gitlab.com/petsc/petsc/-/blob/master/src/snes/tutorials/ex69.c" target="_blank"><span style="color:purple">https://gitlab.com/petsc/petsc/-/blob/master/src/snes/tutorials/ex69.c</span></a><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt">If you scroll to the end of those files, you see a bunch of possible options either using PCFIELDSPLIT, PCBDDC or KSPFETIDP.<u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
<div>
<div>
<p style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
<br>
<br>
<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt">On Jul 28, 2020, at 12:37 PM, Bin Liu <<a href="mailto:lbllm2018@hotmail.com" target="_blank"><span style="color:purple">lbllm2018@hotmail.com</span></a>> wrote:<u></u><u></u></p>
</div>
</div>
<div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
<div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-family:Calibri,sans-serif">I would like to solve a saddle point problem arising from the stokes equation. I got successful to use the direct solvers in sequential runs. However, I would like to
extend it for distributed memory computation. I tried to use superlu_dist, but the program returns errors. Is it possible to solve a saddle point problem in distributed memory using superlu_dist? Could anyone give a simple sample code to set up the parameters
of the solver?</span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-family:Calibri,sans-serif"> </span><u></u><u></u></p>
</div>
</div>
<div>
<div>
<p style="margin:0cm 0cm 0.0001pt"><span style="font-family:Calibri,sans-serif">Thanks</span><u></u><u></u></p>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<p style="margin:0cm 0cm 0.0001pt"> <u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><a href="http://www.cse.buffalo.edu/~knepley/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</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>