Skip to content

Commit

Permalink
Merge branch 'development' into ROCK4
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Jul 30, 2024
2 parents ba5a8fc + 727afa9 commit 518f806
Show file tree
Hide file tree
Showing 460 changed files with 58,590 additions and 22,517 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
4 changes: 2 additions & 2 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ jobs:
make realclean
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
- name: compile test_ase (ase)
- name: compile test_nse_net (ase)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_ase
cd unit_test/test_nse_net
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
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
1 change: 1 addition & 0 deletions .github/workflows/good_defines.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ALLOW_GPU_PRINTF
ALLOW_JACOBIAN_CACHING
AMREX_USE_CUDA
AMREX_USE_GPU
Expand Down
25 changes: 13 additions & 12 deletions .github/workflows/nse_test.yml → .github/workflows/jac_cell.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: nse_test
name: jac_cell

on: [pull_request]
jobs:
nse_test:
nse_table:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,19 +26,20 @@ jobs:
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile, test_nse (aprox21)
- name: Compile jac_cell
run: |
cd unit_test/test_nse
make realclean
make NETWORK_DIR=aprox21 -j 4
cd unit_test/jac_cell
make -j 4
- name: Run test_nse (aprox21)
- name: Run jac_cell
run: |
cd unit_test/test_nse
./main3d.gnu.ex inputs_aprox21 > test.out
cd unit_test/jac_cell
./main3d.gnu.ex inputs_aprox13 > test.out
- name: Compare to stored output (aprox21)
- name: Compare to stored output
run: |
cd unit_test/test_nse
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" -I "^0x" test.out ci-benchmarks/aprox21_ci.out
cd unit_test/jac_cell
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/jac_cell_aprox13.out
36 changes: 22 additions & 14 deletions .github/workflows/nse_net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,42 @@ jobs:
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile, test_ase (NSE_NET, ase)
- name: Compile, test_nse_net (NSE_NET, ase)
run: |
cd unit_test/test_ase
cd unit_test/test_nse_net
make realclean
make -j 4
- name: Run test_ase (NSE_NET, ase)
- name: Run test_nse_net (NSE_NET, ase)
run: |
cd unit_test/test_ase
./main3d.gnu.ex inputs_ase > test.out
cd unit_test/test_nse_net
./main3d.gnu.ex inputs_ase amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_nse_net/Backtrace.0') != '' }}
run: cat unit_test/test_nse_net/Backtrace.0

- name: Compare to stored output (NSE_NET, ase)
run: |
cd unit_test/test_ase
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_unit_test.out
cd unit_test/test_nse_net
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/nse_net_unit_test.out
- name: Compile, test_ase/make_table (NSE_NET, ase, make_table)
- name: Compile, test_nse_net/make_table (NSE_NET, ase, make_table)
run: |
cd unit_test/test_ase/make_table
cd unit_test/test_nse_net/make_table
make realclean
make -j 4
- name: Run, test_ase/make_table (NSE_NET, ase, make_table)
- name: Run, test_nse_net/make_table (NSE_NET, ase, make_table)
run: |
cd unit_test/test_ase/make_table
./main3d.gnu.ex > test.out
cd unit_test/test_nse_net/make_table
./main3d.gnu.ex amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
if: ${{ failure() && hashFiles('unit_test/test_nse_net/make_table/Backtrace.0') != '' }}
run: cat unit_test/test_nse_net/make_table/Backtrace.0

- name: Compare to stored output (NSE_NET, ase, make_table)
run: |
cd unit_test/test_ase/make_table
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_make_table_unit_test.out
cd unit_test/test_nse_net/make_table
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/nse_net_make_table_unit_test.out
Loading

0 comments on commit 518f806

Please sign in to comment.