[petsc-users] Questions on setting value through VecGetArrayF90

Danyang Su danyang.su at gmail.com
Tue Aug 13 13:01:28 CDT 2013


Hi All,

I have the following codes, it can be compiled but it always throw out 
error when running. I also tried the example ex44f.F90, it although 
throw out similar error.

                 call 
DMDAGetInfo(da,PETSC_NULL_INTEGER,mx,PETSC_NULL_INTEGER,     &
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER, &
                   PETSC_NULL_INTEGER,ierr)
                 call 
DMDAGetCorners(da,xs,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,  &
                   xm,PETSC_NULL_INTEGER,PETSC_NULL_INTEGER,ierr)
                 call VecGetArrayF90(b,vecpointer,ierr)
                 do i = xs, xs+xm-1
*vecpointer(i)=b_in(i+1)     !!!Error here*
                 end do
                 call VecRestoreArrayF90(b,vecpointer,ierr)

*The compiler information are:*

$ make ksp_inhm_d
/cygdrive/c/cygwin/packages/petsc-3.4.2/bin/win32fe/win32fe ifort -c  
-MT -Z7 -fpp  -I/cygdrive/c/cygwin/packages/petsc-
3.4.2/include 
-I/cygdrive/c/cygwin/packages/petsc-3.4.2/arch-mswin-c-debug/include 
-I/cygdrive/c/cygwin/packages/parmeti
s-4.0.3/include -I/cygdrive/c/cygwin/packages/metis-5.1.0/include 
-I/cygdrive/c/Program\ Files/MPICH2/include    -o ksp_
inhm.o ksp_inhm.F90
/cygdrive/c/cygwin/packages/petsc-3.4.2/bin/win32fe/win32fe cl -MT 
-wd4996 -Z7  -o ksp_inhm_d ksp_inhm.o  -L/cygdrive/c/
cygwin/packages/petsc-3.4.2/arch-mswin-c-debug/lib  -lpetsc -lflapack 
-lfblas /cygdrive/c/cygwin/packages/parmetis-4.0.3
/build/libparmetis/Release/parmetis.lib 
/cygdrive/c/cygwin/packages/metis-5.1.0/build/libmetis/Release/metis.lib 
/cygdri
ve/c/Program\ Files/MPICH2/lib/fmpich2.lib /cygdrive/c/Program\ 
Files/MPICH2/lib/fmpich2g.lib /cygdrive/c/Program\ Files
/MPICH2/lib/mpi.lib Gdi32.lib User32.lib Advapi32.lib Kernel32.lib 
Ws2_32.lib
/usr/bin/rm -f ksp_inhm.o ksp_inhm.mod

*And the error information are:*
[1]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_MPI() line 
20 in src/vec/vec/impls/mpi/C:\cygwin\packages\PE
TSC-~1.2\src\vec\vec\impls\mpi\pdvec.c
[1]PETSC ERROR: Block [id=0(4048)] at address 000000000279DBE0 is 
corrupted (probably write past end of array)
[1]PETSC ERROR: Block allocated in VecCreate_MPI_Private() line 197 in 
src/vec/vec/impls/mpi/C:\cygwin\packages\PETSC-~1
.2\src\vec\vec\impls\mpi\pbvec.c
[1]PETSC ERROR: --------------------- Error Message 
------------------------------------
[1]PETSC ERROR: Memory corruption!
[1]PETSC ERROR: Corrupted memory!
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: Petsc Release Version 3.4.2, Jul, 02, 2013
[1]PETSC ERROR: See docs/changes/index.html for recent updates.
[1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[1]PETSC ERROR: See docs/index.html for manual pages.
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: 
D:\dsu\ResearchAtUBC\Dropbox\ParallelDevelop\AuxiliaryPrograms\Petsc-Solver-Test\petsc_unsym_f\ksp_inhm_
d.exe on a arch-mswin-c-debug named NWMOP by dsu Tue Aug 13 18:46:55 2013
[1]PETSC ERROR: Libraries linked from 
/cygdrive/c/cygwin/packages/petsc-3.4.2/arch-mswin-c-debug/lib
[1]PETSC ERROR: Configure run at Tue Aug  6 10:46:18 2013
[1]PETSC ERROR: Configure options --with-cc="win32fe cl" 
--with-fc="win32fe ifort" --with-cxx="win32fe cl" --with-parmet
is-include=/cygdrive/c/cygwin/packages/parmetis-4.0.3/include 
--with-parmetis-lib=/cygdrive/c/cygwin/packages/parmetis-4
.0.3/build/libparmetis/Release/parmetis.lib 
--with-metis-include=/cygdrive/c/cygwin/packages/metis-5.1.0/include --with-
metis-lib=/cygdrive/c/cygwin/packages/metis-5.1.0/build/libmetis/Release/metis.lib 
--download-f-blas-lapack --useThreads
=0
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: PetscTrFreeDefault() line 301 in 
src/sys/memory/C:\cygwin\packages\PETSC-~1.2\src\sys\memory\mtr.c
[1]PETSC ERROR: VecDestroy_MPI() line 20 in 
src/vec/vec/impls/mpi/C:\cygwin\packages\PETSC-~1.2\src\vec\vec\impls\mpi\pd
vec.c
[1]PETSC ERROR: VecDestroy() line 546 in 
src/vec/vec/interface/C:\cygwin\packages\PETSC-~1.2\src\vec\vec\INTERF~1\vector
.c
[1]PETSC ERROR: PetscTrFreeDefault() called from VecDestroy_MPI() line 
30 in src/vec/vec/impls/mpi/C:\cygwin\packages\PE
TSC-~1.2\src\vec\vec\impls\mpi\pdvec.c
[1]PETSC ERROR: Block at address 000000000279FDD0 is corrupted; cannot free;
may be block not allocated with PetscMalloc()
[1]PETSC ERROR: --------------------- Error Message 
------------------------------------
[1]PETSC ERROR: Memory corruption!
[1]PETSC ERROR: Bad location or corrupted memory!
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: Petsc Release Version 3.4.2, Jul, 02, 2013
[1]PETSC ERROR: See docs/changes/index.html for recent updates.
[1]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[1]PETSC ERROR: See docs/index.html for manual pages.
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: 
D:\dsu\ResearchAtUBC\Dropbox\ParallelDevelop\AuxiliaryPrograms\Petsc-Solver-Test\petsc_unsym_f\ksp_inhm_
d.exe on a arch-mswin-c-debug named NWMOP by dsu Tue Aug 13 18:46:55 2013
[1]PETSC ERROR: Libraries linked from 
/cygdrive/c/cygwin/packages/petsc-3.4.2/arch-mswin-c-debug/lib
[1]PETSC ERROR: Configure run at Tue Aug  6 10:46:18 2013
[1]PETSC ERROR: Configure options --with-cc="win32fe cl" 
--with-fc="win32fe ifort" --with-cxx="win32fe cl" --with-parmet
is-include=/cygdrive/c/cygwin/packages/parmetis-4.0.3/include 
--with-parmetis-lib=/cygdrive/c/cygwin/packages/parmetis-4
.0.3/build/libparmetis/Release/parmetis.lib 
--with-metis-include=/cygdrive/c/cygwin/packages/metis-5.1.0/include --with-
metis-lib=/cygdrive/c/cygwin/packages/metis-5.1.0/build/libmetis/Release/metis.lib 
--download-f-blas-lapack --useThreads
=0
[1]PETSC ERROR: 
------------------------------------------------------------------------
[1]PETSC ERROR: PetscTrFreeDefault() line 283 in 
src/sys/memory/C:\cygwin\packages\PETSC-~1.2\src\sys\memory\mtr.c
[1]PETSC ERROR: VecDestroy_MPI() line 30 in 
src/vec/vec/impls/mpi/C:\cygwin\packages\PETSC-~1.2\src\vec\vec\impls\mpi\pd
vec.c
[1]PETSC ERROR: VecDestroy() line 546 in 
src/vec/vec/interface/C:\cygwin\packages\PETSC-~1.2\src\vec\vec\INTERF~1\vector
.c


Thanks and regards,

Danyang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130813/1e4c55bb/attachment.html>


More information about the petsc-users mailing list