Skip to content

Commit

Permalink
Merge branch 'development' into remove_old_fortran_make
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Feb 13, 2025
2 parents d541ea3 + 5886c9c commit a7e65c4
Show file tree
Hide file tree
Showing 41 changed files with 115 additions and 143 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 @@ -27,7 +27,7 @@ jobs:
cd ../..
- name: Dependencies
run: .github/workflows/dependencies/dependencies_hip.sh
run: .github/workflows/dependencies/dependencies_hip.sh 6.3.2

- name: compile test_react with HIP (iso7)
run: |
Expand Down
30 changes: 4 additions & 26 deletions Docs/source/burn_cell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,17 @@ The parameters that affect the thermodynamics are:

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

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

* ``unit_test.small_dens`` : the low density cutoff used in the equation of state

The composition can be set either by setting each mass fraction explicitly via the
parameters, ``unit_test.X1``, ``unit_test.X2``, ...,
e.g.:

::

unit_test.X1 = 0.5
unit_test.X2 = 0.2
unit_test.X3 = 0.2
unit_test.X4 = 0.1

where parameters up to ``X35`` are available. If the values don't sum to ``1``
initially, then the test will do a normalization. This normalization can be
disabled by setting:
If the values don't sum to ``1`` initially, then the test will do a
normalization. This normalization can be disabled by setting:

::

unit_test.skip_initial_normalization = 1


Alternately, the composition can be set automatically by initializing all
of the mass fractions equally (to $1/N$, where $N$ is the number of species),
by setting:

::

unit_test.uniform_xn = 1


Controlling time
----------------

Expand Down
2 changes: 2 additions & 0 deletions Docs/source/comprehensive_tests.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _sec:comprehensive_tests:

************************
Comprehensive Unit Tests
************************
Expand Down
10 changes: 2 additions & 8 deletions Docs/source/eos_cell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,8 @@ The parameters that affect the thermodynamics are:

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

* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state

* ``unit_test.small_dens`` : the low density cutoff used in the equation of state

The composition can be set in the same way as in ``burn_cell``, either
by setting each mass fraction explicitly via the parameters,
``unit_test.X1``, ``unit_test.X2``, ..., or forcing them to be all
equal via ``unit_test.uniform_xn=1``.
The composition can be set either by specifying individual mass fractions
or setting ``unit_test.uniform_xn`` as described in :ref:`sec:defining_unit_test_composition`.


Building and Running the Code
Expand Down
1 change: 1 addition & 0 deletions Docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ system.
:hidden:

unit_tests
unit_test_runtime_parameters
comprehensive_tests
one_zone_tests

Expand Down
13 changes: 7 additions & 6 deletions Docs/source/jac_cell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ The parameters that affect the thermodynamics are:

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

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

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

While the mass fractions can be set individually (using
``unit_test.X1``, ``unit_test.X2``, ...), it is recommended to use
``unit_test.uniform_xn=1`` to initialize all the mass fractions to be
equal.
::

unit_test.skip_initial_normalization = 1


Building and Running the Code
Expand Down
2 changes: 2 additions & 0 deletions Docs/source/one_zone_tests.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _sec:one_zone_tests:

**************
One Zone Tests
**************
Expand Down
58 changes: 58 additions & 0 deletions Docs/source/unit_test_runtime_parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
***********************************
Unit Test Common Runtime Parameters
***********************************

There are a number of runtime parameters that are common to all (or most) of the unit tests.
These are defined in the top-level ``unit_test/_parameters`` file.

Thermodynamics
==============

The equation of state enforces minimum density and temperatures, which must be set
upon initialization. These are controlled by the following runtime parameters:

* ``unit_test.small_temp`` : the low temperature cutoff used in the equation of state

* ``unit_test.small_dens`` : the low density cutoff used in the equation of state


.. _sec:defining_unit_test_composition:

Defining composition
====================

Most of the unit tests require a composition to be defined (for the
initial mass-fractions, $X_k$). There are a few ways this can be done
(depending on the test).

* One-zone (``*_cell``) tests (see :ref:`sec:one_zone_tests`) usually do one of:

* *Explicitly setting the individual mass fractions.* This is
controlled by the parameters ``unit_test.X1``, ``unit_test.X2``, ..., ``unit_test.X35``,
e.g.:

::

unit_test.X1 = 0.5
unit_test.X2 = 0.2
unit_test.X3 = 0.2
unit_test.X4 = 0.1

While many of the tests will renormalize the abundances, the user
should take care to ensure that the mass fractions sum to unity.

* *Setting the composition to be uniform.* This is controlled by
``unit_test.uniform_xn``. If this is set to ``1``, then each mass fraction
is initialized to ``1 / NumSpec``.

* Comprehensive tests (see :ref:`sec:comprehensive_tests`) need many different compositions, since they are creating a cube
of varying thermodynamic properties, and thus require a prescription
to create the composition. This is done by setting ``unit_test.primary_species_1``,
``unit_test.primary_species_2``, and ``unit_test.primary_species_3`` to one of the
*names* of the species in the network.

The function ``setup_composition()`` is then used to set limits on
the species abundances (it takes a parameter which is the index into
the cube of data that is being initialized) which is then used by
``get_xn()`` to create the individual mass fractions. Both of these
routines are contained in ``react_util.H``.
11 changes: 0 additions & 11 deletions Make.Microphysics
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,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


#------------------------------------------------------------------------------
# AMReX
Expand Down
7 changes: 7 additions & 0 deletions unit_test/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,12 @@ X33 real 0.0e0
X34 real 0.0e0
X35 real 0.0e0

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

# lowest temperature allowed in the EOS
small_temp real 1.e5

# lowest density allowed in the EOS
small_dens real 1.e5

3 changes: 0 additions & 3 deletions unit_test/burn_cell/_parameters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

# the final time to integrate to
tmax real 1.e-2

Expand Down
4 changes: 2 additions & 2 deletions unit_test/burn_cell_metal_chem/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
run_prefix string "burn_cell_metal_chem"

# floor values of temperature and density
small_temp real 1.e1
small_dens real 1.e-30
small_temp real 1.e1 100
small_dens real 1.e-30 100

# the final time to integrate to
tmax real 1.e20
Expand Down
4 changes: 2 additions & 2 deletions unit_test/burn_cell_primordial_chem/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
run_prefix string "burn_cell_primordial_chem"

# floor values of temperature and density
small_temp real 1.e1
small_dens real 1.e-30
small_temp real 1.e1 100
small_dens real 1.e-30 100

# the final time to integrate to
tmax real 1.e20
Expand Down
3 changes: 0 additions & 3 deletions unit_test/burn_cell_sdc/_parameters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

# the final time to integrate to
tmax real 1.e-2

Expand Down
3 changes: 0 additions & 3 deletions unit_test/eos_cell/_parameters
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

density real 1.e7
temperature real 3.e9
3 changes: 0 additions & 3 deletions unit_test/jac_cell/_parameters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

density real 1.e7

temperature real 3.e9
Expand Down
3 changes: 0 additions & 3 deletions unit_test/nse_net_cell/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

run_prefix string ""

small_temp real 1.e5
small_dens real 1.e5

density real 1.e7

temperature real 3.e9
Expand Down
3 changes: 0 additions & 3 deletions unit_test/nse_net_cell/make_table/_parameters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@namespace: unit_test

small_dens real 1.e5
small_temp real 1.e5

rho_min real 1.e6
rho_max real 1.e10

Expand Down
3 changes: 0 additions & 3 deletions unit_test/nse_table_cell/_parameters
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

density real 1.23e9
temperature real 5.18e9
ye real 0.472
Expand Down
3 changes: 0 additions & 3 deletions unit_test/part_func_cell/_parameters
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
@namespace: unit_test

small_temp real 1.e5
small_dens real 1.e5

temperature real 5.e9

3 changes: 0 additions & 3 deletions unit_test/test_aprox_rates/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ temp_min real 1.e6
temp_max real 1.e12

metalicity_max real 0.1e0

small_temp real 1.e4
small_dens real 1.e-4
6 changes: 4 additions & 2 deletions unit_test/test_aprox_rates/aprox_rates_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ void aprox_rates_test(const Box& bx,

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

AMREX_PARALLEL_FOR_3D(bx, i, j, k,
amrex::ParallelFor(bx,
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
{

eos_extra_t eos_state;
Expand Down Expand Up @@ -444,7 +445,8 @@ void aprox_rates_extra_c12ag(const Box& bx,

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

AMREX_PARALLEL_FOR_3D(bx, i, j, k,
amrex::ParallelFor(bx,
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
{

eos_extra_t eos_state;
Expand Down
3 changes: 0 additions & 3 deletions unit_test/test_conductivity/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ temp_min real 1.e6
temp_max real 1.e12

metalicity_max real 0.1e0

small_temp real 1.e4
small_dens real 1.e-4
3 changes: 2 additions & 1 deletion unit_test/test_conductivity/conductivity_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ void cond_test_C(const amrex::Box& bx,
const int ih1 = network_spec_index("hydrogen-1");
const int ihe4 = network_spec_index("helium-4");

AMREX_PARALLEL_FOR_3D(bx, i, j, k,
amrex::ParallelFor(bx,
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
{

// set the composition -- approximately solar
Expand Down
3 changes: 0 additions & 3 deletions unit_test/test_eos/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,3 @@ temp_min real 1.e6
temp_max real 1.e12

metalicity_max real 0.1e0

small_temp real 1.e4
small_dens real 1.e-4
Loading

0 comments on commit a7e65c4

Please sign in to comment.