<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">David :</div><div class="gmail_quote">This is a bug in PETSc. A change </div><div class="gmail_quote"><div class="gmail_quote">$ git diff ../../../pc/impls/factor/cholesky/cholesky.c</div><div class="gmail_quote">diff --git a/src/ksp/pc/impls/factor/cholesky/cholesky.c b/src/ksp/pc/impls/factor/cholesky/cholesky.c</div><div class="gmail_quote">index 953d551..cc28369 100644</div><div class="gmail_quote">--- a/src/ksp/pc/impls/factor/cholesky/cholesky.c</div><div class="gmail_quote">+++ b/src/ksp/pc/impls/factor/cholesky/cholesky.c</div><div class="gmail_quote">@@ -141,9 +141,7 @@ static PetscErrorCode PCSetUp_Cholesky(PC pc)</div><div class="gmail_quote"><br></div><div class="gmail_quote">     ierr = MatCholeskyFactorNumeric(((PC_Factor*)dir)->fact,pc->pmat,&((PC_Factor*)dir)->info);CHKERRQ(ierr);</div><div class="gmail_quote">     ierr = MatFactorGetError(((PC_Factor*)dir)->fact,&err);CHKERRQ(ierr);</div><div class="gmail_quote">-    if (err) { /* FactorNumeric() fails */</div><div class="gmail_quote">-      pc->failedreason = (PCFailedReason)err;</div><div class="gmail_quote">-    }</div><div class="gmail_quote">+    pc->failedreason = (PCFailedReason)err;</div><div class="gmail_quote">   }</div><div class="gmail_quote"><br></div><div class="gmail_quote">fixed the problem. I'll fix this problem in petsc-release, including other routines. </div><div class="gmail_quote">Thanks for reporting the bug and sending matrix.dat. Let us know whenever you encounter problem using PETSc.</div><div class="gmail_quote"><br></div><div class="gmail_quote">Hong</div><div class="gmail_quote"><br></div></div><div class="gmail_quote"><br><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 class="gmail_extra"><div class="gmail_quote"><span class="gmail-">On Mon, Sep 19, 2016 at 11:04 PM, Hong <span dir="ltr"><<a href="mailto:hzhang@mcs.anl.gov" target="_blank">hzhang@mcs.anl.gov</a>></span> wrote:<br><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 class="gmail_extra"><div class="gmail_quote">David :</div><div class="gmail_quote">I did following:</div><div class="gmail_quote"><div class="gmail_quote">  </div><div class="gmail_quote">        PC  pc;</div><div class="gmail_quote">        Mat F;</div><div class="gmail_quote">        ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr<wbr>);</div><div class="gmail_quote">        ierr = PCReset(pc);CHKERRQ(ierr);</div><div class="gmail_quote">        ierr = KSPSetOperators(ksp,A,A);CHKER<wbr>RQ(ierr);</div><div class="gmail_quote">        ierr = PCSetType(pc,PCCHOLESKY);CHKER<wbr>RQ(ierr);</div><div class="gmail_quote">        </div><div class="gmail_quote">        ierr = PCFactorSetMatSolverPackage(pc<wbr>,MATSOLVERMUMPS);CHKERRQ(ierr)<wbr>;</div><div class="gmail_quote">        ierr = PCFactorSetUpMatSolverPackage(<wbr>pc);CHKERRQ(ierr); </div><div class="gmail_quote">        ierr = PCFactorGetMatrix(pc,&F);CHKER<wbr>RQ(ierr);</div><div class="gmail_quote">        ierr = MatMumpsSetIcntl(F,14,30);CHKE<wbr>RRQ(ierr);</div><div class="gmail_quote"><br></div><div class="gmail_quote">        ierr = KSPSolve(ksp,b,x);CHKERRQ(ierr<wbr>);</div><div class="gmail_quote"><br></div><div class="gmail_quote">Then it resolves the matrix equation with ICNTL(14)=30. </div><div class="gmail_quote">Attached is modified petsc/src/ksp/ksp/exa<wbr>mples/tutorials/ex10.c.</div><div class="gmail_quote">Using in with your matrix.dat, I get</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div class="gmail_quote">mpiexec -n 4 ./ex10 -f0 matrix.dat -rhs 0 -ksp_reason</div><div class="gmail_quote">Number of iterations =   0</div><div class="gmail_quote">KSPConvergedReason: -11</div><div class="gmail_quote"> Reset PC with ICNTL(14)=30 ...</div><div class="gmail_quote">KSPConvergedReason: 2</div></div></div></div></div></blockquote><div><br></div></span><div>Hong,</div><div><br></div><div>Thanks very much for your test code. I get the same output as you when I run "mpiexec -n 4 ./ex10 -f0 matrix.dat -rhs 0 -ksp_reason".</div><div><br></div><div>However, I used KSPPREONLY in my original test code, and if I add KSPSetType(ksp,KSPPREONLY) in your modified exc10.c after the line KSPCreate(PETSC_COMM_WORLD,&<wbr>ksp) then I get the following output:</div><div><br></div><div><div>mpiexec -np 4 ./mumps_test-opt -f0 matrix.dat -rhs 0 -ksp_reason</div><span class="gmail-"><div>Number of iterations =   0</div><div>KSPConvergedReason: -11</div><div> Reset PC with ICNTL(14)=30 ...</div></span><div>KSPConvergedReason: -11</div></div><div><br></div><div>So it seems like the icntl data is not being updated when we use PREONLY. Do you know how to fix this?</div><div><br></div><div>Thanks,<br>David</div><div><br></div><div><br></div></div></div></div>
</blockquote></div><br></div></div>