<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Jul 6, 2018 at 3:16 PM Matthew Overholt <<a href="mailto:overholt@capesim.com">overholt@capesim.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am working on handling very small pivot values for a very small percentage of my matrix (linear Ax = b solution), and I am getting an error that I don't understand when I run the KSPCG solver in parallel.</div><div><br></div><div>KSPCreate(comm, &ksp)</div><div>KSPSetTolerances(ksp, rtol, ...)</div><div>KSPSetType(ksp, KSPCG)</div><div>KSPSetInitialGuessNonzero(ksp, PETSC_TRUE)</div><div>KSPSetFromOptions(ksp)<br></div><div>...</div><div>KSPSetOperators(ksp, V, V)</div><div>...</div><div>KSPSolve(ksp,...)</div><div>KSPGetConvergedReason(ksp, &kspReason)</div><div>if ( kspReason == KSP_DIVERGED_PCSETUP_FAILED ) </div><div> PCGetSetUpFailedReason(pc, &pcReason)</div><div>...</div><div><br></div><div>Default Case (zeropivot is 2.22045E-14):</div><div>mpiexec -n 1 ...</div><div>==> ksp fails due to pcReason = PC_FACTOR_NUMERIC_ZEROPIVOT</div><div><br></div><div>Reduced pivot case, n = 1:</div><div>mpiexec -n 1 ... -pc_factor_zeropivot 1E-15</div><div>==> runs successfully</div><div>
<div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br class="m_-1527266603639551379gmail-Apple-interchange-newline">Reduced pivot case, n > 1:</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">mpiexec -n 2 ... -pc_factor_zeropivot 1E-15</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">==> <span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span>ksp fails due to pcReason = PC_SUBPC_ERROR</span></div></div></div></blockquote><div><br></div><div>Okay, what is likely happening is that your preconditioner is actually Block-Jacobi/LU</div><div>instead of parallel LU. Thus you would need</div><div><br></div><div> -sub_pc_factor_zeropivot 1e-15</div><div><br></div><div>if this is indeed the PC that you want.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">What does this mean?</span></div><div><br></div>If I use the MUMPS solver and either Cholesky or LU preconditioning instead, it runs fine with any number of MPI ranks,</div></div></blockquote><div><br></div><div>Yes, since MUMPS (or SuperLU_dist) is parallel LU.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div> but I'd like to be able to run the CG solver in parallel too.</div></div></blockquote><div><br></div><div>You can use MUMPS as the preconditioner for CG, but that would not make much sense.</div><div><br></div><div> Thanks,</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Thanks in advance,</div><div><br></div><div><div class="m_-1527266603639551379gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">Matt Overholt</span><br></div><div dir="ltr"><div>CapeSym, Inc.</div><div>(508) 653-7100 x204</div><div><a href="mailto:overholt@capesim.com" target="_blank">overholt@capesim.com<br></a></div></div></div></div></div></div></div>
<div dir="ltr"><br></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><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.caam.rice.edu/~mk51/" target="_blank">https://www.cse.buffalo.edu/~knepley/</a><br></div></div></div></div></div></div>