Rongliang Chen <[email protected]> writes:
> My code woks well for the petsc-3.4.2 debug version, but get the 
> following errors for the no-debug version. Do you have any suggestions 
> for debugging the code?

Reducing the number of processes to reproduce the error always helps for
debugging.

One of the most common reasons is that a stack variable is initialized
to 0 at -O0, but contains garbage at higher optimization levels.  To
debug, use a debugging PETSc, but compile with "-O1 -g" and make sure
all warnings are turned on (at least -Wall, preferably -Wextra).
Make sure the code is valgrind-clean in this mode.

Another possibility is that debug-mode memory allocation/macros are
causing the different behavior.  First try turning off the tracing
malloc (run program with -malloc 0).  Then try an optimized PETSc built
with debugging (--with-debugging=0 COPTFLAGS='-O0 -g', or
--with-debugging=0 COPTFLAGS='-O1 -g').

Attachment: pgpm_FicMJPwV.pgp
Description: PGP signature

Reply via email to