parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
112 stars 33 forks source link

Add CMake options for turning on ASAN and HWASAN #1106

Closed BenWibking closed 3 months ago

BenWibking commented 3 months ago

PR Summary

Add CMake options ENABLE_ASAN and ENABLE_HWASAN to build with AddressSanitizer and HWAddressSanitizer, respectively, turned on.

ASAN is supported in both clang and gcc. HWASAN is support by clang and (in theory) gcc.

Then the app is run as normal. It will stop and print an error if a memory bug is detected. This should detect almost all out of bounds access, uninitalized values, and other memory errors for CPU builds.

Usage notes:

PR Checklist

lroberts36 commented 3 months ago

I'm asking wrt to whether it's worth to activate this by default to one of the short or extended tests (once the issue reported in #1107 are fixed).

I definitely support having it run on one of the extended tests (unless it takes hours to run with these options on).

BenWibking commented 3 months ago

Running the test suite with this turned on is only about a factor of 2-3 slower on my laptop, so I think it should be fine to enable for the extended CI.