[petsc-users] memory crash with optimized petsc
Fande Kong
fande.kong at colorado.edu
Mon Jun 3 08:51:07 CDT 2013
Thanks Jed,
I run code with options: -malloc_debug and -malloc_dump and get the
following results:
[0]Total space allocated 217984 bytes
[ 0]16 bytes PetscStrallocpy() line 186 in
/home/fdkong/math/petsc-3.3-p7/src/sys/utils/str.c
[0] PetscObjectChangeTypeName() line 129 in
/home/fdkong/math/petsc-3.3-p7/src/sys/objects/pname.c
[0] ISSetType() line 77 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/interface/isreg.c
[0] ISCreateGeneral() line 437 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/impls/general/general.c
[0] SpmcsDMMeshGetStratumIS() line 1375 in spmcsdmmesh.cpp
[0] ComputeMatrix() line 279 in linearElasticity3d.cpp
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] PCSetUp() line 810 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/pc/interface/precon.c
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] KSPSetFromOptions() line 284 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itcl.c
[ 0]32 bytes ISCreate_General() line 516 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/impls/general/general.c
[0] ISSetType() line 77 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/interface/isreg.c
[0] ISCreateGeneral() line 437 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/impls/general/general.c
[0] SpmcsDMMeshGetStratumIS() line 1375 in spmcsdmmesh.cpp
[0] ComputeMatrix() line 279 in linearElasticity3d.cpp
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] PCSetUp() line 810 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/pc/interface/precon.c
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] KSPSetFromOptions() line 284 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itcl.c
[ 0]128 bytes ISCreate() line 43 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/interface/isreg.c
[0] ISCreateGeneral() line 437 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/impls/general/general.c
[0] SpmcsDMMeshGetStratumIS() line 1375 in spmcsdmmesh.cpp
[0] ComputeMatrix() line 279 in linearElasticity3d.cpp
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] PCSetUp() line 810 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/pc/interface/precon.c
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] KSPSetFromOptions() line 284 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itcl.c
[ 0]64 bytes ISCreate() line 43 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/interface/isreg.c
[0] ISCreateGeneral() line 437 in
/home/fdkong/math/petsc-3.3-p7/src/vec/is/impls/general/general.c
[0] SpmcsDMMeshGetStratumIS() line 1375 in spmcsdmmesh.cpp
[0] ComputeMatrix() line 279 in linearElasticity3d.cpp
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
[0] PCSetUp() line 810 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/pc/interface/precon.c
[0] KSPSetUp() line 182 in
/home/fdkong/math/petsc-3.3-p7/src/ksp/ksp/interface/itfunc.c
Whether it means that I malloced some objects and then I did not free them?
Or something else? Or it is normal?
On Mon, Jun 3, 2013 at 9:04 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> Fande Kong <fande.kong at colorado.edu> writes:
>
> > Hi all,
> >
> > I can correctly run my application based on the petsc ( --with-debugging
> =
> > yes). But the same code encounters memory crash when it runs with
> optimized
> > version ( --with-debugging = no) . The detailed information for errors
> and
> > results is attached. The logs for configure and make are also attached.
> >
> >
> > Now, there are several questions I want to know
> >
> > (1) What are differences between debug version and optimized version in
> > terms of memory management and communication?
> >
> > (2) I print some memory usages. Why does the optimized version cost twice
> > more memory than the debug version?
>
> It shouldn't. What interface are you using to obtain memory usage? I
> suggest fixing the errors before worrying about this.
>
> You should figure out how to reproduce the issue on a smaller problem
> size and with fewer processes. That reduction alone may tell you where
> the issue occurs.
>
> > (3) How to debug the optimized code to fix memory issue?
>
> Is the debug version currently clean when run with -malloc_dump and
> clean when run under valgrind? If so, I would configure
>
> --with-debugging=0 COPTFLAGS='-O0 -g'
>
> this will take the "optimized" code path, but will have full information
> when run in the debugger. You'll need a smaller problem size and fewer
> processes (preferably one or two) to do this effectively.
>
>
--
Fande Kong
Department of Computer Science
University of Colorado at Boulder
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130603/a845c44a/attachment.html>
More information about the petsc-users
mailing list