[petsc-dev] PaStiX solution
Alexander Grayver
agrayver at gfz-potsdam.de
Wed Dec 28 09:10:31 CST 2011
So if I understood it right, I put diff you gave in file pastix_patch in
petsc-dev dir and called:
lib/petsc-dev> patch -Np1 < pastix_patch
And built petsc again. Now
lib/petsc-dev> hg diff src/mat/impls/aij/mpi/pastix/pastix.c
diff -r 3286696bb4a0 src/mat/impls/aij/mpi/pastix/pastix.c
--- a/src/mat/impls/aij/mpi/pastix/pastix.c Tue Dec 27 11:43:50 2011
-0600
+++ b/src/mat/impls/aij/mpi/pastix/pastix.c Wed Dec 28 16:05:21 2011
+0100
@@ -446,16 +446,6 @@
ierr = PetscMalloc((lu->n)*sizeof(PetscInt)
,&(lu->invp));CHKERRQ(ierr);
}
- if (isSym) {
- /* On symmetric matrix, LLT */
- lu->iparm[IPARM_SYM] = API_SYM_YES;
- lu->iparm[IPARM_FACTORIZATION] = API_FACT_LDLT;
- } else {
- /* On unsymmetric matrix, LU */
- lu->iparm[IPARM_SYM] = API_SYM_NO;
- lu->iparm[IPARM_FACTORIZATION] = API_FACT_LU;
- }
-
/*----------------*/
if (lu->matstruc == DIFFERENT_NONZERO_PATTERN){
if (!(isSeqAIJ || isSeqSBAIJ)) {
@@ -529,7 +519,7 @@
PetscFunctionBegin;
lu->iparm[IPARM_FACTORIZATION] = API_FACT_LU;
- lu->iparm[IPARM_SYM] = API_SYM_YES;
+ lu->iparm[IPARM_SYM] = API_SYM_NO;
lu->matstruc = DIFFERENT_NONZERO_PATTERN;
F->ops->lufactornumeric = MatFactorNumeric_PaStiX;
PetscFunctionReturn(0);
@@ -545,7 +535,7 @@
PetscFunctionBegin;
lu->iparm[IPARM_FACTORIZATION] = API_FACT_LLT;
- lu->iparm[IPARM_SYM] = API_SYM_NO;
+ lu->iparm[IPARM_SYM] = API_SYM_YES;
lu->matstruc = DIFFERENT_NONZERO_PATTERN;
(F)->ops->choleskyfactornumeric = MatFactorNumeric_PaStiX;
PetscFunctionReturn(0);
So I guess it's patched correctly?
Because I don't see much difference in output. Please find it attached.
Did I make something wrong?
Regards,
Alexander
On 28.12.2011 15:26, Jed Brown wrote:
> On Wed, Dec 28, 2011 at 08:11, Alexander Grayver
> <agrayver at gfz-potsdam.de <mailto:agrayver at gfz-potsdam.de>> wrote:
>
> I tried LU, the result is the same (attached). The matrix is
> recognized as a symmetric, even though I put in the code:
> ierr = MatSetOption(A,MAT_SYMMETRIC,PETSC_FALSE);
> ierr = MatSetOption(A,MAT_SPD,PETSC_FALSE);
>
> Seems like internal check?
> I checked positive-definiteness of the matrix in matlab (using
> [L,p,s] = chol(A); test) and it's not SPD.
> So it seems like PaStiX is not very robust. This case is not one
> inch close to the bad cases I used MUMPS with.
>
>
> Just for kicks, can you try making the change below and re-running
> your tests with LU? This is code that the PaStiX developers sent, but
> it doesn't make sense to me as written.
>
> $ hg diff src/mat/impls/aij/mpi/pastix/pastix.c
> --- a/src/mat/impls/aij/mpi/pastix/pastix.c
> +++ b/src/mat/impls/aij/mpi/pastix/pastix.c
> @@ -446,16 +446,6 @@
> ierr = PetscMalloc((lu->n)*sizeof(PetscInt)
> ,&(lu->invp));CHKERRQ(ierr);
> }
> - if (isSym) {
> - /* On symmetric matrix, LLT */
> - lu->iparm[IPARM_SYM] = API_SYM_YES;
> - lu->iparm[IPARM_FACTORIZATION] = API_FACT_LDLT;
> - } else {
> - /* On unsymmetric matrix, LU */
> - lu->iparm[IPARM_SYM] = API_SYM_NO;
> - lu->iparm[IPARM_FACTORIZATION] = API_FACT_LU;
> - }
> -
> /*----------------*/
> if (lu->matstruc == DIFFERENT_NONZERO_PATTERN){
> if (!(isSeqAIJ || isSeqSBAIJ)) {
> @@ -529,7 +519,7 @@
> PetscFunctionBegin;
> lu->iparm[IPARM_FACTORIZATION] = API_FACT_LU;
> - lu->iparm[IPARM_SYM] = API_SYM_YES;
> + lu->iparm[IPARM_SYM] = API_SYM_NO;
> lu->matstruc = DIFFERENT_NONZERO_PATTERN;
> F->ops->lufactornumeric = MatFactorNumeric_PaStiX;
> PetscFunctionReturn(0);
> @@ -545,7 +535,7 @@
> PetscFunctionBegin;
> lu->iparm[IPARM_FACTORIZATION] = API_FACT_LLT;
> - lu->iparm[IPARM_SYM] = API_SYM_NO;
> + lu->iparm[IPARM_SYM] = API_SYM_YES;
> lu->matstruc = DIFFERENT_NONZERO_PATTERN;
> (F)->ops->choleskyfactornumeric = MatFactorNumeric_PaStiX;
> PetscFunctionReturn(0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111228/1ebb53dd/attachment.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test.txt
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111228/1ebb53dd/attachment.txt>
More information about the petsc-dev
mailing list