<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sat, Feb 1, 2014 at 12:04 PM, asma haouech <span dir="ltr"><<a href="mailto:asma_i4@hotmail.fr" target="_blank">asma_i4@hotmail.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr"><p><span style="color:rgb(17,17,17);font-family:'Abyssinica SIL';font-size:12pt"> </span><span style="color:rgb(17,17,17);font-family:'Abyssinica SIL';font-size:12pt">Dear all,</span></p>
<p><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:'Arial;Liberation Sans;DejaVu Sa',serif"></span></p></div></div></blockquote><div><br></div><div>For any solver question, you need to send the output of -ksp_view for all runs</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><div dir="ltr"><p><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:'Arial;Liberation Sans;DejaVu Sa',serif">I am new in PETSC. </span><span lang="EN-US">I am trying to test the impact of matrix ordering on the time needed for
solving linear systems. It is known that ordering matrix reduces the fill-in so
solving time decreases also. I use direct package solver 'superLU' and I tested
different orderings but I’ve always found very close execution time values. Here
is the code:</span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr=
KSPCreate(PETSC_COMM_WORLD,&ksp);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr= KSPSetOperators(ksp,A,A,DIFFERENT_NONZERO_PATTERN);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr=
KSPSetType(ksp,KSPPREONLY);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr=
KSPGetPC(ksp,&pc);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr= PCSetType(pc,PCLU);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr=
PCFactorSetMatSolverPackage(pc,MATSOLVERSUPERLU);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr=
PCFactorSetUpMatSolverPackage(pc);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr =
MatGetOrdering(A,MATORDERINGRCM,&perm,&cperm);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr =
MatGetFactor(A,MATSOLVERSUPERLU,MAT_FACTOR_LU,&F);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr =
MatLUFactorSymbolic(F,A,perm,cperm,<a name="143ee9fd78c22691___DdeLink__5_2013988178">PETSC_NULL</a>);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr =
MatLUFactorNumeric(F,A,PETSC_NULL);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr =
PCFactorGetMatrix(pc,&F);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">ierr= KSPSolve(ksp,b,x);CHKERRQ(ierr);<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">I execute the program with this
options : -mat_superlu_colperm NATURAL
-mat_superlu_rowperm NOROWPERM. <u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111">Please tell me what is the problem in my
code.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:"Abyssinica SIL";color:#111111"> </span></p>
<p style="margin-bottom:14.15pt;line-height:14.25pt"><span style="font-family:"Abyssinica SIL";color:#111111">Kind Regards,<u></u><u></u></span></p>
<p style="margin-bottom:14.15pt;line-height:14.25pt"><span style="font-family:"Abyssinica SIL";color:#111111">Asma.<u></u><u></u></span></p> </div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>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>