Skip to content

Commit

Permalink
Merge branch 'development' into mhd_clang_tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Mar 20, 2024
2 parents be28bd5 + 09bde5f commit 6f23a24
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 9 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/fsanitizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: fsanitizer

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-fsanitizer
cancel-in-progress: true

jobs:
fsanitizer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
cd ../amrex
git fetch; git checkout development
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile subchandra
run: |
cd Exec/science/subchandra
make FSANITIZER=TRUE USE_MPI=FALSE -j 4
- name: Run subchandra
run: |
cd Exec/science/subchandra
./Castro2d.gnu.SMPLSDC.ex inputs_2d.N14.coarse amr.max_level=1 max_step=1 amr.n_cell=320 640
8 changes: 6 additions & 2 deletions Docs/source/debugging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ You can also use ask it to fix errors automatically via:

and you can treat warnings as errors by adding ``CLANG_TIDY_WARN_ERROR=TRUE``.

.. note::

Building a Castro problem with ``clang-tidy`` will suppress the
checks in AMReX and Microphysics sources and headers. This is set by
the parameter ``CLANG_TIDY_IGNORE_SOURCES`` in ``Make.Castro``, and
the ``HeaderFilterRegex`` whitelist in ``.clang-tidy``.


Thread sanitizer
Expand Down Expand Up @@ -121,5 +127,3 @@ to operate over.

Physics issues
==============


8 changes: 3 additions & 5 deletions Source/driver/Castro_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -574,11 +574,9 @@ Castro::writeJobInfo (const std::string& dir, const Real io_time)
jobInfoFile << " Plotfile Information\n";
jobInfoFile << PrettyLine;

time_t now = time(nullptr);

// Convert now to tm struct for local timezone
tm* localtm = localtime(&now);
jobInfoFile << "output date / time: " << asctime(localtm);
const std::time_t now = time(nullptr);
jobInfoFile << "output date / time: "
<< std::put_time(std::localtime(&now), "%c\n") << "\n";

char currentDir[FILENAME_MAX];
if (getcwd(currentDir, FILENAME_MAX) != nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions Source/reactions/Castro_react.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Castro::react_state(MultiFab& s, MultiFab& r, Real time, Real dt, const int stra
#if defined(AMREX_USE_GPU)
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
#else
LoopOnCpu(bx, [&] (int i, int j, int k) mutable
LoopOnCpu(bx, [&] (int i, int j, int k)
#endif
{

Expand Down Expand Up @@ -558,7 +558,7 @@ Castro::react_state(Real time, Real dt)
#if defined(AMREX_USE_GPU)
ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k)
#else
LoopOnCpu(bx, [&] (int i, int j, int k) mutable
LoopOnCpu(bx, [&] (int i, int j, int k)
#endif
{
burn_t burn_state;
Expand Down

0 comments on commit 6f23a24

Please sign in to comment.