Skip to content

Commit a7e65c4

Browse files
committed
Merge branch 'development' into remove_old_fortran_make
2 parents d541ea3 + 5886c9c commit a7e65c4

File tree

41 files changed

+115
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+115
-143
lines changed

.github/workflows/dependencies/dependencies_hip.sh

+11-9
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ sudo apt-key add rocm.gpg.key
3333

3434
source /etc/os-release # set UBUNTU_CODENAME: focal or jammy or ...
3535

36-
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${1-latest} ${UBUNTU_CODENAME} main" \
36+
VERSION=${1-6.3.2}
37+
38+
echo "deb [arch=amd64] https://repo.radeon.com/rocm/apt/${VERSION} ${UBUNTU_CODENAME} main" \
3739
| sudo tee /etc/apt/sources.list.d/rocm.list
3840
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' \
3941
| sudo tee -a /etc/profile.d/rocm.sh
@@ -53,16 +55,16 @@ sudo apt-get install -y --no-install-recommends \
5355
libnuma-dev \
5456
libopenmpi-dev \
5557
openmpi-bin \
56-
rocm-dev \
57-
roctracer-dev \
58-
rocprofiler-dev \
59-
rocrand-dev \
60-
rocfft-dev \
61-
rocprim-dev \
62-
rocsparse-dev
58+
rocm-dev${VERSION} \
59+
roctracer-dev${VERSION} \
60+
rocprofiler-dev${VERSION} \
61+
rocrand-dev${VERSION} \
62+
rocfft-dev${VERSION} \
63+
rocprim-dev${VERSION} \
64+
rocsparse-dev${VERSION}
6365

6466
# hiprand-dev is a new package that does not exist in old versions
65-
sudo apt-get install -y --no-install-recommends hiprand-dev || true
67+
sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true
6668

6769
# activate
6870
#

.github/workflows/hip.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ concurrency:
88

99
jobs:
1010
hip-compile:
11-
runs-on: ubuntu-20.04
11+
runs-on: ubuntu-24.04
1212
steps:
1313
- uses: actions/checkout@v4
1414
with:
@@ -27,7 +27,7 @@ jobs:
2727
cd ../..
2828
2929
- name: Dependencies
30-
run: .github/workflows/dependencies/dependencies_hip.sh
30+
run: .github/workflows/dependencies/dependencies_hip.sh 6.3.2
3131

3232
- name: compile test_react with HIP (iso7)
3333
run: |

Docs/source/burn_cell.rst

+4-26
Original file line numberDiff line numberDiff line change
@@ -52,39 +52,17 @@ The parameters that affect the thermodynamics are:
5252

5353
* ``unit_test.temperature`` : the initial temperature
5454

55-
* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state
55+
The composition can be set either by specifying individual mass fractions
56+
or setting ``unit_test.uniform_xn`` as described in :ref:`sec:defining_unit_test_composition`.
5657

57-
* ``unit_test.small_dens`` : the low density cutoff used in the equation of state
58-
59-
The composition can be set either by setting each mass fraction explicitly via the
60-
parameters, ``unit_test.X1``, ``unit_test.X2``, ...,
61-
e.g.:
62-
63-
::
64-
65-
unit_test.X1 = 0.5
66-
unit_test.X2 = 0.2
67-
unit_test.X3 = 0.2
68-
unit_test.X4 = 0.1
69-
70-
where parameters up to ``X35`` are available. If the values don't sum to ``1``
71-
initially, then the test will do a normalization. This normalization can be
72-
disabled by setting:
58+
If the values don't sum to ``1`` initially, then the test will do a
59+
normalization. This normalization can be disabled by setting:
7360

7461
::
7562

7663
unit_test.skip_initial_normalization = 1
7764

7865

79-
Alternately, the composition can be set automatically by initializing all
80-
of the mass fractions equally (to $1/N$, where $N$ is the number of species),
81-
by setting:
82-
83-
::
84-
85-
unit_test.uniform_xn = 1
86-
87-
8866
Controlling time
8967
----------------
9068

Docs/source/comprehensive_tests.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _sec:comprehensive_tests:
2+
13
************************
24
Comprehensive Unit Tests
35
************************

Docs/source/eos_cell.rst

+2-8
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,8 @@ The parameters that affect the thermodynamics are:
2828

2929
* ``unit_test.temperature`` : the initial temperature
3030

31-
* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state
32-
33-
* ``unit_test.small_dens`` : the low density cutoff used in the equation of state
34-
35-
The composition can be set in the same way as in ``burn_cell``, either
36-
by setting each mass fraction explicitly via the parameters,
37-
``unit_test.X1``, ``unit_test.X2``, ..., or forcing them to be all
38-
equal via ``unit_test.uniform_xn=1``.
31+
The composition can be set either by specifying individual mass fractions
32+
or setting ``unit_test.uniform_xn`` as described in :ref:`sec:defining_unit_test_composition`.
3933

4034

4135
Building and Running the Code

Docs/source/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ system.
9292
:hidden:
9393

9494
unit_tests
95+
unit_test_runtime_parameters
9596
comprehensive_tests
9697
one_zone_tests
9798

Docs/source/jac_cell.rst

+7-6
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@ The parameters that affect the thermodynamics are:
3838

3939
* ``unit_test.temperature`` : the initial temperature
4040

41-
* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state
41+
The composition can be set either by specifying individual mass fractions
42+
or setting ``unit_test.uniform_xn`` as described in :ref:`sec:defining_unit_test_composition`.
4243

43-
* ``unit_test.small_dens`` : the low density cutoff used in the equation of state
44+
If the values don't sum to ``1`` initially, then the test will do a
45+
normalization. This normalization can be disabled by setting:
4446

45-
While the mass fractions can be set individually (using
46-
``unit_test.X1``, ``unit_test.X2``, ...), it is recommended to use
47-
``unit_test.uniform_xn=1`` to initialize all the mass fractions to be
48-
equal.
47+
::
48+
49+
unit_test.skip_initial_normalization = 1
4950

5051

5152
Building and Running the Code

Docs/source/one_zone_tests.rst

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _sec:one_zone_tests:
2+
13
**************
24
One Zone Tests
35
**************
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
***********************************
2+
Unit Test Common Runtime Parameters
3+
***********************************
4+
5+
There are a number of runtime parameters that are common to all (or most) of the unit tests.
6+
These are defined in the top-level ``unit_test/_parameters`` file.
7+
8+
Thermodynamics
9+
==============
10+
11+
The equation of state enforces minimum density and temperatures, which must be set
12+
upon initialization. These are controlled by the following runtime parameters:
13+
14+
* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state
15+
16+
* ``unit_test.small_dens`` : the low density cutoff used in the equation of state
17+
18+
19+
.. _sec:defining_unit_test_composition:
20+
21+
Defining composition
22+
====================
23+
24+
Most of the unit tests require a composition to be defined (for the
25+
initial mass-fractions, $X_k$). There are a few ways this can be done
26+
(depending on the test).
27+
28+
* One-zone (``*_cell``) tests (see :ref:`sec:one_zone_tests`) usually do one of:
29+
30+
* *Explicitly setting the individual mass fractions.* This is
31+
controlled by the parameters ``unit_test.X1``, ``unit_test.X2``, ..., ``unit_test.X35``,
32+
e.g.:
33+
34+
::
35+
36+
unit_test.X1 = 0.5
37+
unit_test.X2 = 0.2
38+
unit_test.X3 = 0.2
39+
unit_test.X4 = 0.1
40+
41+
While many of the tests will renormalize the abundances, the user
42+
should take care to ensure that the mass fractions sum to unity.
43+
44+
* *Setting the composition to be uniform.* This is controlled by
45+
``unit_test.uniform_xn``. If this is set to ``1``, then each mass fraction
46+
is initialized to ``1 / NumSpec``.
47+
48+
* Comprehensive tests (see :ref:`sec:comprehensive_tests`) need many different compositions, since they are creating a cube
49+
of varying thermodynamic properties, and thus require a prescription
50+
to create the composition. This is done by setting ``unit_test.primary_species_1``,
51+
``unit_test.primary_species_2``, and ``unit_test.primary_species_3`` to one of the
52+
*names* of the species in the network.
53+
54+
The function ``setup_composition()`` is then used to set limits on
55+
the species abundances (it takes a parameter which is the index into
56+
the cube of data that is being initialized) which is then used by
57+
``get_xn()`` to create the individual mass fractions. Both of these
58+
routines are contained in ``react_util.H``.

Make.Microphysics

-11
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,6 @@ ifeq ($(USE_REACT), TRUE)
6464
DEFINES += -DREACTIONS
6565
endif
6666

67-
ifeq ($(USE_REACT_SPARSE_JACOBIAN), TRUE)
68-
DEFINES += -DREACT_SPARSE_JACOBIAN
69-
70-
# The following is sometimes useful to turn on for debugging sparse J indices
71-
# (if a get/set/scale is called with (row, col) not in the sparse J, stop)
72-
# Otherwise, set/scale do nothing, and get returns 0.
73-
ifeq ($(USE_SPARSE_STOP_ON_OOB), TRUE)
74-
DEFINES += -DSPARSE_STOP_ON_OOB
75-
endif
76-
endif
77-
7867

7968
#------------------------------------------------------------------------------
8069
# AMReX

unit_test/_parameters

+7
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,12 @@ X33 real 0.0e0
4040
X34 real 0.0e0
4141
X35 real 0.0e0
4242

43+
# do we set all of the mass fractions equal (to 1/NumSpec)?
4344
uniform_xn bool 0
4445

46+
# lowest temperature allowed in the EOS
47+
small_temp real 1.e5
48+
49+
# lowest density allowed in the EOS
50+
small_dens real 1.e5
51+

unit_test/burn_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
# the final time to integrate to
74
tmax real 1.e-2
85

unit_test/burn_cell_metal_chem/_parameters

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
run_prefix string "burn_cell_metal_chem"
44

55
# floor values of temperature and density
6-
small_temp real 1.e1
7-
small_dens real 1.e-30
6+
small_temp real 1.e1 100
7+
small_dens real 1.e-30 100
88

99
# the final time to integrate to
1010
tmax real 1.e20

unit_test/burn_cell_primordial_chem/_parameters

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
run_prefix string "burn_cell_primordial_chem"
44

55
# floor values of temperature and density
6-
small_temp real 1.e1
7-
small_dens real 1.e-30
6+
small_temp real 1.e1 100
7+
small_dens real 1.e-30 100
88

99
# the final time to integrate to
1010
tmax real 1.e20

unit_test/burn_cell_sdc/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
# the final time to integrate to
74
tmax real 1.e-2
85

unit_test/eos_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
density real 1.e7
74
temperature real 3.e9

unit_test/jac_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
density real 1.e7
74

85
temperature real 3.e9

unit_test/nse_net_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
run_prefix string ""
44

5-
small_temp real 1.e5
6-
small_dens real 1.e5
7-
85
density real 1.e7
96

107
temperature real 3.e9

unit_test/nse_net_cell/make_table/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@namespace: unit_test
22

3-
small_dens real 1.e5
4-
small_temp real 1.e5
5-
63
rho_min real 1.e6
74
rho_max real 1.e10
85

unit_test/nse_table_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
density real 1.23e9
74
temperature real 5.18e9
85
ye real 0.472

unit_test/part_func_cell/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
@namespace: unit_test
22

3-
small_temp real 1.e5
4-
small_dens real 1.e5
5-
63
temperature real 5.e9
74

unit_test/test_aprox_rates/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ temp_min real 1.e6
66
temp_max real 1.e12
77

88
metalicity_max real 0.1e0
9-
10-
small_temp real 1.e4
11-
small_dens real 1.e-4

unit_test/test_aprox_rates/aprox_rates_util.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ void aprox_rates_test(const Box& bx,
2424

2525
const int ini56 = network_spec_index("nickel-56");
2626

27-
AMREX_PARALLEL_FOR_3D(bx, i, j, k,
27+
amrex::ParallelFor(bx,
28+
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
2829
{
2930

3031
eos_extra_t eos_state;
@@ -444,7 +445,8 @@ void aprox_rates_extra_c12ag(const Box& bx,
444445

445446
const int ini56 = network_spec_index("nickel-56");
446447

447-
AMREX_PARALLEL_FOR_3D(bx, i, j, k,
448+
amrex::ParallelFor(bx,
449+
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
448450
{
449451

450452
eos_extra_t eos_state;

unit_test/test_conductivity/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ temp_min real 1.e6
66
temp_max real 1.e12
77

88
metalicity_max real 0.1e0
9-
10-
small_temp real 1.e4
11-
small_dens real 1.e-4

unit_test/test_conductivity/conductivity_util.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ void cond_test_C(const amrex::Box& bx,
2222
const int ih1 = network_spec_index("hydrogen-1");
2323
const int ihe4 = network_spec_index("helium-4");
2424

25-
AMREX_PARALLEL_FOR_3D(bx, i, j, k,
25+
amrex::ParallelFor(bx,
26+
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
2627
{
2728

2829
// set the composition -- approximately solar

unit_test/test_eos/_parameters

-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,3 @@ temp_min real 1.e6
66
temp_max real 1.e12
77

88
metalicity_max real 0.1e0
9-
10-
small_temp real 1.e4
11-
small_dens real 1.e-4

0 commit comments

Comments
 (0)