[petsc-users] memory crash with optimized petsc

Jed Brown jedbrown at mcs.anl.gov
Mon Jun 3 08:04:22 CDT 2013


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.


More information about the petsc-users mailing list