Skip to content

Commit

Permalink
Merge branch 'development' of ssh://github.com/AMReX-Astro/Castro int…
Browse files Browse the repository at this point in the history
…o development
  • Loading branch information
zingale committed Dec 18, 2023
2 parents 6f2aa14 + e65b3b9 commit de72a2a
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 146 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/dependencies_hip.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
#!/usr/bin/env bash
#
# Copyright 2020-2022 The AMReX Community
# Copyright 2020 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

# search recursive inside a folder if a file contains tabs
#
# @result 0 if no files are found, else 1
#

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#ubuntu
curl -O https://repo.radeon.com/rocm/rocm.gpg.key
sudo apt-key add rocm.gpg.key
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' \
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-debian}/ ubuntu 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 @@ -34,12 +43,14 @@ sudo apt-get install -y --no-install-recommends \
roctracer-dev \
rocprofiler-dev \
rocrand-dev \
rocprim-dev
rocprim-dev \
hiprand-dev

# activate
#
source /etc/profile.d/rocm.sh
hipcc --version
hipconfig --full
which clang
which clang++
which flang
4 changes: 4 additions & 0 deletions Exec/Make.Castro
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ ifeq ($(USE_ROTATION), TRUE)
DEFINES += -DROTATION
endif

ifeq ($(USE_SPECIES_SOURCES), TRUE)
DEFINES += -DCONS_SPECIES_HAVE_SOURCES
endif

ifeq ($(USE_PARTICLES), TRUE)
Bdirs += Source/particles
endif
Expand Down
15 changes: 5 additions & 10 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1260,8 +1260,7 @@ Castro::initData ()
{
const Box& box = mfi.validbox();

tmp.resize(box, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(box, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

make_fourth_in_place(box, Sborder.array(mfi), tmp_arr, domain_lo, domain_hi);
Expand All @@ -1287,8 +1286,7 @@ Castro::initData ()
{
const Box& box = mfi.growntilebox(2);

tmp.resize(box, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(box, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

make_cell_center_in_place(box, Sborder.array(mfi), tmp_arr, domain_lo, domain_hi);
Expand Down Expand Up @@ -1336,8 +1334,7 @@ Castro::initData ()
{
const Box& box = mfi.validbox();

tmp.resize(box, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(box, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

make_fourth_in_place(box, Sborder.array(mfi), tmp_arr, domain_lo, domain_hi);
Expand Down Expand Up @@ -3950,8 +3947,7 @@ Castro::computeTemp(
compute_lap_term(bx0, Stemp.array(mfi), Eint_lap.array(mfi), UEINT,
domain_lo, domain_hi);

tmp.resize(bx, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(bx, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

make_cell_center_in_place(bx, Stemp.array(mfi), tmp_arr, domain_lo, domain_hi);
Expand Down Expand Up @@ -4067,8 +4063,7 @@ Castro::computeTemp(

const Box& bx = mfi.tilebox();

tmp.resize(bx, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(bx, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

// only temperature
Expand Down
9 changes: 3 additions & 6 deletions Source/driver/Castro_advance_sdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ Castro::do_advance_sdc (Real time,
for (MFIter mfi(S_new); mfi.isValid(); ++mfi) {
const Box& bx = mfi.tilebox();

tmp.resize(bx, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(bx, 1, The_Async_Arena());
auto tmp_arr = tmp.array();

make_fourth_in_place(bx, old_source.array(mfi), tmp_arr, domain_lo, domain_hi);
Expand Down Expand Up @@ -305,8 +304,7 @@ Castro::do_advance_sdc (Real time,
// pass in the reaction source at centers (Sburn_arr), including
// one ghost cell and derive everything that is needed including
// 1 ghost cell
R_center.resize(obx, R_new.nComp());
Elixir elix_r_center = R_center.elixir();
R_center.resize(obx, R_new.nComp(), The_Async_Arena());
auto const R_center_arr = R_center.array();

Array4<const Real> const Sburn_arr = Sburn.array(mfi);
Expand All @@ -315,8 +313,7 @@ Castro::do_advance_sdc (Real time,
ca_store_reaction_state(obx, Sburn_arr, R_center_arr);

// convert R_new from centers to averages in place
tmp.resize(bx, 1);
Elixir elix_tmp = tmp.elixir();
tmp.resize(bx, 1, The_Async_Arena());
auto const tmp_arr = tmp.array();

make_fourth_in_place(bx, R_center_arr, tmp_arr, domain_lo, domain_hi);
Expand Down
3 changes: 1 addition & 2 deletions Source/driver/Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ extern "C"
const Box& obx = amrex::grow(bx, 1);

FArrayBox coeff_cc;
coeff_cc.resize(obx, 1);
Elixir elix_coeff_cc = coeff_cc.elixir();
coeff_cc.resize(obx, 1, The_Async_Arena());
Array4<Real> const coeff_arr = coeff_cc.array();

auto const dat = datfab.array();
Expand Down
4 changes: 3 additions & 1 deletion Source/driver/_cpp_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ hybrid_hydro int 0
# reconstruction type:
# 0: piecewise linear;
# 1: classic Colella \& Woodward ppm;
# 2: extrema-preserving ppm
ppm_type int 1

# do we limit the ppm parabola?
ppm_do_limiting int 1

# For MHD + PLM, do we limit on characteristic or primitive variables
mhd_limit_characteristic int 1

Expand Down
6 changes: 3 additions & 3 deletions Source/driver/_variables
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
energy-density UEDEN NSRC 1 None
internal-energy UEINT NSRC 1 None
temperature UTEMP NSRC 1 None
advected UFA None NumAdv None
species UFS None NumSpec None
auxiliary UFX None NumAux None
advected UFA [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumAdv None
species UFS [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumSpec None
auxiliary UFX [(NSRC, CONS_SPECIES_HAVE_SOURCES)] NumAux None
shock USHK None 1 SHOCK_VAR
mu_p UMUP None 1 NSE_NET
mu_n UMUN None 1 NSE_NET
Expand Down
Loading

0 comments on commit de72a2a

Please sign in to comment.