<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 5, 2014 at 2:31 PM, Evan Um <span dir="ltr"><<a href="mailto:evanum@gmail.com" target="_blank">evanum@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Dear Matt,</div><div><br></div><div>Thanks for your quick reply. I mean avoiding MUMPS's internal back/forward solvers (JOB=3). Does KSPSOLVE() have its own back/forward routines? </div></div></blockquote><div><br></div><div>1) MUMPS stores these in its own format, so code from other packages like PETSc is not useful here</div><div><br></div><div>2) I do not think the MUMPS has the wrong algorithm or implementation. This process is slow in parallel,</div><div> and should be avoided in favor of more scalable methods.</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>Evan </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 12:20 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Dec 5, 2014 at 2:11 PM, Evan Um <span dir="ltr"><<a href="mailto:evanum@gmail.com" target="_blank">evanum@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>Dear PETSC Users,</div><div><br></div><div>I tried to use a Cholesky factor (MUMPS results) as a preconditioner for KSPSolve(). An example code is pasted below. When the code runs, the log file indicates that Job=3 (i.e. backward/forward substitution) of MUMPS is called every time inside the loop. Is there anyway to avoid JOB=3 of MUMPS and use the factor as a pure preconditioner for the CG solver inside KSPSOLVE()? On my cluster, JOB=3 shows unexpected slow performance (see Vol72, Issue 35) and should be avoided. In advance, thanks for </div></div></blockquote><div><br></div></span><div>What do you mean by the above sentence. When you Cholesky factor a matrix A, you get</div><div><br></div><div> A = L^T L</div><div><br></div><div>When you use this factorization as a preconditioner, you modify your original problem to</div><div><br></div><div> (L^T L)^{-1} A x = (L^T L)^{-1} b</div><div><br></div><div>When you use a Krylov method like CG, this means that at every iterate you must apply</div><div>(L^T L){-1} which entails a forward and backward solve.</div><div><br></div><div>If you mean, you only want to apply (L^T L)^{-1} and not run CG, then use -ksp_type preonly</div><div><br></div><div> Matt</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div dir="ltr"><div>your help.</div><div><br></div><div>Regards,</div><div>Evan<br></div><div><br></div><div><br></div><div><div>Code:</div><div>KSPCreate(PETSC_COMM_WORLD, &ksp_fetd_dt);<br>KSPSetOperators(ksp_fetd_dt, A_dt, A_dt);<br>KSPSetType (ksp_fetd_dt, KSPPREONLY);<br>KSPGetPC(ksp_fetd_dt, &pc_fetd_dt);<br>MatSetOption(A_dt, MAT_SPD, PETSC_TRUE);<br>PCSetType(pc_fetd_dt, PCCHOLESKY);<br>PCFactorSetMatSolverPackage(pc_fetd_dt, MATSOLVERMUMPS);<br>PCFactorSetUpMatSolverPackage(pc_fetd_dt);<br>PCFactorGetMatrix(pc_fetd_dt, &F_dt);</div><div>MatMumpsSetIcntl(F_dt, 4, 1); // Turn on MUMPS's log file.<br>KSPSetType(ksp_fetd_dt, KSPCG); <br>KSPSetTolerances(ksp_fetd_dt, 1e-9, 1.0e-50, 1.0e10, ksp_iter);<br></div><div>for (int i=0; i<1000; i++) {<br>// Create a new RHS vector B_dt<br>KSPSolve(ksp_fetd_dt,B_dt,solution); <br>// Output solution time=time2-time1;<br>} </div></div></div>
</blockquote></span></div><span><font color="#888888"><br><br clear="all"><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><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>
</font></span></font></span></div></div>
</blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">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></div>