11.07.2015 Views

PETSc Tutorial - The ACTS Toolkit

PETSc Tutorial - The ACTS Toolkit

PETSc Tutorial - The ACTS Toolkit

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Debugging TipsDebugging <strong>PETSc</strong>Putting a breakpoint in PetscError() can catch errors as they occur<strong>PETSc</strong> tracks memory overwrites at the beginning and end of arrays<strong>The</strong> CHKMEMQ macro causes a check of all allocated memoryTrack memory overwrites by bracketing them with CHKMEMQ<strong>PETSc</strong> checks for leaked memoryUse PetscMalloc() and PetscFree() for all allocationOption -trmalloc will print unfreed memory on PetscFinalize()M. Knepley (ANL) <strong>Tutorial</strong> <strong>ACTS</strong> ’06 37 / 166

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!