Skip to content

Commit

Permalink
Merge branch 'AMReX-Astro:main' into current_inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
khanakbhargava authored May 27, 2024
2 parents 5e32186 + 81872b5 commit c254a39
Show file tree
Hide file tree
Showing 88 changed files with 1,842 additions and 574 deletions.
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ Checks: >
clang-diagnostic-*,
cppcoreguidelines-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-interfaces-global-init,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-no-malloc,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-*,
misc-*,
-misc-const-correctness,
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
-modernize-use-using,
performance-*,
-performance-avoid-endl,
portability-*,
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: cpp-linter

on: [pull_request]

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

jobs:
cpp-linter:
runs-on: ubuntu-latest
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/check_pr_branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: check PR branch

on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited

jobs:
check-PR-branch:
runs-on: ubuntu-latest
steps:
- name: PRs should not target main
run: |
if [[ "${{ github.base_ref }}" == "main" ]]; then
echo 'Pull requests must not be made against main. Please target development instead.'
exit 1
fi
36 changes: 36 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "clang-tidy"

on: [pull_request]

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

jobs:
clang_tidy:
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
echo "MICROPHYSICS_HOME=$(pwd)" >> $GITHUB_ENV
cd ../amrex
git fetch; git checkout development
echo "AMREX_HOME=$(pwd)" >> $GITHUB_ENV
cd ../..
- name: Install dependencies
run: |
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
- name: Compile flame_wave
run: |
echo $AMREX_HOME
echo $MICROPHYSICS_HOME
cd Exec/science/subchandra
make USE_MPI=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
5 changes: 5 additions & 0 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: "compiler warnings"

on: [pull_request]

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

jobs:
compiler_warnings:
runs-on: ubuntu-latest
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/dependencies_clang-tidy-apt-llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
fi

source /etc/os-release # set UBUNTU_CODENAME

sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME} main"
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-$1 main"

sudo apt-get update

sudo apt-get install -y --no-install-recommends \
clang-tidy-$1 libomp-$1-dev
5 changes: 5 additions & 0 deletions .github/workflows/detonation-sdc-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: detonation-sdc

on: [pull_request]

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

jobs:
detonation-sdc:
runs-on: ubuntu-latest
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/flame_wave-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: flame_wave

on: [pull_request]

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

jobs:
flame_wave-2d:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -31,7 +36,7 @@ jobs:
- name: Run flame_wave
run: |
cd Exec/science/flame_wave
./Castro2d.gnu.DEBUG.ex inputs_2d.testsuite max_step=2 castro.sum_interval=1 amr.plot_files_output=0 amr.checkpoint_files_output=0
./Castro2d.gnu.DEBUG.ex inputs_2d.testsuite max_step=2 castro.sum_interval=1 amr.plot_files_output=1 amr.checkpoint_files_output=0
- name: Check grid_diag.out
run: |
Expand All @@ -42,3 +47,10 @@ jobs:
run: |
cd Exec/science/flame_wave
diff species_diag.out ci-benchmarks/species_diag.out
- name: Check job_info parameters
run: |
cd Exec/science/flame_wave
line_no=`grep -n "Inputs File Parameters" plt00000/job_info | cut -d ":" -f 1`
tail -n +$(($line_no -1)) plt00000/job_info > tmp.txt
diff tmp.txt ci-benchmarks/job_info_params.txt
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
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
run: ./deploy_docs_action.sh

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./out
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/gpu_action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: GPU compilation

on: [pull_request]

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

jobs:
gpu-compilation:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/style/check_trailing_whitespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ find . -type d \( -name .git \
-o -path ./paper \
-o -name build -o -name install \
-o -name tmp_build_dir -o -name tmp_install_dir \
-o -name ci-benchmarks \
-o -path ./util/gcem \
\) -prune -o \
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/wdmerger_collision-compare.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: wdmerger_collision

on: [pull_request]

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

jobs:
wdmerger_collision-2d:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -43,5 +48,5 @@ jobs:
- name: Check the extrema
run: |
cd Exec/science/wdmerger
../../../external/amrex/Tools/Plotfile/fextrema.gnu.ex plt00095 > fextrema.out
../../../external/amrex/Tools/Plotfile/fextrema.gnu.ex plt00086 > fextrema.out
diff fextrema.out ci-benchmarks/wdmerger_collision_2D.out
39 changes: 39 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# 24.05

* Changed how the shock flag is computed. It is now computed once,
at the start of a timestep. It also takes into account sources
such that the pressure jump is only the pressure that is available
to drive a shock. (#2726, #2728)

* Fixed a boundary condition check in gravity (#2833)

* Some coverity and clang-tidy fixes (#2810, #2811, #2835, #2831,
#2832)

* Fix the wdmerger initialization when the two stars are overlapping
(#2829)

* Fixed the Castro retry mechanism when amr.subcycling_mode = None
(#2821, #2824, #2826)

* Added more amr parameters to the job_info file (#2828)

* Added OpenMP to the SDC burn loop (#2770)

# 24.04

* Some clang-tidy fixes (#2779, #2780, #2781, #2784, #2786, #2787, #2790,
#2791, #2792, #2793, #2797, #2798, #2799, #2800, #2801, #2804)

* Fix species initialization in the Detonation problem (#2806)
and let it work with NSE (#2765)

* Sync up with AMReX changes (#2794)

* wdmerger now reports composition of initial stars (#2767)

* flame_wave now checks if the `atm_delta` is too small (#2782)
and stores X(ash) (#2773)

* a bounds issue in the true SDC integration was fixed (#2775)

# 24.03

* Documentation updates (#2742, #2752, #2753)
Expand Down
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
==============


6 changes: 4 additions & 2 deletions Docs/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ Derived variables
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| variable name | description | derive routine | units |
+===================================+===================================================+=============================+=========================================+
| ``abar`` | Mean atomic mass | ``derabar`` | :math:`\amu` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``angular_momentum_x``, | Angular momentum / volume in the x, y, or z dir | ``derangmomx``, | :math:`{\rm g~cm^{-1}~s^{-1}}` |
| ``angular_momentum_y``, | computed as :math:`[(\rho \ub) \times {\bf r}]_n` | ``derangmomy``, | |
| ``angular_momentum_z`` | where :math:`{\bf r}` is the distance from | ``derangmomz`` | |
Expand All @@ -328,6 +330,8 @@ Derived variables
| | :math:`s = s(\rho, e, X_k)`, where `e` is | | |
| | computed from :math:`(\rho e)` | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``enuc`` | Nuclear energy generation rate / gram | ``derenuc`` | :math:`{\rm erg~g^{-1}~s^{-1}}` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``Ertot`` | Total radiation energy density | ``derertot`` | |
| | (for multigroup radiation problems) | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
Expand Down Expand Up @@ -391,8 +395,6 @@ Derived variables
| ``y_velocity``, | :math:`\ub = (\rho \ub)/\rho` | | |
| ``z_velocity`` | | | |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+
| ``enuc`` | Nuclear energy generation rate / gram | ``derenuc`` | :math:`{\rm erg~g^{-1}~s^{-1}}` |
+-----------------------------------+---------------------------------------------------+-----------------------------+-----------------------------------------+

problem-specific plotfile variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
Loading

0 comments on commit c254a39

Please sign in to comment.