Skip to content

Commit

Permalink
Merge branch 'development' into retry_retry
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Dec 1, 2023
2 parents c155a94 + 49c9712 commit 97cb2b2
Show file tree
Hide file tree
Showing 503 changed files with 196,431 additions and 129,458 deletions.
62 changes: 62 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# http://EditorConfig.org
#
# precedence of rules is bottom to top

# this is the top-most EditorConfig file
root = true


[*.{c,h,cpp,hpp,H,py}]
# 4 space indentation
indent_style = space
indent_size = 4

# Clean up trailing whitespace
trim_trailing_whitespace = true

# unix-style newlines
end_of_line = lf

# newline ending in files
insert_final_newline = true

[networks/**/reaclib_rates.H]
# some reaclib rate labels have trailing spaces
trim_trailing_whitespace = false


[*.md]
# two end of line whitespaces are newlines without a paragraph
trim_trailing_whitespace = false


[*.rst]
# Enforce UTF-8 encoding
charset = utf-8

# Unix-style newlines
end_of_line = lf

# Newline ending in files
insert_final_newline = true

# 3 space indentation
indent_style = space
indent_size = 3

# Clean up trailing whitespace
trim_trailing_whitespace = true

[{Makefile,GNUmakefile,Make.*}]
# TABs are part of its syntax
indent_style = tab
indent_size = unset


[util/gcem/**]
# don't mess with the gcem subtree
indent_style = unset
indent_size = unset
trim_trailing_whitespace = unset
end_of_line = unset
insert_final_newline = unset
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Replaced tabs with spaces and trimmed trailing whitespace
5a2247f598f88f80ad8b186188fccfd5537b18d3
48 changes: 39 additions & 9 deletions .github/workflows/burn_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Compare to stored output (VODE, subch_approx)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_unit_test.out
- name: Compile, burn_cell (VODE, ECSN)
run: |
Expand All @@ -53,10 +53,42 @@ jobs:
cd unit_test/burn_cell
./main3d.gnu.ex inputs_ecsn > test.out
- name: Compare to stored output (ECSN)
- name: Compare to stored output (VODE, ECSN)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ecsn_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/ecsn_unit_test.out
- name: Compile, burn_cell (VODE, ignition_chamulak)
run: |
cd unit_test/burn_cell
make realclean
make NETWORK_DIR=ignition_chamulak -j 4
- name: Run burn_cell (VODE, ignition_chamulak)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_ignition_chamulak > test.out
- name: Compare to stored output (VODE, ignition_chamulak)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/chamulak_VODE_unit_test.out
- name: Compile, burn_cell (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
make realclean
make NETWORK_DIR=triple_alpha_plus_cago INTEGRATOR_DIR=ForwardEuler -j 4
- name: Run burn_cell (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_triple > test.out
- name: Compare to stored output (ForwardEuler, triple_alpha_plus_cago)
run: |
cd unit_test/burn_cell
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/triple_alpha_plus_cago_FE_unit_test.out
- name: Compile, burn_cell (BackwardEuler, subch_approx)
run: |
Expand All @@ -72,7 +104,7 @@ jobs:
- name: Compare to stored output (BackwardEuler, subch_approx)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_BE_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/subch_approx_BE_unit_test.out
- name: Compile, burn_cell (QSS, aprox13)
run: |
Expand All @@ -88,7 +120,7 @@ jobs:
- name: Compare to stored output (QSS, aprox13)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_QSS_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_QSS_unit_test.out
- name: Compile, burn_cell (RKC, aprox13)
run: |
Expand All @@ -99,11 +131,9 @@ jobs:
- name: Run burn_cell (RKC, aprox13)
run: |
cd unit_test/burn_cell
./main3d.gnu.ex inputs_aprox13 unit_test.temperature=2.e9 > test.out
./main3d.gnu.ex inputs_aprox13 unit_test.temperature=1.e9 > test.out
- name: Compare to stored output (RKC, aprox13)
run: |
cd unit_test/burn_cell
diff -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_RKC_unit_test.out
diff -I "^Initializing AMReX" -I "^AMReX" -I "^reading in reaclib rates" test.out ci-benchmarks/aprox13_RKC_unit_test.out
2 changes: 1 addition & 1 deletion .github/workflows/burn_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
value2=$(awk 'NR=='"$line_number"' {match($0, /[+-]?[0-9]+([.][0-9]+)?[eE]?[+-]?[0-9]+/); if (RSTART) print substr($0, RSTART, RLENGTH)}' reference_solution.out)
difference=$(awk -v val1="$value1" -v val2="$value2" 'BEGIN { printf "%.2f", (val1 - val2) / val2 }')
if (( $(echo "$difference > $threshold" | bc -l) )); then
echo "Line number: $line_number"
echo "Value in test.out: $value1"
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/c-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,16 @@ jobs:
if [[ -n "${AMREX_HOME}" ]]; then exit 1; fi
cd ../..
- name: Install dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get -qq -y install curl clang-tidy cmake jq clang cppcheck clang-format bear g++>=9.3.0
- name: Run cpp linter
uses: AMReX-Astro/cpp-linter-action@main
with:
build_path: 'unit_test/test_react'
make_options: '-j 2 USE_OMP=FALSE USE_MPI=FALSE USE_CUDA=FALSE DEBUG=TRUE'
ignore_files: 'amrex'
ignore_files: 'amrex|util/gcem'
header_filter: '(/conductivity/|/constants/|/EOS/|/integration/|/interfaces/|/networks/|/neutrinos/|/nse_solver/|/opacity/|/rates/|/screening/|/util/|^\./).*\.H$'
config_file: ${GITHUB_WORKSPACE}/.clang-tidy
# not sure why cppcheck tests _MSC_VER, since it's only referenced from gcem
cppcheck_options: '-U_OPENMP -UAMREX_USE_GPU -UAMREX_USE_CUDA -UAMREX_USE_HIP -U_MSC_VER'

- name: Archive clang tidy report
uses: actions/upload-artifact@v1
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/castro.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Castro

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-apps
cancel-in-progress: true

jobs:
castro:
name: Castro
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get Latest Release Tag
run: |
AMREX_TAG=$(wget https://github.com/AMReX-Codes/amrex/releases/latest 2>&1 | grep Location: | awk '{print $2}' | awk -F/ '{print $NF}')
echo "AMREX_TAG=$AMREX_TAG" >> $GITHUB_ENV
- name: Download Castro
uses: actions/checkout@v3
with:
repository: 'AMReX-Astro/Castro'
ref: development
path: 'Castro'
- name: Download AMReX
uses: actions/checkout@v3
with:
repository: 'AMReX-Codes/amrex'
ref: ${{env.AMREX_TAG}}
path: 'amrex'
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies.sh
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v3
with:
path: ~/.cache/ccache
key: ccache-${{ github.workflow }}-${{ github.job }}-git-${{ github.sha }}
restore-keys: |
ccache-${{ github.workflow }}-${{ github.job }}-git-
- name: Build flame_wave
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=75M
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z
export AMREX_HOME=${PWD}/amrex
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/flame_wave/
make -j2 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
- name: Build subchandra
run: |
export CCACHE_COMPRESS=1
export CCACHE_COMPRESSLEVEL=10
export CCACHE_MAXSIZE=75M
export CCACHE_LOGFILE=${{ github.workspace }}/ccache.log.txt
ccache -z
export AMREX_HOME=${PWD}/amrex
export MICROPHYSICS_HOME=${PWD}
cd Castro/Exec/science/subchandra/
make -j2 CCACHE=ccache USE_MPI=FALSE
ccache -s
du -hs ~/.cache/ccache
save_pr_number:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: |
echo $PR_NUMBER > pr_number.txt
- uses: actions/upload-artifact@v3
with:
name: pr_number
path: pr_number.txt
retention-days: 1
2 changes: 1 addition & 1 deletion .github/workflows/cmake_build_cell_primordial_chem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- name: Compile and run
run: |
mkdir build && cd build
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMREX=true
cmake .. -DBUILD_UNIT_TEST=true -DBUILD_AMReX=true
make -j2
ctest --output-on-failure
4 changes: 2 additions & 2 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '[0-9][0-9].[0-9][0-9]'
- '[0-9][0-9].[0-9][0-9]'

name: Create Release

jobs:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,23 @@ jobs:
cd ../..
- name: Dependencies
run: .github/workflows/dependencies_nvcc11.sh
run: .github/workflows/dependencies/dependencies_nvcc11.sh

- name: compile test_react (aprox13)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make NETWORK_DIR=aprox13 USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
- name: compile test_react (subch_simple)
- name: compile test_react (ignition_reaclib/URCA-simple)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_react
make realclean
make NETWORK_DIR=subch_simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
make NETWORK_DIR=ignition_reaclib/URCA-simple USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
- name: compile test_ase (ase)
run: |
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
cd unit_test/test_ase
make USE_CUDA=TRUE COMP=gnu USE_MPI=FALSE -j 2
21 changes: 21 additions & 0 deletions .github/workflows/dependencies/dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
#
# Copyright 2020-2022 The AMReX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Axel Huebl

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

sudo apt-get update

sudo apt-get install -y --no-install-recommends\
build-essential \
g++ gfortran \
libopenmpi-dev \
openmpi-bin
11 changes: 11 additions & 0 deletions .github/workflows/dependencies/dependencies_ccache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

if [[ $# -eq 2 ]]; then
CVER=$1
else
CVER=4.8
fi

wget https://github.com/ccache/ccache/releases/download/v${CVER}/ccache-${CVER}-linux-x86_64.tar.xz
tar xvf ccache-${CVER}-linux-x86_64.tar.xz
sudo cp -f ccache-${CVER}-linux-x86_64/ccache /usr/local/bin/
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/eos_cell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
- name: Compare to stored output (helmholtz)
run: |
cd unit_test/eos_cell
diff -I "^AMReX" test.out ci-benchmarks/eos_helmholtz.out
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/eos_helmholtz.out
- name: Compile eos_cell (gamma_law)
run: |
Expand All @@ -56,6 +56,6 @@ jobs:
- name: Compare to stored output (gamma_law)
run: |
cd unit_test/eos_cell
diff -I "^AMReX" test.out ci-benchmarks/eos_gamma_law.out
diff -I "^Initializing AMReX" -I "^AMReX" test.out ci-benchmarks/eos_gamma_law.out
6 changes: 3 additions & 3 deletions .github/workflows/find_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ def find_files(SHAs=None):
if stderr is not None:
raise Exception('git diff encountered an error')

files = [f for f in stdout.decode('utf-8').strip().split('\n')
files = [f for f in stdout.decode('utf-8').strip().split('\n')
if f.startswith('networks/')]
print(files)

# see which directories contain changed files
changed_networks = set()
for f in files:
# check for the NETWORK_PROPERTIES file in each parent directory
# check for the actual_network.H file in each parent directory
parts = f.split('/')
while parts:
if os.path.exists(os.path.join(*parts, 'NETWORK_PROPERTIES')):
if os.path.exists(os.path.join(*parts, 'actual_network.H')):
# remove networks/
changed_networks.add(os.path.join(*parts[1:]))
break
Expand Down
Loading

0 comments on commit 97cb2b2

Please sign in to comment.