<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Hello everyone,</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am trying to use PETSc-MUMPS solver to solve linear problem of type "A x = b " </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I have wrote a subroutine in Fortran 90 for uni-processor. given below.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I am calling this subroutine inside iterative solver. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">This solver is very fast for first few iterations but then becomes slow and if matrix is of large-scale, it becomes very-very slow.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">If somebody can help me to understand, if I am doing something wrong here?</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Thanks you. </div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><div class="gmail_default"><p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(207,135,36)">!!!*************************************************</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(207,135,36)">!!! Subroutine</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo"><span style="color:rgb(53,86,138)">SUBROUTINE</span> PETScMUMPS(ksp,pc,A,x,b,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">#<span style="color:rgb(53,86,138)">include</span> <petsc/finclude/petscsys.h></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">#<span style="color:rgb(53,86,138)">include</span> <petsc/finclude/petscvec.h></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">#<span style="color:rgb(53,86,138)">include</span> <petsc/finclude/petscmat.h></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">#<span style="color:rgb(53,86,138)">include</span> <petsc/finclude/petscksp.h></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">#<span style="color:rgb(53,86,138)">include</span> <petsc/finclude/petscpc.h></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">Vec              x,b</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">Mat              A</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">KSP              ksp</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">PC               pc</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">Mat              F</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">PetscInt         ival,icntl</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">PetscErrorCode   ierr</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPCreate(PETSC_COMM_SELF,ksp,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPSetOperators(ksp,A,A,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPSetType(ksp,KSPPREONLY,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPGetPC(ksp,pc,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(207,135,36)"><span style="color:rgb(0,0,0)">    </span>!call PCSetType(pc,PCLU,ierr)           !! LU Factorization</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> PCSetType(pc,PCCHOLESKY,ierr)     <span style="color:rgb(207,135,36)">!! Cholesky Factorization</span></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> PCFactorSetMatSolverPackage(pc,MATSOLVERMUMPS,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> PCFactorSetUpMatSolverPackage(pc,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> PCFactorGetMatrix(pc,F,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(207,135,36)"><span style="color:rgb(0,0,0)">    </span>!! sequential ordering</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    icntl = <span style="color:rgb(53,86,138)">7</span></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    ival  = <span style="color:rgb(53,86,138)">2</span></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> MatMumpsSetIcntl(F,icntl,ival,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPSetFromOptions(ksp,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPGetPC(ksp,pc,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo">    <span style="color:rgb(53,86,138)">call</span> KSPSolve(ksp,x,b,ierr)</p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;min-height:16px"><br></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(53,86,138)">END<span style="color:rgb(0,0,0)"> </span>SUBROUTINE<span style="color:rgb(0,0,0)"> PETScMUMPS</span></p>
<p style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo;color:rgb(207,135,36)">!!!*************************************************</p><div><br></div><div><br></div></div></div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div><b><font face="verdana, sans-serif">Ajit Desai</font><br></b></div></div><div><b><font face="verdana, sans-serif" size="1">--</font></b></div><div><font face="georgia, serif"><b>  PhD Scholar, Carleton University </b></font></div><div><font face="georgia, serif"><b>  Ottawa, Canada</b></font></div><div><font face="georgia, serif"><b></b></font></div><span style="font-family:verdana,sans-serif"><span style="font-family:'times new roman',serif"></span></span></div></div></div></div></div></div></div></div></div></div></div>
</div>