Skip to content

Commit

Permalink
Merge branch 'development' into clang-tidy-header
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jul 11, 2024
2 parents 611bc43 + 963ff00 commit 1be2b59
Show file tree
Hide file tree
Showing 395 changed files with 48,978 additions and 26,747 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[codespell]
skip = .git,*.ipynb,*.bib,*.ps,*~
skip = .git,*.ipynb,*.bib,*.ps,*~,./util/autodiff
ignore-words = .codespell-ignore-words


4 changes: 2 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ indent_style = tab
indent_size = unset


[util/gcem/**]
# don't mess with the gcem subtree
[util/{autodiff,gcem}/**]
# don't mess with the autodiff or gcem subtrees
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
Expand Down
40 changes: 23 additions & 17 deletions .github/workflows/burn_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ jobs:
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile, burn_cell (VODE, subch_approx)
- name: Compile, burn_cell (VODE, subch_simple)
run: |
cd unit_test/burn_cell
make realclean
make NETWORK_DIR=subch_approx -j 4
make NETWORK_DIR=subch_simple -j 4
- name: Run burn_cell (VODE, subch_approx)
- name: Run burn_cell (VODE, subch_simple)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_subch_approx > test.out
./main3d.gnu.ex inputs_subch_simple amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (VODE, subch_approx)
- name: Compare to stored output (VODE, subch_simple)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_simple_unit_test.out
- name: Compile, burn_cell (VODE, ECSN)
run: |
Expand All @@ -51,7 +51,9 @@ jobs:
- name: Run burn_cell (VODE, ECSN)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_ecsn > test.out
# disable fpe_trap_overflow, as there's a spurious exception when
# calculating DEL in vode_dvnlsd.H.
./main3d.gnu.ex inputs_ecsn amrex.fpe_trap_{invalid,zero}=1 > test.out
- name: Compare to stored output (VODE, ECSN)
run: |
Expand All @@ -67,7 +69,7 @@ jobs:
- name: Run burn_cell (VODE, ignition_chamulak)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_ignition_chamulak > test.out
./main3d.gnu.ex inputs_ignition_chamulak amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (VODE, ignition_chamulak)
run: |
Expand All @@ -83,28 +85,28 @@ jobs:
- name: Run burn_cell (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_triple > test.out
./main3d.gnu.ex inputs_triple amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/triple_alpha_plus_cago_FE_unit_test.out
- name: Compile, burn_cell (BackwardEuler, subch_approx)
- name: Compile, burn_cell (BackwardEuler, subch_simple)
run: |
cd unit_test/burn_cell
make realclean
make NETWORK_DIR=subch_approx INTEGRATOR_DIR=BackwardEuler -j 4
make NETWORK_DIR=subch_simple INTEGRATOR_DIR=BackwardEuler -j 4
- name: Run burn_cell (BackwardEuler, subch_approx)
- name: Run burn_cell (BackwardEuler, subch_simple)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_subch_approx > test.out
./main3d.gnu.ex inputs_subch_simple amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (BackwardEuler, subch_approx)
- name: Compare to stored output (BackwardEuler, subch_simple)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_BE_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_simple_BE_unit_test.out
- name: Compile, burn_cell (QSS, aprox13)
run: |
Expand All @@ -115,7 +117,7 @@ jobs:
- name: Run burn_cell (QSS, aprox13)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_aprox13 > test.out
./main3d.gnu.ex inputs_aprox13 amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (QSS, aprox13)
run: |
Expand All @@ -131,9 +133,13 @@ jobs:
- name: Run burn_cell (RKC, aprox13)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_aprox13 unit_test.temperature=1.e9 > test.out
./main3d.gnu.ex inputs_aprox13 unit_test.temperature=1.e9 amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (RKC, aprox13)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_RKC_unit_test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/burn_cell/Backtrace.0') != '' }}
run: cat unit_test/burn_cell/Backtrace.0
6 changes: 5 additions & 1 deletion .github/workflows/burn_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ jobs:
run: |
cd unit_test/burn_cell_primordial_chem
make -j 2
./main1d.gnu.DEBUG.ex inputs_primordial_chem > test.out
./main1d.gnu.DEBUG.ex inputs_primordial_chem amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/burn_cell_primordial_chem/Backtrace.0') != '' }}
run: cat unit_test/burn_cell_primordial_chem/Backtrace.0

- name: Compare to stored output
run: |
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/burn_cell_sdc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run burn_cell_sdc (aprox19)
run: |
cd unit_test/burn_cell_sdc
./main3d.gnu.ex inputs_aprox19.ci
./main3d.gnu.ex inputs_aprox19.ci amrex.fpe_trap_{invalid,zero,overflow}=1
- name: Compare to stored output (aprox19)
run: |
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Run burn_cell_sdc (BackwardEuler, aprox19)
run: |
cd unit_test/burn_cell_sdc
./main3d.gnu.ex inputs_aprox19.ci
./main3d.gnu.ex inputs_aprox19.ci amrex.fpe_trap_{invalid,zero,overflow}=1
- name: Compare to stored output (BackwardEuler, aprox19)
run: |
Expand All @@ -67,10 +67,13 @@ jobs:
- name: Run burn_cell_sdc (RKC, aprox19)
run: |
cd unit_test/burn_cell_sdc
./main3d.gnu.ex inputs_aprox19.ci
./main3d.gnu.ex inputs_aprox19.ci amrex.fpe_trap_{invalid,zero,overflow}=1
- name: Compare to stored output (RKC, aprox19)
run: |
cd unit_test/burn_cell_sdc
diff state_over_time.txt ci-benchmarks/aprox19_RKC_state_over_time.txt
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/burn_cell_sdc/Backtrace.0') != '' }}
run: cat unit_test/burn_cell_sdc/Backtrace.0
3 changes: 3 additions & 0 deletions .github/workflows/check_ifdefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ def check_file(filename):
if "tmp_build_dir" in f.parts:
# skip generated files
continue
if f.parts[:2] == ("util", "autodiff"):
# skip third-party autodiff files
continue
ierr, defines = check_file(f)
all_defines += defines
total_errors += ierr
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/check_powi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@


def pow_to_powi(text):
# Finds all possible std::pow(x, n) or gcem::pow(x, n)
# Finds all possible std::pow(x, n), gcem::pow(x, n), or admath::pow(x, n)
# where n is a potential integer to amrex::Math::powi<n>(x)

# Check for all positive and negative integer, whole float numbers
# Match all positive and negative integers, whole float numbers
# with and without _rt
match_pattern = r"([^,]+),\s*(-?(?:\d+\.0*_rt?|\d))"
integer_pattern = r"-?(?:\d+\.0*(?:e0)?(?:_rt)?|\d)"

# Check for an integer in the second argument
match_pattern = rf"([^,]+),\s*({integer_pattern})"

# Match fails when there is a nested pow, so only inner most pow is matched
negate_pattern = r"(?![\s\S]*(?:std|gcem)::pow\((?:[^,]+),\s*(?:-?(?:\d+\.0*_rt?|\d))\))"
negate_pattern = rf"(?![\s\S]*(?:std|gcem|admath)::pow\((?:[^,]+),\s*(?:{integer_pattern})\))"

# Final pattern
pattern = rf"(?:std|gcem)::pow\({negate_pattern}{match_pattern}\)"
pattern = rf"(?:std|gcem|admath)::pow\({negate_pattern}{match_pattern}\)"
# pattern = rf"(?:std|gcem)::pow\((?![\s\S]*(?:std|gcem)::pow\((?:[^,]+),\s*(?:-?(?:\d+\.0*_rt?|\d))\))([^,]+),\s*(-?(?:\d+\.0*_rt?|\d))\)"

def replacement(match):
Expand All @@ -33,6 +36,8 @@ def replacement(match):
def process_content(dir_path):
# This function processes all text in the given directory
for root, dirs, filenames in os.walk(dir_path):
if "util/autodiff/" in root:
continue
for filename in filenames:
if filename.endswith(".H") or filename.endswith(".cpp"):
filepath = os.path.join(root, filename)
Expand All @@ -58,9 +63,9 @@ def git_diff():

# Print out suggested change and raise error after detecting modification
if git_diff_output.stdout:
print("Detected potential usage to replace std::pow" +
"with integer powers via amrex::Math::powi\n")
print("Below are the suggested change:\n")
print("Detected potential usage to replace std::pow"
" with integer powers via amrex::Math::powi\n")
print("Below are the suggested changes:\n")
print(git_diff_output.stdout)

raise RuntimeError("Changes detected after modification")
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/eos_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Run eos_cell (helmholtz)
run: |
cd unit_test/eos_cell
./main3d.gnu.ex inputs_eos > test.out
./main3d.gnu.ex inputs_eos amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (helmholtz)
run: |
Expand All @@ -51,11 +51,13 @@ jobs:
- name: Run eos_cell (gamma_law)
run: |
cd unit_test/eos_cell
./main3d.gnu.ex inputs_eos > test.out
./main3d.gnu.ex inputs_eos amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Compare to stored output (gamma_law)
run: |
cd unit_test/eos_cell
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/eos_gamma_law.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/eos_cell/Backtrace.0') != '' }}
run: cat unit_test/eos_cell/Backtrace.0
2 changes: 1 addition & 1 deletion .github/workflows/find_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run(SHAs=None, make_options=''):

parser = argparse.ArgumentParser(description='')
parser.add_argument('-make-options',
default='-j 2',
default='-j 4',
help='make options')
parser.add_argument('SHAs', nargs='*', default=None,
help='SHAs to be compared')
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/nse_net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
- name: Run test_ase (NSE_NET, ase)
run: |
cd unit_test/test_ase
./main3d.gnu.ex inputs_ase > test.out
./main3d.gnu.ex inputs_ase amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_ase/Backtrace.0') != '' }}
run: cat unit_test/test_ase/Backtrace.0

- name: Compare to stored output (NSE_NET, ase)
run: |
Expand All @@ -51,7 +55,11 @@ jobs:
- name: Run, test_ase/make_table (NSE_NET, ase, make_table)
run: |
cd unit_test/test_ase/make_table
./main3d.gnu.ex > test.out
./main3d.gnu.ex amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_ase/make_table/Backtrace.0') != '' }}
run: cat unit_test/test_ase/make_table/Backtrace.0

- name: Compare to stored output (NSE_NET, ase, make_table)
run: |
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/nse_table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,25 @@ jobs:
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile, burn_cell (NSE, aprox19)
- name: Compile, burn_cell_sdc (NSE, aprox19)
run: |
cd unit_test/burn_cell
cd unit_test/burn_cell_sdc
make realclean
make NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE INTEGRATOR_DIR=VODE -j 4
make NETWORK_DIR=aprox19 USE_NSE_TABLE=TRUE -j 4
- name: Run burn_cell (NSE, aprox19)
- name: Run burn_cell_sdc (NSE, aprox19)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_aprox19.nse > test.out
cd unit_test/burn_cell_sdc
./main3d.gnu.ex inputs_aprox19.nse.ci
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/burn_cell_sdc/Backtrace.0') != '' }}
run: cat unit_test/burn_cell_sdc/Backtrace.0

- name: Compare to stored output (NSE, aprox19)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19_nse_unit_test.out
cd unit_test/burn_cell_sdc
diff state_over_time.txt ci-benchmarks/aprox19_NSE_state_over_time.txt
6 changes: 5 additions & 1 deletion .github/workflows/nse_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
- name: Run test_nse (aprox21)
run: |
cd unit_test/test_nse
./main3d.gnu.ex inputs_aprox21 > test.out
./main3d.gnu.ex inputs_aprox21 amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_nse/Backtrace.0') != '' }}
run: cat unit_test/test_nse/Backtrace.0

- name: Compare to stored output (aprox21)
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/style/check_tabs.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 -path ./util/autodiff \
\) -prune -o \
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style/check_trailing_whitespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +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 -path ./util/gcem \
-o -path ./util/gcem -o -path ./util/autodiff \
\) -prune -o \
-type f \( \( -name "*.H" -o -name "*.h" -o -name "*.hh" -o -name "*.hpp" \
-o -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.cxx" \
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test_neutrinos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ jobs:
- name: Run test_neutrino_cooling
run: |
cd unit_test/test_neutrino_cooling
./main3d.gnu.ex inputs
./main3d.gnu.ex inputs amrex.fpe_trap_{invalid,zero,overflow}=1
../../external/amrex/Tools/Plotfile/fextrema.gnu.ex test_sneut5 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_neutrino_cooling/Backtrace.0') != '' }}
run: cat unit_test/test_neutrino_cooling/Backtrace.0

- name: Compare to stored output
run: |
cd unit_test/test_neutrino_cooling
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/test_nse_interp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:
- name: Run test_nse_interp (NSE, aprox19)
run: |
cd unit_test/test_nse_interp
./main3d.gnu.ex > test.out
./main3d.gnu.ex amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_nse_interp/Backtrace.0') != '' }}
run: cat unit_test/test_nse_interp/Backtrace.0

- name: Compare to stored output (NSE, aprox19)
run: |
Expand Down
Loading

0 comments on commit 1be2b59

Please sign in to comment.