On Fri, Feb 13, 2009 at 5:29 PM, Shao-Ching Huang <span dir="ltr"><<a href="mailto:schuang@ats.ucla.edu">schuang@ats.ucla.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Barry:<br>
<br>
How do I determine the "shift" value, to be passed into<br>
<br>
Kernel_A_gets_inverse_A_4(MatScalar *a,PetscReal shift)<br>
<br>
?<br>
<br>
I know that my 4x4 matrices are non-singular for sure.</blockquote><div><br>Then you use 0.0;<br><br> Matt<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Thanks.<br>
<br>
Shao-Ching<br>
<br>
<br>
Barry Smith wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
On Feb 13, 2009, at 3:01 PM, Shao-Ching Huang wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi<br>
<br>
I need to invert a bunch of independent, dense 4x4 matrices on each<br>
MPI process. (This is separate from the main computation, a parallel<br>
Ax=b solve.) I am thinking of using LAPACK's DGESV to invert these 4x4<br>
matrices.<br>
<br>
</blockquote>
<br>
You would not want to use LAPACK's solvers for such tiny matrices. LAPACK is optimized<br>
for large dense matrices; the overhead is high for small matrices so that actual performance will<br>
be very slow calling LAPACK.<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
In my code, is it necessary to call LAPACK directly? Or does PETSc<br>
already have a convenient interface to LAPACK?<br>
<br>
</blockquote>
For PETSc's own internal use we have written custom inverters for small matrices (these are used by<br>
the factorization routines for BAIJ matrices). They are called Kernel_A_gets_inverse_A_* where * is the block size.<br>
The prototypes for the functions are in src/inline/ilu.h and the actual source code in files in src/mat/impls/baij/seq/dgef*.c<br>
<br>
Barry<br>
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The size 4x4 may be increased to 8x8 or so later, so I am not trying<br>
to use the closed-form inversion formula.<br>
<br>
Thanks,<br>
<br>
Shao-Ching<br>
</blockquote>
<br>
</blockquote>
</blockquote></div><br><br clear="all"><br>-- <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<br>