Skip to content

Commit

Permalink
Merge branch 'development' into nse_test_cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale authored Dec 26, 2023
2 parents a151e25 + c3509d4 commit 51b2328
Show file tree
Hide file tree
Showing 51 changed files with 119,557 additions and 49,713 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
34 changes: 34 additions & 0 deletions .github/workflows/model_parser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: model parser

on: [pull_request]
jobs:
model_parser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
cd ../amrex
git fetch; git checkout development
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl cmake jq clang g++>=9.3.0
- name: Compile model_parser test
run: |
cd Util/model_parser/test
make -j 4
- name: Run model_parser test
run: |
cd Util/model_parser/test
./Castro3d.gnu.ex
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 23.12

* The radiation solver port to C++ has been completed (#2638, #2648)

# 23.11

* Problem GNUmakefiles have been standardized and now allow for the
Expand Down
10 changes: 9 additions & 1 deletion Docs/source/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,15 @@ By default, 4 output files are created:

The species masses are given in units of solar masses.

Some problems have custom versions of the diagnostics with additional information.
``Castro/Util/scripts/diag_parser.py`` contains Python code for parsing
these output files into Numpy arrays. Usage instructions are included
in the file, along with an example script at
``Castro/Util/scripts/plot_species.py``. This reads a
``species_diag.out`` file provided on the command line and makes a plot
of the total mass fractions over time.

Some problems have custom versions of the diagnostics with additional
information. These are not currently supported by the Python parser.


.. _sec:parallel_io:
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@
magmom 1.2327065163e-07 1.4587103381e-07
angular_momentum_x 0 0
angular_momentum_y 0 0
angular_momentum_z 0 0
angular_momentum_z -0 -0

5 changes: 2 additions & 3 deletions Exec/reacting_tests/nse_test/create_pretty_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ def read_convergence(file_lo, file_hi):
"rho_E": r"$\rho E$",
"rho_e": r"$\rho e$",
"Temp": r"$T$",
"rho_H1": r"$\rho X(\isotm{H}{1})$",
"rho_n": r"$\rho X(\mathrm{n})$",
"rho_p": r"$\rho X(\mathrm{p})$",
"rho_He4": r"$\rho X(\isotm{He}{4})$",
"rho_C12": r"$\rho X(\isotm{C}{12})$",
"rho_O16": r"$\rho X(\isotm{O}{16})$",
"rho_Cr48": r"$\rho X(\isotm{Cr}{48})$",
"rho_Fe52": r"$\rho X(\isotm{Fe}{52})$",
"rho_Fe54": r"$\rho X(\isotm{Fe}{54})$",
Expand Down
22 changes: 12 additions & 10 deletions Exec/reacting_tests/nse_test/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <eos.H>
#include <network.H>
#if defined(NSE_TABLE)
#include <nse_table_type.H>
#include <nse_table.H>
#elif defined(NSE_NET)
#include <nse_solver.H>
Expand Down Expand Up @@ -63,14 +64,15 @@ void problem_initialize_state_data (int i, int j, int k,
burn_state.y_e = ye;

#if defined(NSE_TABLE)
Real abar;
Real dq;
Real dyedt;
Real dabardt;
Real dbeadt;
Real e_nu;

nse_interp(T, problem::rho0, ye, abar, dq, dyedt, dabardt, dbeadt, e_nu, burn_state.xn);
nse_table_t nse_state;
nse_state.T = T;
nse_state.rho = problem::rho0;
nse_state.Ye = ye;
nse_interp(nse_state);

for (int n = 0; n < NumSpec; ++n) {
burn_state.xn[n] = nse_state.X[n];
}
#elif defined(NSE_NET)
Real eps = 1.e-10_rt;
bool input_ye_is_valid = true;
Expand Down Expand Up @@ -112,8 +114,8 @@ void problem_initialize_state_data (int i, int j, int k,

#ifdef AUX_THERMO
burn_state.aux[AuxZero::iye] = ye;
burn_state.aux[AuxZero::iabar] = abar;
burn_state.aux[AuxZero::ibea] = dq;
burn_state.aux[AuxZero::iabar] = nse_state.abar;
burn_state.aux[AuxZero::ibea] = nse_state.bea;
#endif

eos(eos_input_rt, burn_state);
Expand Down
12 changes: 9 additions & 3 deletions Exec/science/Detonation/problem_initialize.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ void problem_initialize ()
problem::in14 = network_spec_index("nitrogen-14");
problem::io16 = network_spec_index("oxygen-16");

if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::in14 < 0 || problem::io16 < 0) {
if (problem::ihe4 < 0 || problem::ic12 < 0 || problem::io16 < 0) {
amrex::Error("ERROR: species indices not found");
}

Expand Down Expand Up @@ -51,9 +51,15 @@ void problem_initialize ()
}

problem::xn[problem::ic12] = amrex::max(problem::cfrac, problem::smallx);
problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx);
problem::xn[problem::io16] = amrex::max(problem::ofrac, problem::smallx);
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx;

if (problem::in14 >= 0) {
problem::xn[problem::in14] = amrex::max(problem::nfrac, problem::smallx);
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::nfrac - problem::ofrac - (NumSpec - 3) * problem::smallx;
}
else {
problem::xn[problem::ihe4] = 1.0_rt - problem::cfrac - problem::ofrac - (NumSpec - 2) * problem::smallx;
}

// Set the ambient material

Expand Down
4 changes: 2 additions & 2 deletions Exec/science/flame_wave/ci-benchmarks/grid_diag.out
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# COLUMN 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
# TIMESTEP TIME MASS XMOM YMOM ZMOM ANG. MOM. X ANG. MOM. Y ANG. MOM. Z KIN. ENERGY INT. ENERGY GAS ENERGY GRAV. ENERGY TOTAL ENERGY CENTER OF MASS X-LOC CENTER OF MASS Y-LOC CENTER OF MASS Z-LOC CENTER OF MASS X-VEL CENTER OF MASS Y-VEL CENTER OF MASS Z-VEL MAXIMUM TEMPERATURE MAXIMUM DENSITY MAXIMUM T_S / T_E
0 0.0000000000000000 1.4902024346464787e+20 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 2.9583337617665660e+37 2.9583337617665660e+37 0.0000000000000000e+00 2.9583337617665660e+37 2.7306640614148750e+04 6.8067773166795473e+02 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000156899e+08 3.1017131702472486e+07 0.0000000000000000e+00
1 5.9694928185132600e-08 1.4902038799260451e+20 -9.8852813993167483e+18 7.0758681407801181e+23 -3.7077151117729030e+15 -7.8559831399077499e+18 7.9789428545426686e+19 1.9321854546506737e+28 2.7622571688141327e+29 2.9583392229687520e+37 2.9583392505913144e+37 0.0000000000000000e+00 2.9583392505913144e+37 2.7306640614147251e+04 6.8067725884159722e+02 0.0000000000000000e+00 -6.6335093690719216e-02 4.7482550784469004e+03 -2.4880589573803199e-05 1.0000972452748042e+08 3.1017431302318867e+07 1.9852339015703824e-12
2 1.2535934918877847e-07 1.4902056479398973e+20 -2.0759055840781603e+19 1.4862415462814482e+24 -1.6351019859135748e+16 -3.4644556495600996e+19 3.5187152213757382e+20 4.0584338401784393e+28 5.5823502529134965e+29 2.9583452181108320e+37 2.9583452739343134e+37 0.0000000000000000e+00 2.9583452739343134e+37 2.7306640614140473e+04 6.8067697458181988e+02 0.0000000000000000e+00 -1.3930329595435043e-01 9.9733989623249036e+03 -1.0972324445112568e-04 1.0003863648020169e+08 3.1017667549506564e+07 1.9917944188178796e-12
1 5.9694928185132600e-08 1.4902038799260451e+20 -9.8852814000373391e+18 7.0758681407801342e+23 -3.7077151119947915e+15 -7.8559831403383900e+18 7.9789428550115738e+19 1.9321854546506743e+28 2.7622571688115688e+29 2.9583392229687520e+37 2.9583392505913144e+37 0.0000000000000000e+00 2.9583392505913144e+37 2.7306640614147251e+04 6.8067725884159722e+02 0.0000000000000000e+00 -6.6335093695554737e-02 4.7482550784469113e+03 -2.4880589575292177e-05 1.0000972452758998e+08 3.1017431302318867e+07 2.1834522208251888e-12
2 1.2535934918877847e-07 1.4902056479398969e+20 -2.0759055857352421e+19 1.4862415462814437e+24 -1.6351019861504854e+16 -3.4644556500407476e+19 3.5187152219157529e+20 4.0584338401784253e+28 5.5823502529036681e+29 2.9583452181108315e+37 2.9583452739343125e+37 0.0000000000000000e+00 2.9583452739343125e+37 2.7306640614140484e+04 6.8067697458182033e+02 0.0000000000000000e+00 -1.3930329606554864e-01 9.9733989623248763e+03 -1.0972324446702355e-04 1.0003863648118678e+08 3.1017667549506564e+07 1.8217100523183610e-12
2 changes: 1 addition & 1 deletion Exec/science/flame_wave/ci-benchmarks/species_diag.out
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# TIMESTEP TIME Mass He4 Mass C12 Mass O16 Mass Ne20 Mass Mg24 Mass Si28 Mass S32 Mass Ar36 Mass Ca40 Mass Ti44 Mass Cr48 Mass Fe52 Mass Ni56
0 0.0000000000000000 3.5899765861250859e-15 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.4944801491560746e-24 7.1354824912929246e-14
1 5.9694928185132600e-08 3.5899765861251656e-15 7.4944874211898590e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.4944874177116286e-24 7.1354897598484802e-14
2 1.2535934918877847e-07 3.5899765861253060e-15 7.4944963166333664e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.1354986514892610e-14
2 1.2535934918877847e-07 3.5899765861253060e-15 7.4944963166333664e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.4944963093524191e-24 7.1354986514892597e-14
Loading

0 comments on commit 51b2328

Please sign in to comment.