<div dir="ltr">I am trying to use Julia to call Petsc. <br>1) First, I run the built-in example ex2.c <div><div><a href="https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/pc/examples/tutorials/ex2.c.html">https://www.mcs.anl.gov/petsc/petsc-current/src/ksp/pc/examples/tutorials/ex2.c.html</a>  <br></div><div>For this case,  I tried KSPGMRES , initial zero solution and different PC (LU, ILU, ICC, JACOBI). And they work as expected. </div><div><br></div><div> 75: KSPSetType(ksp,KSPGMRES);</div><div> 76: KSPSetInitialGuessNonzero(ksp,PETSC_FALSE); </div><div> 87: KSPGetPC(ksp,&pc); </div><div> 88: PCSetType(pc,PCICC);<div><br></div><div>2) Second, I tried to call KSP from Julia using the same matrix and right hand side as ex2.c . A wrapper has been written to call Petsc code from Julia. After I transfer matrix to from Julia to Petsc, I checked the matrix and preconditioner matrix in the context of Petsc. These two matrices are right. For no preconditioner,Jacobi precontioner and LU, the residual for Julia version is same as that of original Petsc one for every iteration. However, for ILU preconditioner, the residual for Julia is alwaysthe same as the LU one. This is not expected. For both Julia and original Petsc version, I checked the PC type inside the subroutine PCSetType and the types are correct, namely ilu.I am trying to dig into the source code to check how the preconditioner is interacting with GMRES. </div><div><br></div><div>Where is the subroutine for the GMRES solver, namely,</div><div> ierr=(*KSP->ops->solve)(ksp);</div><div><br></div><div>Or do you have any suggestions?<div><br></div><div>Thanks,</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Xiaodong Liu, PhD<br>X: Computational Physics Division<br>Los Alamos National Laboratory<br>P.O. Box 1663, <br>Los Alamos, NM 87544<br>505-709-0534<br></div></div></div></div></div></div></div></div></div>