<div dir="ltr">Thanks,<div><br></div><div>Got it.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 11, 2014 at 9:09 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Dec 11, 2014, at 9:54 PM, Fande Kong <<a href="mailto:fdkong.jd@gmail.com">fdkong.jd@gmail.com</a>> wrote:<br>
><br>
> Hi Barry,<br>
><br>
> Thanks.<br>
><br>
> I know how to solve a dense linear system in the petsc, but I was wondering how to call a Lapack routine in the petsc.<br>
<br>
</span> You asked how to call a lapack routine to solve a dense linear system. That is exactly what I told you. For seqdense matrices PETSc lu solvers directly call the LAPACK routines to do the factorization and the solves.<br>
<br>
Sure it is possible to call LAPACK routines directly to solve a sequential dense linear system but there is no reason to do that since PETSc does it for you. For dense matrices of dimension 10 or larger the overhead of calling through PETSc is negligible so there is no good reason to call lapack directly.<br>
<span class="HOEnZb"><font color="#888888"><br>
Barry<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
><br>
> On Thu, Dec 11, 2014 at 8:47 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> > On Dec 11, 2014, at 9:33 PM, Fande Kong <<a href="mailto:fdkong.jd@gmail.com">fdkong.jd@gmail.com</a>> wrote:<br>
> ><br>
> > Hi all,<br>
> ><br>
> > How to call a Lapack routine to solve a dense linear system? Any simple example?<br>
><br>
> Create the Mat with MatCreateSeqDense() then create the usual KSP and use for the solver options -pc_type lu -ksp_type preonly<br>
><br>
> See src/ksp/ksp/examples/tutorials/ex30.c<br>
><br>
><br>
> Barry<br>
><br>
> ><br>
> > Thanks,<br>
> ><br>
><br>
<br>
</div></div></blockquote></div></div>