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 Oct 24, 2023
2 parents b3d7629 + 7974a0d commit 5d4215f
Show file tree
Hide file tree
Showing 190 changed files with 45,758 additions and 28,960 deletions.
62 changes: 62 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# http://EditorConfig.org
#
# precedence of rules is bottom to top

# this is the top-most EditorConfig file
root = true


[*.{c,h,cpp,hpp,H,py}]
# 4 space indentation
indent_style = space
indent_size = 4

# Clean up trailing whitespace
trim_trailing_whitespace = true

# unix-style newlines
end_of_line = lf

# newline ending in files
insert_final_newline = true

[networks/**/reaclib_rates.H]
# some reaclib rate labels have trailing spaces
trim_trailing_whitespace = false


[*.md]
# two end of line whitespaces are newlines without a paragraph
trim_trailing_whitespace = false


[*.rst]
# Enforce UTF-8 encoding
charset = utf-8

# Unix-style newlines
end_of_line = lf

# Newline ending in files
insert_final_newline = true

# 3 space indentation
indent_style = space
indent_size = 3

# Clean up trailing whitespace
trim_trailing_whitespace = true

[{Makefile,GNUmakefile,Make.*}]
# TABs are part of its syntax
indent_style = tab
indent_size = unset


[util/gcem/**]
# don't mess with the gcem subtree
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
end_of_line = unset
insert_final_newline = unset
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Replaced tabs with spaces and trimmed trailing whitespace
5a2247f598f88f80ad8b186188fccfd5537b18d3
14 changes: 7 additions & 7 deletions .github/workflows/burn_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Compare to stored output (VODE, subch_approx)
run: |
cd unit_test/burn_cell
diff -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_approx_unit_test.out
- name: Compile, burn_cell (VODE, ECSN)
run: |
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Compare to stored output (VODE, ECSN)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ecsn_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ecsn_unit_test.out
- name: Compile, burn_cell (VODE, ignition_chamulak)
run: |
Expand All @@ -72,7 +72,7 @@ jobs:
- name: Compare to stored output (VODE, ignition_chamulak)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/chamulak_VODE_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/chamulak_VODE_unit_test.out
- name: Compile, burn_cell (ForwardEuler, triple_alpha_plus_cago)
run: |
Expand All @@ -88,7 +88,7 @@ jobs:
- name: Compare to stored output (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/triple_alpha_plus_cago_FE_unit_test.out
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)
run: |
Expand All @@ -104,7 +104,7 @@ jobs:
- name: Compare to stored output (BackwardEuler, subch_approx)
run: |
cd unit_test/burn_cell
diff -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_approx_BE_unit_test.out
- name: Compile, burn_cell (QSS, aprox13)
run: |
Expand All @@ -120,7 +120,7 @@ jobs:
- name: Compare to stored output (QSS, aprox13)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_QSS_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_QSS_unit_test.out
- name: Compile, burn_cell (RKC, aprox13)
run: |
Expand All @@ -136,4 +136,4 @@ jobs:
- name: Compare to stored output (RKC, aprox13)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_RKC_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_RKC_unit_test.out
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
value2=$(awk 'NR=='"$line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH)}' reference_solution.out)
difference=$(awk -v val1="$value1" -v val2="$value2" 'BEGIN { printf "%.2f", (val1 - val2) / val2 }')
if (( $(echo "$difference > $threshold" | bc -l) )); then
echo "Line number: $line_number"
echo "Value in test.out: $value1"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '[0-9][0-9].[0-9][0-9]'
- '[0-9][0-9].[0-9][0-9]'

name: Create Release

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/eos_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Compare to stored output (helmholtz)
run: |
cd unit_test/eos_cell
diff -I "^AMReX" test.out ci-benchmarks/eos_helmholtz.out
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/eos_helmholtz.out
- name: Compile eos_cell (gamma_law)
run: |
Expand All @@ -56,6 +56,6 @@ jobs:
- name: Compare to stored output (gamma_law)
run: |
cd unit_test/eos_cell
diff -I "^AMReX" test.out ci-benchmarks/eos_gamma_law.out
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/eos_gamma_law.out
2 changes: 1 addition & 1 deletion .github/workflows/find_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def find_files(SHAs=None):
if stderr is not None:
raise Exception('git diff encountered an error')

files = [f for f in stdout.decode('utf-8').strip().split('\n')
files = [f for f in stdout.decode('utf-8').strip().split('\n')
if f.startswith('networks/')]
print(files)

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/get_release_txt.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
txt = txt[m.end():].strip()
else:
txt = ""
# we now need to substitute characters in the string so that
# the action can deal with line breaks

# we now need to substitute characters in the string so that
# the action can deal with line breaks
txt = txt.replace('%', '%25')
txt = txt.replace('\n', '%0A')
txt = txt.replace('\r', '%0D')
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/macos_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ jobs:

- name: Install dependencies
run: |
brew install cmake openmpi python3
brew install cmake openmpi python3 || true
brew link --overwrite [email protected]
- name: Compile and run
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nse_net.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
- name: Compare to stored output (NSE_NET, ase)
run: |
cd unit_test/test_ase
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ase_nse_net_unit_test.out
2 changes: 1 addition & 1 deletion .github/workflows/nse_table.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ jobs:
- name: Compare to stored output (NSE, aprox19)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19_nse_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19_nse_unit_test.out
2 changes: 1 addition & 1 deletion .github/workflows/nse_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
- name: Compare to stored output (aprox21)
run: |
cd unit_test/test_nse
diff -I "^AMReX" -I "^reading in reaclib rates" -I "^0x" test.out ci-benchmarks/aprox21_ci.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" -I "^0x" test.out ci-benchmarks/aprox21_ci.out
22 changes: 22 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Style

on: [push, pull_request]

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

jobs:
tabs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Tabs
run: .github/workflows/style/check_tabs.sh

trailing_whitespaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Trailing Whitespaces
run: .github/workflows/style/check_trailing_whitespaces.sh
36 changes: 36 additions & 0 deletions .github/workflows/style/check_tabs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -eu -o pipefail

find . -type d \( -name .git \
-o -path ./paper \
-o -name build -o -name install \
-o -name tmp_build_dir -o -name tmp_install_dir \
\) -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" \
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \
-o -name "*.py" \
-o -name "*.md" -o -name "*.rst" \
-o -name "*.sh" \
-o -name "*.tex" \
-o -name "*.txt" \
-o -name "*.yml" \) \
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \) \
\) \
-exec grep -Iq . {} \; \
-exec sed -i 's/\t/\ \ \ \ /g' {} +

gitdiff=`git diff`

if [ -z "$gitdiff" ]
then
exit 0
else
echo -e "\nTabs are not allowed. Changes suggested by"
echo -e " ${0}\n"
git --no-pager diff
echo ""
exit 1
fi
38 changes: 38 additions & 0 deletions .github/workflows/style/check_trailing_whitespaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

set -eu -o pipefail

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 \
\) -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" \
-o -name "*.f" -o -name "*.F" -o -name "*.f90" -o -name "*.F90" \
-o -name "*.py" \
-o -name "*.rst" \
-o -name "*.sh" \
-o -name "*.tex" \
-o -name "*.txt" \
-o -name "*.yml" \) \
-a \( ! -name "*.tab.h" -a ! -name "*.tab.nolint.H" \
-a ! -name "*.lex.h" -a ! -name "*.lex.nolint.H" \
-a ! -path "./networks/*/reaclib_rates.H" \) \
\) \
-exec grep -Iq . {} \; \
-exec sed -i 's/[[:blank:]]\+$//g' {} +

gitdiff=`git diff`

if [ -z "$gitdiff" ]
then
exit 0
else
echo -e "\nTrailing whitespaces at the end of a line are not allowed. Changes suggested by"
echo -e " ${0}\n"
git --no-pager diff
echo ""
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/test_nse_interp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:
- name: Compare to stored output (NSE, aprox19)
run: |
cd unit_test/test_nse_interp
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox19.out
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
set(networkdir "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/")
set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template")

set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
set (gamma_law_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/gamma_law
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants PARENT_SCOPE)

execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkparamfile}
${VODEparamfile} ${integrationparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/)

set(gamma_law_sources ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces/eos_data.cpp
Expand All @@ -57,12 +57,12 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
set(networkheadertemplatefile "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/general_null/network_header.template")

#DO NOT change the order of the directories below!
set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils
set (primordial_chem_dirs ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/gcem/include
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/VODE ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration/utils
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/integration ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/interfaces
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/EOS/primordial_chem
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks/primordial_chem ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/networks
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/constants
PARENT_SCOPE)

#we need to have extern_parameters.cpp be available at configure time
Expand All @@ -72,11 +72,11 @@ function(setup_target_for_microphysics_compilation network_name output_dir)
#to generate updated header files

if(BUILD_UNIT_TEST)
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${paramfile} ${EOSparamfile}
${networkpcparamfile} ${networkparamfile} ${VODEparamfile} ${integrationparamfile} ${unittestparamfile}" --use_namespace WORKING_DIRECTORY ${output_dir}/)
else()
#do not need paramfile and unittestparamfile
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile}
execute_process(COMMAND python3 "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/util/build_scripts/write_probin.py" --pa "${EOSparamfile} ${networkpcparamfile}
${networkparamfile} ${VODEparamfile} ${integrationparamfile} " --use_namespace WORKING_DIRECTORY ${output_dir}/)
endif()

Expand Down
2 changes: 1 addition & 1 deletion EOS/breakout/actual_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void actual_eos (I input, T& state)
}
}

// Try to avoid the expensive log function. Since we don't need entropy
// Try to avoid the expensive log function. Since we don't need entropy
// in hydro solver, set it to an invalid but "nice" value for the plotfile.
if constexpr (has_entropy<T>::value) {
state.s = 1.0_rt;
Expand Down
2 changes: 1 addition & 1 deletion EOS/eos_composition.H
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct eos_xderivs_t {
/// The auxiliary state provides an alternate description to the composition,
/// in terms of Ye, abar, and binding energy / nucleon
///
template <class state_t>
template <class state_t>
AMREX_GPU_HOST_DEVICE AMREX_INLINE
void set_aux_comp_from_X(state_t& state) {

Expand Down
Loading

0 comments on commit 5d4215f

Please sign in to comment.