[petsc-users] cholesky factorization Memory regions overlap

Pierre-Yves Aquilanti sperif at gmail.com
Thu Jun 16 04:40:27 CDT 2011


Hello,

i'm using petsc to proceed to the cholesky factorization of a square matrix
using last stable version of PETSc using real scalars. However i am faced to
a memory problem than i am not able to solve depiste spending hours on it.

What i try to do is to proceed to a cholesky factorization using the
preconditionner as it was recommanded on this list instead of using directly
the matrix cholesky factorization. For this i create a KSP context with no
solver, just the preconditionner that is fixed to PCCHOLESKY. When using
KSPSetup, the factorization should occur. However, the program crash saying
that there's a memory overlap.

I checked with valgrind memcheck but didn't found any obvious error on
allocation or deallocation. Also i attached the error and concerned code
below.

If anyone had any idea on what's happening that would be of great help :)

Thanks a lot.

Regards.



Pierre-Yves



[3]PETSC ERROR: --------------------- Error Message
------------------------------------
[3]PETSC ERROR: Arguments are incompatible!
[3]PETSC ERROR: Memory regions overlap: either use PetscMemmov()
              or make sure your copy regions and lengths are correct.
              Length (bytes) -4 first address 178909960 second address
178900956!
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: Petsc Release Version 3.1.0, Patch 8, Thu Mar 17 13:37:48
CDT 2011
[3]PETSC ERROR: See docs/changes/index.html for recent updates.
[3]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[3]PETSC ERROR: See docs/index.html for manual pages.
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: ./hyperh on a linux-c-d named Tripel by perif Thu Jun 16
11:06:23 2011
[3]PETSC ERROR: Libraries linked from
/home/perif/Utils/Libs/petsc-3.1-p8/linux-c-debug-real/lib
[3]PETSC ERROR: Configure run at Tue May 24 14:49:00 2011
[3]PETSC ERROR: Configure options --download-c-blas-lapack=yes
--with-scalar-type=complex --with-fortran=0 --with-debugging=yes
--with-shared=0 --with-petsc-arch=linux-c-debug-real
[3]PETSC ERROR:
------------------------------------------------------------------------
[3]PETSC ERROR: User provided function() line 1755 in
src/mat/utils//home/perif/Utils/Libs/petsc-3.1-p8/include/petscsys.h
[3]PETSC ERROR: PetscFreeSpaceContiguous_Cholesky() line 164 in
src/mat/utils/freespace.c
[3]PETSC ERROR: MatCholeskyFactorSymbolic_SeqAIJ() line 2922 in
src/mat/impls/aij/seq/aijfact.c
[3]PETSC ERROR: MatCholeskyFactorSymbolic() line 2702 in
src/mat/interface/matrix.c
[3]PETSC ERROR: PCSetUp_Cholesky() line 132 in
src/ksp/pc/impls/factor/cholesky/cholesky.c
[3]PETSC ERROR: PCSetUp() line 795 in src/ksp/pc/interface/precon.c
[3]PETSC ERROR: KSPSetUp() line 237 in src/ksp/ksp/interface/itfunc.c
[3]PETSC ERROR: User provided function() line 162 in precond.c




MatCreateSeqAIJ(PETSC_COMM_WORLD,(*nb_eigen_all)+1,(*nb_eigen_all)+1,0,PETSC_NULL,&MM);
    MatSetFromOptions(MM);


        for(j=0;j<=*nb_eigen_all;j++)
             for(i=0;i<j;i++){
                MatSetValue(MM,i,j,(PetscReal)mm_tmp[i][j],INSERT_VALUES);
                MatSetValue(MM,j,i,(PetscReal)mm_tmp[i][j],INSERT_VALUES);
                 PetscPrintf(PETSC_COMM_WORLD,"create %d %d
%e\n",i,j,mm_tmp[i][j]);
            }

        MatAssemblyBegin(MM,MAT_FINAL_ASSEMBLY);
        MatAssemblyEnd(MM,MAT_FINAL_ASSEMBLY);


        ierr=KSPCreate(PETSC_COMM_WORLD,&kspchol);CHKERRQ(ierr);

ierr=KSPSetOperators(kspchol,MM,MM,SAME_NONZERO_PATTERN);CHKERRQ(ierr);
        ierr=KSPSetType(kspchol,KSPPREONLY);CHKERRQ(ierr);
        ierr=KSPSetInitialGuessNonzero(kspchol,PETSC_TRUE);CHKERRQ(ierr);

         ierr=KSPGetPC(kspchol,&chol);CHKERRQ(ierr);
         ierr=PCSetType(chol,PCCHOLESKY);CHKERRQ(ierr);
         ierr=KSPSetUp(kspchol);CHKERRQ(ierr);

         ierr = PCFactorGetMatrix(chol,&fact); CHKERRQ(ierr);

        MatView(fact,PETSC_VIEWER_STDOUT_WORLD);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110616/cb3047ff/attachment.htm>


More information about the petsc-users mailing list