Skip to content

Commit

Permalink
add HWASAN CI run (#510)
Browse files Browse the repository at this point in the history
### Description
This adds a CI run on Oracle Cloud Infrastructure (with Ampere aarch64
processors) with HWASAN enabled.

Processor info:
```
Architecture:           aarch64
  CPU op-mode(s):       32-bit, 64-bit
  Byte Order:           Little Endian
CPU(s):                 4
  On-line CPU(s) list:  0-3
Vendor ID:              ARM
  Model name:           Neoverse-N1
    Model:              1
    Thread(s) per core: 1
    Core(s) per socket: 4
    Socket(s):          1
    Stepping:           r3p1
    BogoMIPS:           50.00
    Flags:              fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
```

### Related issues
Closes #509.

### Checklist
_Before this pull request can be reviewed, all of these tasks should be
completed. Denote completed tasks with an `x` inside the square brackets
`[ ]` in the Markdown source below:_
- [x] I have added a description (see above).
- [x] I have added a link to any related issues see (see above).
- [x] I have read the [Contributing
Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md).
- [x] I have added tests for any new physics that this PR adds to the
code.
- [x] I have tested this PR on my local computer and all tests pass.
- [x] I have manually triggered the GPU tests with the magic comment
`/azp run`.
- [ ] I have requested a reviewer for this PR.

---------

Co-authored-by: Piyush Sharda <[email protected]>
  • Loading branch information
BenWibking and psharda authored Feb 1, 2024
1 parent 11d7436 commit c0344d5
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 115 deletions.
41 changes: 41 additions & 0 deletions .ci/azure-pipelines-aarch64-hwasan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- development

pr:
autoCancel: true
branches:
include:
- development

jobs:
- job: BuildAndTest
timeoutInMinutes: 180 # how long to run the job before automatically cancelling
pool: oracle-cloud
steps:
- task: CMake@1
displayName: 'Configure CMake'
inputs:
cmakeArgs: '.. -DCMAKE_BUILD_TYPE=Release -DENABLE_HWASAN=ON -DCMAKE_CXX_FLAGS="-fPIC" -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DAMReX_SPACEDIM=1'

- task: CMake@1
displayName: 'Build Quokka'
inputs:
cmakeArgs: '--build .'

- task: CMake@1
displayName: 'Run CTest'
inputs:
cmakeArgs: '-E chdir . ctest -j 2 -T Test --output-on-failure'

- task: PublishTestResults@2
inputs:
testResultsFormat: cTest
testResultsFiles: build/Testing/*/Test.xml
testRunTitle: $(Agent.JobName)
condition: succeededOrFailed()
displayName: Publish test results
40 changes: 0 additions & 40 deletions .ci/azure-pipelines-asan.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .ci/azure-pipelines-build-llvm.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .ci/azure-pipelines-debug.yml

This file was deleted.

1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(AMReX_TINY_PROFILE ON CACHE BOOL "" FORCE)
option(QUOKKA_PYTHON "Compile with Python support (on/off)" ON)
option(DISABLE_FMAD "Disable fused multiply-add instructions on GPU (on/off)" ON)
option(ENABLE_ASAN "Enable AddressSanitizer and UndefinedBehaviorSanitizer" OFF)
option(ENABLE_HWASAN "Enable HWAddressSanitizer" OFF)
option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" OFF)
option(QUOKKA_OPENPMD "Enable OpenPMD output (on/off)" OFF)

Expand Down
7 changes: 7 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ if(ENABLE_ASAN)
add_link_options(-fsanitize=address -fsanitize=undefined)
endif(ENABLE_ASAN)

if(ENABLE_HWASAN)
# enable HWAddressSanitizer for debugging
message(STATUS "Compiling with HWAddressSanitizer *enabled*")
add_compile_options(-fsanitize=hwaddress)
add_link_options(-fsanitize=hwaddress)
endif(ENABLE_HWASAN)

if(DISABLE_FMAD)
message(STATUS "Fused multiply-add (FMAD) is disabled for device code.")
add_compile_options($<$<COMPILE_LANGUAGE:C>:-ffp-contract=off>)
Expand Down

0 comments on commit c0344d5

Please sign in to comment.