Skip to content

Commit

Permalink
Merge branch 'development' into doc-fixes-1
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Nov 25, 2024
2 parents d2260b7 + 3ceedde commit 06d5e86
Show file tree
Hide file tree
Showing 25 changed files with 92 additions and 41 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Checks: >
-misc-include-cleaner,
-misc-non-private-member-variables-in-classes,
-misc-use-anonymous-namespace,
-misc-use-internal-linkage,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-use-trailing-return-type,
Expand All @@ -29,12 +30,14 @@ Checks: >
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-else-after-return,
-readability-enum-initial-value,
-readability-function-cognitive-complexity,
-readability-function-size,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-math-missing-parentheses,
-readability-named-parameter,
-readability-simplify-boolean-expr,
mpi-*,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_metal_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Compile
run: |
cd unit_test/burn_cell_metal_chem
make -j 2
make -j 4
- name: Run and compare outputs for different Z values, also including cosmic ray ionization
run: |
Expand Down
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 @@ -31,7 +31,7 @@ jobs:
- name: Compile and run
run: |
cd unit_test/burn_cell_primordial_chem
make -j 2
make -j 4
./main1d.gnu.DEBUG.ex inputs_primordial_chem amrex.fpe_trap_{invalid,zero,overflow}=1 > test.out
- name: Print backtrace
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: AMReX-Astro/cpp-linter-action@main
with:
build_path: 'unit_test/test_react'
make_options: '-j 2 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
make_options: '-j 4 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
ignore_files: 'amrex|util/gcem'
header_filter: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./).*\.H$'
config_file: ${GITHUB_WORKSPACE}/.clang-tidy
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/castro-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/flame_wave/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand All @@ -64,7 +64,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/subchandra/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/castro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/flame_wave/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand All @@ -68,7 +68,7 @@ jobs:
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/subchandra/
make -j2 CCACHE=ccache USE_MPI=FALSE
make -j 4 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
6 changes: 3 additions & 3 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
- name: compile test_react (ignition_reaclib/URCA-simple)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make realclean
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
- name: compile test_nse_net (ase)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_nse_net
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 4
2 changes: 1 addition & 1 deletion .github/workflows/macos_build_cell_metal_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST_MC=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/macos_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST_PC=true -DBUILD_AMReX=true
make -j2
make -j 4
ctest --output-on-failure
2 changes: 1 addition & 1 deletion .github/workflows/test_neutrinos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Compile
run: |
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test_partition_functions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: test_partition_functions

on: [pull_request]
jobs:
test_partition_functions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get AMReX
run: |
mkdir external
cd external
git clone https://github.com/AMReX-Codes/amrex.git
cd amrex
git checkout development
echo 'AMREX_HOME=$(GITHUB_WORKSPACE)/external/amrex' >> $GITHUB_ENV
echo $AMREX_HOME
if [[ -n "${AMREX_HOME}" ]]; then exit 1; fi
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
run: |
cd unit_test/test_part_func
make clean
make -j 4
- name: Run test_part_func
run: |
cd unit_test/test_part_func
./main3d.gnu.ex > test.out
- name: Compare to stored output
run: |
cd unit_test/test_part_func
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/part_func.out
2 changes: 1 addition & 1 deletion .github/workflows/test_rhs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Compile, test_rhs (VODE, ignition_simple)
run: |
Expand Down
10 changes: 3 additions & 7 deletions integration/VODE/vode_dvhin.H
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,13 @@ void dvhin (BurnT& state, DvodeT& vstate, amrex::Real& H0, int& NITER, int& IER)

}

// Iteration done. Apply bounds, bias factor, and sign. Then exit.
// Iteration done. Apply bounds and bias factor. Then exit.
H0 = hnew * 0.5_rt;
if (H0 < HLB) {
H0 = HLB;
}
if (H0 > HUB) {
H0 = HUB;
}
H0 = std::clamp(H0, HLB, HUB);

}

// apply sign
H0 = std::copysign(H0, vstate.tout - vstate.t);
NITER = iter;
IER = 0;
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox13/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates: std::uint8_t {
He4_He4_He4_to_C12 = 1,
C12_He4_to_O16,
C12_C12_to_Ne20_He4,
Expand Down
2 changes: 1 addition & 1 deletion networks/aprox21/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates : std::uint8_t {
H1_H1_to_He3 = 1,
H1_H1_H1_to_He3,
P_to_N,
Expand Down
2 changes: 1 addition & 1 deletion networks/iso7/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ namespace NSE_INDEX
#endif

namespace Rates {
enum NetworkRates {
enum NetworkRates : std::uint8_t {
C12_He4_to_O16 = 1,
He4_He4_He4_to_C12,
C12_C12_to_Ne20_He4,
Expand Down
2 changes: 1 addition & 1 deletion networks/rprox/actual_network.H
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ namespace network

namespace Rates
{
enum NetworkRates
enum NetworkRates : std::uint8_t
{
He4_He4_He4_to_C12 = 1,
C12_H1_to_N13,
Expand Down
3 changes: 0 additions & 3 deletions networks/subch_base/subch_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ def doit():
net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47", "mn51", "co55"])
net.remove_nuclei(["cl35", "k39", "sc43", "v47", "mn51", "co55"])

# finally, the aprox nets don't include the reverse rates for
# C12+C12, C12+O16, and O16+O16, so remove those

print(f"number of nuclei: {len(net.unique_nuclei)}")
print(f"number of rates: {len(net.rates)}")

Expand Down
3 changes: 0 additions & 3 deletions networks/subch_simple/subch_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ def doit():
net.make_ap_pg_approx(intermediate_nuclei=["cl35", "k39", "sc43", "v47", "mn51", "co55"])
net.remove_nuclei(["cl35", "k39", "sc43", "v47", "mn51", "co55"])

# finally, the aprox nets don't include the reverse rates for
# C12+C12, C12+O16, and O16+O16, so remove those

print(f"number of nuclei: {len(net.unique_nuclei)}")
print(f"number of rates: {len(net.rates)}")

Expand Down
8 changes: 4 additions & 4 deletions nse_tabular/nse_eos.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nse_T_abar_from_e(const amrex::Real rho, const amrex::Real e_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for T
eos_extra_t eos_state;
eos_re_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -156,7 +156,7 @@ nse_rho_abar_from_e(const amrex::Real T, const amrex::Real e_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for rho
eos_extra_t eos_state;
eos_re_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -247,7 +247,7 @@ nse_T_abar_from_p(const amrex::Real rho, const amrex::Real p_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for T
eos_extra_t eos_state;
eos_rep_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down Expand Up @@ -338,7 +338,7 @@ nse_rho_abar_from_p(const amrex::Real T, const amrex::Real p_in, const amrex::Re
amrex::Real abar_old = nse_state.abar;

// call the EOS with the initial guess for rho
eos_extra_t eos_state;
eos_rep_extra_t eos_state;
eos_state.rho = rho;
eos_state.T = T;
eos_state.aux[iye] = Ye;
Expand Down
2 changes: 1 addition & 1 deletion unit_test/burn_cell/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EOS_DIR := helmholtz

# This sets the network directory
NETWORK_DIR := aprox13

SCREEN_METHOD := screen5
CONDUCTIVITY_DIR := stellar

INTEGRATOR_DIR = VODE
Expand Down
2 changes: 2 additions & 0 deletions unit_test/burn_cell/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ density real 1.e7
temperature real 3.e9

skip_initial_normalization bool 0

init_species_all_equal bool 0
11 changes: 7 additions & 4 deletions unit_test/burn_cell/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ void burn_cell_c()
// Make sure user set all the mass fractions to values in the interval [0, 1]
for (int n = 1; n <= NumSpec; ++n) {

massfractions[n-1] = get_xn(n);
if (unit_test_rp::init_species_all_equal) {
massfractions[n-1] = 1.0_rt / static_cast<amrex::Real>(NumSpec);
} else {
massfractions[n-1] = get_xn(n);

if (massfractions[n-1] < 0 || massfractions[n-1] > 1) {
amrex::Error("mass fraction for " + short_spec_names_cxx[n-1] + " not initialized in the interval [0,1]!");
if (massfractions[n-1] < 0 || massfractions[n-1] > 1) {
amrex::Error("mass fraction for " + short_spec_names_cxx[n-1] + " not initialized in the interval [0,1]!");
}
}

}

// Echo initial conditions at burn and fill burn state input
Expand Down
9 changes: 9 additions & 0 deletions unit_test/test_part_func/ci-benchmarks/part_func.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Initializing AMReX (24.10-20-gb9d549bcf4a6)...
AMReX (24.10-20-gb9d549bcf4a6) initialized
starting the single zone burn...
reading in network electron-capture / beta-decay tables...
temperature = 5000000000
Ni56: 1.010868 2.337172328e-11
Fe52: 1.743116 3.226066771e-10
spins: 2 1 1 8 1
AMReX (24.10-20-gb9d549bcf4a6) finalized

0 comments on commit 06d5e86

Please sign in to comment.