<div dir="ltr"><div dir="ltr">On Thu, Nov 7, 2019 at 6:44 AM s.a.hack--- via petsc-users <<a href="mailto:petsc-users@mcs.anl.gov">petsc-users@mcs.anl.gov</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-US">
<div class="gmail-m_-4168561239961001849WordSection1">
<p class="MsoNormal"><span style="color:black">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">I am doing calculations with version 3.12.0 of PETSc.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Using the finite-element method, I solve the Maxwell equations on the interior of a 3D domain, coupled with boundary condition auxiliary equations on the boundary of the domain. The auxiliary equations employ auxiliary
 variables g.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">For ease of implementation of element matrix assembly, the auxiliary variables g are defined on the entire domain. However, only the basis functions for g with nonzero value at the boundary give nonzero entries
 in the system matrix.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">The element matrices hence have the structure<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">[ A B; C D]<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">at the boundary.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">In the interior the element matrices have the structure<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">[A 0; 0 0].<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">The degrees of freedom in the system matrix can be ordered by element [u_e1 g_e1 u_e2 g_e2 …] or by parallel process [u_p1 g_p1 u_p2 g_p2 …].<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">To solve the system matrix, I need to filter out zero rows and columns:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">error = MatFindNonzeroRows(stiffnessMatrix, &nonzeroRows);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">CHKERRABORT(PETSC_COMM_WORLD, error);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">error = MatCreateSubMatrix(stiffnessMatrix, nonzeroRows, nonzeroRows, MAT_INITIAL_MATRIX, &stiffnessMatrixSubMatrix);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">CHKERRABORT(PETSC_COMM_WORLD, error);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">I solve the system matrix in parallel on multiple nodes connected with InfiniBand.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">The problem is that the MUMPS solver frequently (nondeterministically) hangs during KSPSolve() (after KSPSetUp() is completed).<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Running with the options -ksp_view and -info the last printed statement is:<u></u><u></u></span></p>
<p class="gmail-m_-4168561239961001849p1"><span class="gmail-m_-4168561239961001849s1">[0] VecScatterCreate_SF(): Using StarForest for vector scatter</span></p></div></div></blockquote><div>There is a bug in some older MPI implementations. You can try using</div><div><br></div><div>  -vec_assembly_legacy -matstash_legacy<br></div><div><br></div><div>to see if you avoid the bug.</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-US"><div class="gmail-m_-4168561239961001849WordSection1"><p class="gmail-m_-4168561239961001849p1"><u></u><u></u></p>
<p class="MsoNormal"><span style="color:black">In the calculations where the program does not hang, the calculated solution is correct. <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="color:black">The problem doesn’t occur for calculations on a single node, or for calculations with the SuperLU solver (but SuperLU will not allow calculations that are as large).</span></p></div></div></blockquote><div><br></div><div>SuperLU_dist can do large problems. Use --download-superlu_dist</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-US"><div class="gmail-m_-4168561239961001849WordSection1"><p class="MsoNormal"><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">The problem also doesn’t seem to occur for small problems.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">The problem doesn’t occur either when I put ones on the diagonal, but this is computationally expensive:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">error = MatFindZeroRows(stiffnessMatrix, &zeroRows);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">CHKERRABORT(PETSC_COMM_WORLD, error);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">error = MatZeroRowsColumnsIS(stiffnessMatrix, zeroRows, diagEntry, PETSC_IGNORE, PETSC_IGNORE);<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">CHKERRABORT(PETSC_COMM_WORLD, error);</span></p></div></div></blockquote><div><br></div><div>The two function calls above are expensive? I can you run it with -log_view and send the timing?</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"><div lang="EN-US"><div class="gmail-m_-4168561239961001849WordSection1"><p class="MsoNormal"><span style="color:black"> </span></p>
<p class="MsoNormal"><span style="color:black">Would you have any ideas on what I could check?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black"> <u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Best regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:black">Sjoerd<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt"><u></u> <u></u></span></p>
</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>