Skip to content

Commit

Permalink
Merge branch 'development' into codespell_update
Browse files Browse the repository at this point in the history
  • Loading branch information
biboyd authored May 24, 2024
2 parents ab45e0a + d9a9263 commit cd9153c
Show file tree
Hide file tree
Showing 257 changed files with 21,978 additions and 9,344 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Checks: >
-modernize-use-using,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
portability-*,
readability-*,
-readability-avoid-const-params-in-decls,
Expand Down
45 changes: 0 additions & 45 deletions .github/workflows/c-linter.yml

This file was deleted.

37 changes: 37 additions & 0 deletions .github/workflows/check-params.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: check runtime params

on:
push:
branches:
- development
- main
pull_request:
branches:
- development

jobs:
check-runtime-params:
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: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Run check-params
run: |
PYTHONPATH=external/Microphysics/util/build_scripts python .github/workflows/check_params.py .
74 changes: 74 additions & 0 deletions .github/workflows/check_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import argparse
import importlib
import os
import re
from pathlib import Path
import sys

# some parameters that are not defined in _cpp_parameters

whitelist = ["maestro.lo_bc",
"maestro.hi_bc"]

# we don't have all of the radiation parametrs in the _cpp_parameters
# yet, so we won't check these namespaces

namespace_ignore = []

def doit(maestroex_dir):

maestroex = Path(os.path.abspath(maestroex_dir))

# import the module that defines the MAESTROeX runtime params
sys.path.append(str(maestroex / "Source" / "param/"))
import parse_maestro_params

# read in the parameters defined in _cpp_parameters
param_file = maestroex / "Source" / "param" / "_cpp_parameters"
params = parse_maestro_params.read_param_file(str(param_file))

namespaces = set(p.namespace for p in params)
runtime_parameters = [f"{p.namespace}.{p.name}" for p in params]

pattern = re.compile(r"[A-Za-z0-9_]+\.[A-Za-z0-9_]+", re.IGNORECASE)

# loop over all the inputs files
exec_path = maestroex / "Exec"
for f in exec_path.glob("**/inputs*"):

if os.path.isdir(f):
continue

# find all the params in each namespace
with open(f) as infile:
print(f"working on {f}")
for line in infile:
# remove comments
idx = line.find("#")
if idx > 0:
line = line[:idx]

found_param = pattern.match(line)
if not found_param:
continue

p = found_param.group(0)
nm = p.split(".")[0]
if nm in namespaces and nm not in namespace_ignore:
if not (p in runtime_parameters or p in whitelist):
sys.exit(f"Error: {p} not valid")


if __name__ == "__main__":

# we need the top-level MAESTROeX directory

p = argparse.ArgumentParser()
p.add_argument("maestroex_dir", type=str, nargs=1,
help="top level MAESTROeX directory")

args = p.parse_args()

doit(args.maestroex_dir[0])


36 changes: 36 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "clang-tidy"

on: [pull_request]

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

jobs:
clang_tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get submodules
run: |
git submodule update --init
cd external/Microphysics
git fetch; git checkout development
echo "MICROPHYSICS_HOME=$(pwd)" >> $GITHUB_ENV
cd ../amrex
git fetch; git checkout development
echo "AMREX_HOME=$(pwd)" >> $GITHUB_ENV
cd ../..
- name: Install dependencies
run: |
.github/workflows/dependencies_clang-tidy-apt-llvm.sh 17
- name: Compile wdconvect
run: |
echo $AMREX_HOME
echo $MICROPHYSICS_HOME
cd Exec/science/wdconvect
make USE_MPI=FALSE USE_OMP=FALSE USE_CLANG_TIDY=TRUE CLANG_TIDY=clang-tidy-17 CLANG_TIDY_WARN_ERROR=TRUE -j 4
39 changes: 39 additions & 0 deletions .github/workflows/compiler-warnings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: "compiler warnings"

on: [pull_request]

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

jobs:
compiler_warnings:
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 g++>=9.3.0
- name: Compile wdconvect
run: |
cd Exec/science/wdconvect
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE WARN_ALL=TRUE WARN_ERROR=TRUE -j 4
- name: Compile reacting_bubble
run: |
cd Exec/test_problems/reacting_bubble
make USE_MPI=FALSE USE_OMP=FALSE DEBUG=TRUE DIM=2 WARN_ALL=TRUE WARN_ERROR=TRUE -j 4
22 changes: 22 additions & 0 deletions .github/workflows/dependencies_clang-tidy-apt-llvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

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

if [[ ! -f /etc/apt/trusted.gpg.d/apt.llvm.org.asc ]]; then
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
fi

source /etc/os-release # set UBUNTU_CODENAME

sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME} main"
sudo add-apt-repository "deb http://apt.llvm.org/${UBUNTU_CODENAME}/ llvm-toolchain-${UBUNTU_CODENAME}-$1 main"

sudo apt-get update

sudo apt-get install -y --no-install-recommends \
clang-tidy-$1 libomp-$1-dev
2 changes: 1 addition & 1 deletion .github/workflows/gpu_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
run: |
export PATH=$PATH:/usr/local/cuda/bin
cd Exec/test_problems/reacting_bubble
make DIM=2 USE_MPI=FALSE USE_CUDA=TRUE -j 2
make DIM=2 USE_MPI=FALSE USE_CUDA=TRUE -j 4
4 changes: 2 additions & 2 deletions .github/workflows/reacting_bubble-compare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Compile reacting_bubble
run: |
cd Exec/test_problems/reacting_bubble
make DIM=2 USE_MPI=FALSE -j 2
make DIM=2 USE_MPI=FALSE -j 4
- name: Run reacting_bubble
run: |
Expand All @@ -36,7 +36,7 @@ jobs:
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 2
make programs=fextrema -j 4
- name: Check the extrema
run: |
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/wdconvect-compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: wdconvect

on: [pull_request]
jobs:
wdconvect-3d:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- 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 g++>=9.3.0
- name: Compile wdconvect
run: |
cd Exec/science/wdconvect
make USE_OMP=FALSE USE_MPI=FALSE -j 4
- name: Run wdconvect
run: |
cd Exec/science/wdconvect
cp model_files/kepler_new_6.25e8.hybrid.hse.320 .
cp inputs_files/inputs_3d_regression.2levels .
./Maestro3d.gnu.ex inputs_3d_regression.2levels
- name: Build the fextrema tool
run: |
cd external/amrex/Tools/Plotfile
make programs=fextrema -j 4
- name: Check the extrema
run: |
cd Exec/science/wdconvect
../../../external/amrex/Tools/Plotfile/fextrema.gnu.ex wdconvect_plt0000003 > fextrema.out
diff fextrema.out ci-benchmarks/wdconvect_3d_extrema.out
24 changes: 13 additions & 11 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,31 @@
"creators": [
{
"affiliation": "Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory",
"name": "Almgren, Ann",
"orcid": "0000-0003-2103-312X"
},
{
"affiliation": "Department of Physics and Astronomy, Stony Brook University",
"name": "Boyd, Brendan",
"orcid": "0000-0002-5419-9751"
},
{
"name": "Fan, Doreen",
"orcid": "0000-0002-3246-4315"
},
{
"affiliation": "Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory",
"name": "Nonaka, Andy",
"orcid": "0000-0003-1791-0265"
"name": "Harpole, Alice",
"orcid": "0000-0002-1530-781X"
},
{
"affiliation": "Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory",
"name": "Almgren, Ann",
"orcid": "0000-0003-2103-312X"
"name": "Nonaka, Andy",
"orcid": "0000-0003-1791-0265"
},
{
"affiliation": "Center for Computational Sciences and Engineering, Lawrence Berkeley National Laboratory",
"name": "Willcox, Donald",
"orcid": "0000-0003-2300-5165"
},
{
"affiliation": "Department of Physics and Astronomy, Stony Brook University",
"name": "Harpole, Alice",
"orcid": "0000-0002-1530-781X"
},
{
"affiliation": "Department of Physics and Astronomy, Stony Brook University",
"name": "Zingale, Michael",
Expand Down
Loading

0 comments on commit cd9153c

Please sign in to comment.