diff --git a/.github/workflows/dependencies/dependencies_hip.sh b/.github/workflows/dependencies/dependencies_hip.sh index 527379e7e8..76a2abd04c 100755 --- a/.github/workflows/dependencies/dependencies_hip.sh +++ b/.github/workflows/dependencies/dependencies_hip.sh @@ -33,7 +33,9 @@ sudo apt-key add rocm.gpg.key source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ... -echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \ +VERSION=${1-6.3.2} + +echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${VERSION} ${UBUNTU_CODENAME} main" \ | sudo tee /etc/apt/sources.list.d/rocm.list echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \ | sudo tee -a /etc/profile.d/rocm.sh @@ -53,16 +55,16 @@ sudo apt-get install -y --no-install-recommends \ libnuma-dev \ libopenmpi-dev \ openmpi-bin \ - rocm-dev \ - roctracer-dev \ - rocprofiler-dev \ - rocrand-dev \ - rocfft-dev \ - rocprim-dev \ - rocsparse-dev + rocm-dev${VERSION} \ + roctracer-dev${VERSION} \ + rocprofiler-dev${VERSION} \ + rocrand-dev${VERSION} \ + rocfft-dev${VERSION} \ + rocprim-dev${VERSION} \ + rocsparse-dev${VERSION} # hiprand-dev is a new package that does not exist in old versions -sudo apt-get install -y --no-install-recommends hiprand-dev || true +sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true # activate # diff --git a/.github/workflows/hip.yml b/.github/workflows/hip.yml index c688bf43b2..cfbc53d3a5 100644 --- a/.github/workflows/hip.yml +++ b/.github/workflows/hip.yml @@ -8,7 +8,7 @@ concurrency: jobs: hip-compile: - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: @@ -24,7 +24,7 @@ jobs: cd ../.. - name: Dependencies - run: .github/workflows/dependencies/dependencies_hip.sh + run: .github/workflows/dependencies/dependencies_hip.sh 6.3.2 - name: compile flame_wave run: | diff --git a/Docs/source/build_system.rst b/Docs/source/build_system.rst index 832315fe51..2949b2bcf1 100644 --- a/Docs/source/build_system.rst +++ b/Docs/source/build_system.rst @@ -135,12 +135,8 @@ Microphysics Parameters .. index:: USE_REACT, general_null, GENERAL_NET_INPUTS, NETWORK_DIR, INTEGRATOR_DIR - * ``USE_REACT_SPARSE_JACOBIAN`` - - * ``USE_SPARSE_STOP_ON_OOB`` - - * ``EOS_DIR``: the equation of state to use. This will be a subdirectory under the - Microphysics repo. + * ``EOS_DIR``: the equation of state to use. This will be a subdirectory under the + Microphysics repo. .. index:: EOS_DIR @@ -275,5 +271,3 @@ This is the current build system process. For all of this to work, we need the ``tmp_build_dir/s`` directory to be first in the vpath, so our modified sources are found and used. - - diff --git a/Exec/Make.Castro b/Exec/Make.Castro index 106ef51cc0..e940acd2eb 100644 --- a/Exec/Make.Castro +++ b/Exec/Make.Castro @@ -201,17 +201,6 @@ ifeq ($(USE_REACT), TRUE) DEFINES += -DREACTIONS endif -ifeq ($(USE_REACT_SPARSE_JACOBIAN), TRUE) - DEFINES += -DREACT_SPARSE_JACOBIAN - - # The following is sometimes useful to turn on for debugging sparse J indices - # (if a get/set/scale is called with (row, col) not in the sparse J, stop) - # Otherwise, set/scale do nothing, and get returns 0. - ifeq ($(USE_SPARSE_STOP_ON_OOB), TRUE) - DEFINES += -DSPARSE_STOP_ON_OOB - endif -endif - ifeq ($(USE_SIMPLIFIED_SDC), TRUE) DEFINES += -DSDC_EVOLVE_ENERGY endif diff --git a/Exec/science/Detonation/GNUmakefile b/Exec/science/Detonation/GNUmakefile index c6e1b2b7b4..90c7e6402b 100644 --- a/Exec/science/Detonation/GNUmakefile +++ b/Exec/science/Detonation/GNUmakefile @@ -18,7 +18,7 @@ EOS_DIR := helmholtz # This sets the network directory in $(MICROPHYSICS_HOME)/networks ifeq ($(USE_NSE_NET), TRUE) - NETWORK_DIR := subch_base + NETWORK_DIR := he-burn/he-burn-18a SCREEN_METHOD := chabrier1998 else NETWORK_DIR := aprox19 diff --git a/Exec/science/subch_planar/GNUmakefile b/Exec/science/subch_planar/GNUmakefile index 898951ba62..9c7bb847f0 100644 --- a/Exec/science/subch_planar/GNUmakefile +++ b/Exec/science/subch_planar/GNUmakefile @@ -25,7 +25,7 @@ CASTRO_HOME ?= ../../.. EOS_DIR := helmholtz # This sets the network directory in $(MICROPHYSICS_HOME)/networks -NETWORK_DIR := subch_simple +NETWORK_DIR := he-burn/he-burn-22a PROBLEM_DIR ?= ./ diff --git a/Exec/science/subchandra/GNUmakefile b/Exec/science/subchandra/GNUmakefile index 1494696929..af31bf1fe2 100644 --- a/Exec/science/subchandra/GNUmakefile +++ b/Exec/science/subchandra/GNUmakefile @@ -23,7 +23,7 @@ USE_SIMPLIFIED_SDC=TRUE EOS_DIR := helmholtz # This sets the network directory in $(MICROPHYSICS_HOME)/networks -NETWORK_DIR := subch_simple +NETWORK_DIR := he-burn/he-burn-22a INTEGRATOR_DIR := VODE diff --git a/Exec/science/subchandra/GNUmakefile.nse_net b/Exec/science/subchandra/GNUmakefile.nse_net index 4d9a915466..ab75c47ebf 100644 --- a/Exec/science/subchandra/GNUmakefile.nse_net +++ b/Exec/science/subchandra/GNUmakefile.nse_net @@ -23,7 +23,7 @@ USE_MODEL_PARSER = TRUE EOS_DIR := helmholtz # This sets the network directory in $(MICROPHYSICS_HOME)/networks -NETWORK_DIR := subch_base +NETWORK_DIR := he-burn/he-burn-18a SCREEN_METHOD = chabrier1998 INTEGRATOR_DIR := VODE diff --git a/Exec/science/xrb_spherical/GNUmakefile b/Exec/science/xrb_spherical/GNUmakefile index 503eba0065..40a9e565df 100644 --- a/Exec/science/xrb_spherical/GNUmakefile +++ b/Exec/science/xrb_spherical/GNUmakefile @@ -26,7 +26,7 @@ NUM_MODELS := 2 EOS_DIR := helmholtz # This sets the network directory in $(MICROPHYSICS_HOME)/networks -NETWORK_DIR := subch_base +NETWORK_DIR := he-burn/he-burn-18a INTEGRATOR_DIR := VODE diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 7b9db57de3..fbfe8b1e11 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -4490,7 +4490,7 @@ Castro::check_for_nan(const MultiFab& state_in, int check_ghost) } if (state_in.contains_nan(URHO,state_in.nComp(),ng,true)) { -#ifdef AMREX_USE_GPU +#if defined(AMREX_USE_GPU) && !defined(ALLOW_GPU_PRINTF) std::string abort_string = std::string("State has NaNs in check_for_nan()"); amrex::Abort(abort_string.c_str()); #else diff --git a/Source/hydro/Castro_ctu.cpp b/Source/hydro/Castro_ctu.cpp index 18756b0b71..fa8948b4eb 100644 --- a/Source/hydro/Castro_ctu.cpp +++ b/Source/hydro/Castro_ctu.cpp @@ -375,8 +375,8 @@ Castro::add_sdc_source_to_states(const Box& bx, const int idir, const Real dt, if (n >= QFS && n <= QFS-1+NumSpec) { // mass fractions should be in [0, 1] - qleft(i,j,k,n) = std::clamp(qleft(i,j,k,n), 0.0_rt, 1.0_rt); - qright(i,j,k,n) = std::clamp(qright(i,j,k,n), 0.0_rt, 1.0_rt); + qleft(i,j,k,n) = amrex::Clamp(qleft(i,j,k,n), 0.0_rt, 1.0_rt); + qright(i,j,k,n) = amrex::Clamp(qright(i,j,k,n), 0.0_rt, 1.0_rt); } } diff --git a/Source/hydro/HLL_solvers.H b/Source/hydro/HLL_solvers.H index fac0706bd4..db482790f8 100644 --- a/Source/hydro/HLL_solvers.H +++ b/Source/hydro/HLL_solvers.H @@ -488,7 +488,7 @@ namespace HLL { } Real frac = (1.0_rt + (spout + spin)/scr)*0.5_rt; - frac = std::clamp(frac, 0.0_rt, 1.0_rt); + frac = amrex::Clamp(frac, 0.0_rt, 1.0_rt); Real qint[NQ] = {0.0}; diff --git a/Source/hydro/flatten.H b/Source/hydro/flatten.H index 9664ab56c1..6e25a21db0 100644 --- a/Source/hydro/flatten.H +++ b/Source/hydro/flatten.H @@ -24,7 +24,7 @@ Real flatten(int i, int j, int k, Real denom = std::max(small_pres, std::abs(q_arr(i+2,j,k,pres_comp) - q_arr(i-2,j,k,pres_comp))); Real zeta = std::abs(dp) / denom; - Real z = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + Real z = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); Real tst = 0.0_rt; if (q_arr(i-1,j,k,QU) - q_arr(i+1,j,k,QU) >= 0.0_rt) { @@ -43,7 +43,7 @@ Real flatten(int i, int j, int k, denom = std::max(small_pres, std::abs(q_arr(i+2-ishft,j,k,pres_comp)-q_arr(i-2-ishft,j,k,pres_comp))); zeta = std::abs(dp) / denom; - Real z2 = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + Real z2 = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); tst = 0.0_rt; if (q_arr(i-1-ishft,j,k,QU) - q_arr(i+1-ishft,j,k,QU) >= 0.0_rt) { @@ -69,7 +69,7 @@ Real flatten(int i, int j, int k, denom = std::max(small_pres, std::abs(q_arr(i,j+2,k,pres_comp) - q_arr(i,j-2,k,pres_comp))); zeta = std::abs(dp) / denom; - z = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + z = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); tst = 0.0_rt; if (q_arr(i,j-1,k,QV) - q_arr(i,j+1,k,QV) >= 0.0_rt) { @@ -88,7 +88,7 @@ Real flatten(int i, int j, int k, denom = std::max(small_pres, std::abs(q_arr(i,j+2-ishft,k,pres_comp) - q_arr(i,j-2-ishft,k,pres_comp))); zeta = std::abs(dp) / denom; - z2 = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + z2 = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); tst = 0.0_rt; if (q_arr(i,j-1-ishft,k,QV) - q_arr(i,j+1-ishft,k,QV) >= 0.0_rt) { @@ -115,7 +115,7 @@ Real flatten(int i, int j, int k, denom = std::max(small_pres, std::abs(q_arr(i,j,k+2,pres_comp) - q_arr(i,j,k-2,pres_comp))); zeta = std::abs(dp) / denom; - z = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + z = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); tst = 0.0_rt; if (q_arr(i,j,k-1,QW) - q_arr(i,j,k+1,QW) >= 0.0_rt) { @@ -134,7 +134,7 @@ Real flatten(int i, int j, int k, denom = std::max(small_pres, std::abs(q_arr(i,j,k+2-ishft,pres_comp) - q_arr(i,j,k-2-ishft,pres_comp))); zeta = std::abs(dp) / denom; - z2 = std::clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); + z2 = amrex::Clamp(dzcut * (zeta - zcut1), 0.0_rt, 1.0_rt); tst = 0.0_rt; if (q_arr(i,j,k-1-ishft,QW) - q_arr(i,j,k+1-ishft,QW) >= 0.0_rt) { diff --git a/Source/hydro/ppm.H b/Source/hydro/ppm.H index 53202100b8..de67432033 100644 --- a/Source/hydro/ppm.H +++ b/Source/hydro/ppm.H @@ -87,7 +87,7 @@ ppm_reconstruct(const amrex::Real* s, // Make sure sedge lies in between adjacent cell-centered values - sm = std::clamp(sm, std::min(s[i0], s[im1]), std::max(s[i0], s[im1])); + sm = amrex::Clamp(sm, std::min(s[i0], s[im1]), std::max(s[i0], s[im1])); // Compute van Leer slopes @@ -115,7 +115,7 @@ ppm_reconstruct(const amrex::Real* s, // Make sure sedge lies in between adjacent cell-centered values - sp = std::clamp(sp, std::min(s[ip1], s[i0]), std::max(s[ip1], s[i0])); + sp = amrex::Clamp(sp, std::min(s[ip1], s[i0]), std::max(s[ip1], s[i0])); // Flatten the parabola diff --git a/Source/hydro/riemann_2shock_solvers.H b/Source/hydro/riemann_2shock_solvers.H index 4014ad9332..d21046b417 100644 --- a/Source/hydro/riemann_2shock_solvers.H +++ b/Source/hydro/riemann_2shock_solvers.H @@ -29,7 +29,7 @@ namespace TwoShock { // CG Eq. 31 gstar = (pstar-p)*gdot/(pstar+p) + gam; - gstar = std::clamp(gstar, gmin, gmax); + gstar = amrex::Clamp(gstar, gmin, gmax); // Now use that predicted value of game with the R-H jump conditions // to compute the wave speed. @@ -666,7 +666,7 @@ namespace TwoShock { // interpolate for the case that we are in a rarefaction amrex::Real frac = (1.0_rt + (spout + spin)/scr)*0.5_rt; - frac = std::clamp(frac, 0.0_rt, 1.0_rt); + frac = amrex::Clamp(frac, 0.0_rt, 1.0_rt); qint.rho = frac*rstar + (1.0_rt - frac)*ro; qint.un = frac*ustar + (1.0_rt - frac)*uo; diff --git a/Source/sdc/sdc_react_util.H b/Source/sdc/sdc_react_util.H index b174dd8d03..11e6660a11 100644 --- a/Source/sdc/sdc_react_util.H +++ b/Source/sdc/sdc_react_util.H @@ -35,7 +35,7 @@ single_zone_react_source(burn_t& burn_state, eos(eos_input_re, burn_state); // eos_get_small_temp(&small_temp); - burn_state.T = std::clamp(burn_state.T, small_temp, integrator_rp::MAX_TEMP); + burn_state.T = amrex::Clamp(burn_state.T, small_temp, integrator_rp::MAX_TEMP); Array1D ydot; diff --git a/Util/exact_riemann/exact_riemann_shock.H b/Util/exact_riemann/exact_riemann_shock.H index 5cf4e5efe0..c1a2d2af46 100644 --- a/Util/exact_riemann/exact_riemann_shock.H +++ b/Util/exact_riemann/exact_riemann_shock.H @@ -76,7 +76,7 @@ newton_shock(amrex::Real& W_s, const amrex::Real pstar, converged = true; } - W_s = std::clamp(W_s + dW, 0.5_rt * W_s, 2.0_rt * W_s); + W_s = amrex::Clamp(W_s + dW, 0.5_rt * W_s, 2.0_rt * W_s); // store some history diff --git a/Util/exact_riemann/exact_riemann_star_state.H b/Util/exact_riemann/exact_riemann_star_state.H index 7a421c1512..4452a4154e 100644 --- a/Util/exact_riemann/exact_riemann_star_state.H +++ b/Util/exact_riemann/exact_riemann_star_state.H @@ -149,7 +149,7 @@ riemann_star_state(const amrex::Real rho_l, const amrex::Real u_l, const amrex:: } // get ready for the next iteration - pstar = std::clamp(pstar_new, 0.5 * pstar, 2.0 * pstar); + pstar = amrex::Clamp(pstar_new, 0.5 * pstar, 2.0 * pstar); iter++; } diff --git a/Util/model_parser/model_parser.H b/Util/model_parser/model_parser.H index db9f4e522b..eef0a27736 100644 --- a/Util/model_parser/model_parser.H +++ b/Util/model_parser/model_parser.H @@ -129,7 +129,7 @@ interpolate(const Real r, const int var_index, const int model_index=0) { model::profile(model_index).state(id, var_index)); Real maxvar = std::max(model::profile(model_index).state(id+1, var_index), model::profile(model_index).state(id, var_index)); - interp = std::clamp(interp, minvar, maxvar); + interp = amrex::Clamp(interp, minvar, maxvar); } return interp; diff --git a/Util/model_parser/test/GNUmakefile b/Util/model_parser/test/GNUmakefile index 8aa5ab5080..78dc22960c 100644 --- a/Util/model_parser/test/GNUmakefile +++ b/Util/model_parser/test/GNUmakefile @@ -23,7 +23,7 @@ NUM_MODELS := 2 EOS_DIR := helmholtz # This sets the network directory in Castro/Networks -NETWORK_DIR := subch_simple +NETWORK_DIR := he-burn/he-burn-22a EXTERN_SEARCH += .