<div dir="ltr">Hi, hong<br><br>Thanks very much!<br><br>Best Regards,<br><br><div class="gmail_quote">On Fri, Aug 15, 2008 at 10:28 PM, Hong Zhang <span dir="ltr">&lt;<a href="mailto:hzhang@mcs.anl.gov">hzhang@mcs.anl.gov</a>&gt;</span> 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>
Shengyong,<div class="Ih2E3d"><br>
<br>
On Fri, 15 Aug 2008, berry wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">
Hi,<br>
<br>
I am totally a newbie to petsc. Previously I use laspack library for my<br>
linear solver. Now I decide to transfer to Petsc for our simulation code.<br>
<br>
I have a huge sparse matrix with 3million*3million with 21 million no zero<br>
elements. &nbsp;The matrix is symmetric, so the non zero element of upper<br>
triangular matrix<br>
is only 12 million. &nbsp;And matrix format is Yale Space Matrix format. However,<br>
I have not seen any indicative parmater for matrix symmetry property in<br>
MatCreateSeqAIJWithArrays() function. &nbsp;The manual says:<br>
<br>
<br>
PetscErrorCode PETSCMAT_DLLEXPORT MatCreateSeqAIJWithArrays(MPI_Comm<br>
comm,PetscInt m,PetscInt n,PetscInt* i,PetscInt*j,PetscScalar *a,Mat<br>
*mat)<br>
<br></div>
&lt;<a href="http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/MPI_Comm.html#MPI_Comm" target="_blank">http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/MPI_Comm.html#MPI_Comm</a>&gt;<br>

<br>
Input Parameters<br>
*comm&lt;<a href="http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/comm.html#comm" target="_blank">http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/comm.html#comm</a>&gt;<div class="Ih2E3d">
<br>
*- must be an MPI communicator of<br></div>
size&lt;<a href="http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/size.html#size" target="_blank">http://www-unix.mcs.anl.gov/petsc/petsc-2/snapshots/petsc-current/docs/manualpages/Sys/size.html#size</a>&gt;1<div class="Ih2E3d">
<br>
*m *- number of rows<br>
*n *- number of columns<br>
*i *- row indices<br>
*j *<br>
<br>
*a *<br>
<br>
<br>
Can petsc exploit any symmetric proptery of a given matrix? &nbsp;How could I Set<br>
it to be symmetry one ?<br>
</div></blockquote>
<br>
You can use MATSBAIJ matrix format<br>
(see <a href="http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MATSBAIJ.html" target="_blank">http://www-unix.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-current/docs/manualpages/Mat/MATSBAIJ.html</a>)<br>

<br>
Using MATSBAIJ saves half of storage space for original sparse matrix.<br>
However,<br>
it is not as efficient as MATAIJ for some matrix operations, e.g.,<br>
MatMult(), due to non-contiguous data access and additional communication overhead.<br><font color="#888888">
<br>
Hong</font><div><div></div><div class="Wj3C7c"><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Best Regards,<br>
<br>
<br>
<br>
<br>
-- <br>
Pang Shengyong<br>
Solidification Simulation Lab,<br>
State Key Lab of Mould &amp; Die Technology,<br>
Huazhong Univ. of Sci. &amp; Tech. China<br>
<br>
</blockquote>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Pang Shengyong<br>Solidification &nbsp;Simulation Lab, <br>State Key Lab of &nbsp;Mould &amp; Die Technology,<br>Huazhong Univ. of Sci. &amp; Tech. China<br>
</div>