Skip to content

Commit

Permalink
Merge branch 'development' into front_tracker_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
yut23 committed Feb 20, 2025
2 parents a363603 + 82feac2 commit 6ff24e5
Show file tree
Hide file tree
Showing 20 changed files with 39 additions and 54 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/dependencies/dependencies_hip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
#
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency:

jobs:
hip-compile:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -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: |
Expand Down
10 changes: 2 additions & 8 deletions Docs/source/build_system.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.


11 changes: 0 additions & 11 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/Detonation/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/subch_planar/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 ?= ./

Expand Down
2 changes: 1 addition & 1 deletion Exec/science/subchandra/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Exec/science/subchandra/GNUmakefile.nse_net
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/xrb_spherical/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/Castro_ctu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/hydro/HLL_solvers.H
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down
12 changes: 6 additions & 6 deletions Source/hydro/flatten.H
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/ppm.H
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Source/hydro/riemann_2shock_solvers.H
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/sdc/sdc_react_util.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real, 1, neqs> ydot;

Expand Down
2 changes: 1 addition & 1 deletion Util/exact_riemann/exact_riemann_shock.H
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Util/exact_riemann/exact_riemann_star_state.H
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
2 changes: 1 addition & 1 deletion Util/model_parser/model_parser.H
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Util/model_parser/test/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 += .

Expand Down

0 comments on commit 6ff24e5

Please sign in to comment.