Skip to content

Commit

Permalink
Merge pull request #239 from NCAR/main
Browse files Browse the repository at this point in the history
Release version 3.2.0
General solver, JIT solver, started GPU works
  • Loading branch information
boulderdaze authored Sep 25, 2023
2 parents fb5efb8 + fb8e3d3 commit 48d3ed1
Show file tree
Hide file tree
Showing 383 changed files with 14,407 additions and 34,749 deletions.
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# blacklist all
# ignore all
*

# whitelist things to copy
# include things to copy
!CMakeLists.txt
!src/
!docs/
!libs/
!test/
!etc/
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Clang-Format

on:
push:
branches:
- main

jobs:
format:
name: Run Clang-Format
runs-on: ubuntu-latest

steps:
- name: Install Clang-Format
run: sudo apt-get update && sudo apt-get install clang-format

- name: Check out code, run clang format, push changes
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Format code
run: |
find include -type f \( -name '*.hpp' -o -name '*.h' \) -exec clang-format -i --style=file {} +
find src -type f \( -name '*.cu' -o -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \) -exec clang-format -i --style=file {} +
find test -type f \( -name '*.hpp' -o -name '*.h' -o -name '*.cpp' \) -exec clang-format -i --style=file {} +
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git commit -am "Auto-format code using Clang-Format" || echo "No changes to commit"
- name: Push changes to main-formatting branch
run: |
git push origin HEAD:main-formatting
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Auto-format code using Clang-Format"
title: "Auto-format code changes"
body: "This is an automated pull request to apply code formatting using Clang-Format."
branch: "main-formatting"
125 changes: 125 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Build and deploy documentation to GitHub Pages
name: GitHub Pages

on: [ push, pull_request ]

env:
DEFAULT_BRANCH: "release"

jobs:
build-and-deploy:
name: Build and deploy to gh-pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true

- name: Debugging information
run: |
echo "github.ref:" ${{github.ref}}
echo "github.event_name:" ${{github.event_name}}
echo "github.head_ref:" ${{github.head_ref}}
echo "github.base_ref:" ${{github.base_ref}}
set -x
git rev-parse --abbrev-ref HEAD
git branch
git branch -a
git remote -v
python -V
pip list --not-required
pip list
# Clone and set up the old gh-pages branch
- name: Clone old gh-pages
if: ${{ github.event_name == 'push' }}
run: |
set -x
git fetch
( git branch gh-pages remotes/origin/gh-pages && git clone . --branch=gh-pages _gh-pages/ ) || mkdir _gh-pages
rm -rf _gh-pages/.git/
mkdir -p _gh-pages/branch/
# If a push and default branch, copy build to _gh-pages/ as the "main"
# deployment.
- name: Build and copy documentation (default branch)
if: |
contains(github.event_name, 'push') &&
contains(github.ref, env.DEFAULT_BRANCH)
run: |
set -x
mkdir -p _build/html/versions
# create two copies of the documentaiton
# 1. the frozen version, represented as vX.X in the version switcher
docker build -t micm -f Dockerfile.docs .
id=$(docker create micm)
docker cp $id:/build/docs/sphinx tmpdocs
docker rm -v $id
version=$(sed -nr "s/^release = f'v(.+)\{suffix\}'.*$/\1/p" docs/source/conf.py)
mv tmpdocs _build/html/versions/${version}
# 2. stable, represented as vX.X (stable) in the version switcher
# edit conf.py to produce a version string that looks like vX.X (stable)
docker build -t micm -f Dockerfile.docs --build-arg SUFFIX=" (stable)" .
id=$(docker create micm)
docker cp $id:/build/docs/sphinx tmpdocs
docker rm -v $id
mv tmpdocs _build/html/versions/stable
mv docs/switcher.json _build/html
# Delete everything under _gh-pages/ that is from the
# primary branch deployment. Excludes the other branches
# _gh-pages/branch-* paths, and not including
# _gh-pages itself.
find _gh-pages/ -mindepth 1 ! -path '_gh-pages/branch*' ! -path '_gh-pages/versions*' -delete
rsync -a _build/html/versions/stable/* _gh-pages/
# If a push and not on default branch, then copy the build to
# _gh-pages/branch/$brname (transforming '/' into '--')
- name: Build and copy documentation (branch)
if: |
contains(github.event_name, 'push') &&
!contains(github.ref, env.DEFAULT_BRANCH)
run: |
set -x
docker build -t micm -f Dockerfile.docs .
id=$(docker create micm)
docker cp $id:/build/docs/sphinx tmpdocs
docker rm -v $id
brname="${{github.ref}}"
brname="${brname##refs/heads/}"
brdir=${brname//\//--} # replace '/' with '--'
rm -rf _gh-pages/branch/${brdir}
rsync -a tmpdocs/ _gh-pages/branch/${brdir}
# Go through each branch in _gh-pages/branch/, if it's not a
# ref, then delete it.
- name: Delete old feature branches
if: ${{ github.event_name == 'push' }}
run: |
set -x
for brdir in `ls _gh-pages/branch/` ; do
brname=${brdir//--/\/} # replace '--' with '/'
if ! git show-ref remotes/origin/$brname ; then
echo "Removing $brdir"
rm -r _gh-pages/branch/$brdir/
fi
done
# Add the .nojekyll file
- name: nojekyll
if: ${{ github.event_name == 'push' }}
run: |
touch _gh-pages/.nojekyll
# Deploy
# https://github.com/peaceiris/actions-gh-pages
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.event_name == 'push' }}
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: _gh-pages/
force_orphan: true
163 changes: 96 additions & 67 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,104 @@ name: build
on: [push, pull_request]

jobs:
build_tests:
runs-on: ubuntu-latest
docker-build-and-test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image
run: docker build -t micm .
- name: run tests in container
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
# build_tests_with_openmp:
# runs-on: ubuntu-latest
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: build Docker image
# run: docker build -t micm -f Dockerfile.openmp .
# - name: run tests in container
# run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
# build_tests_with_mpi:
# runs-on: ubuntu-latest
# if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: recursive
# - name: build Docker image
# run: docker build -t micm -f Dockerfile.mpi .
# - name: run tests in container
# run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
build_tests_with_memcheck:
name: Build and Test - ${{ matrix.dockerfile }}
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
dockerfile:
- Dockerfile
- Dockerfile.coverage
- Dockerfile.llvm
- Dockerfile.memcheck
- Dockerfile.no_json
- Dockerfile.nvhpc
# - Dockerfile.intel # intel image is too large for GH action
# - Dockerfile.openmp
# - Dockerfile.mpi
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image
run: docker build -t micm -f Dockerfile.memcheck .
- name: run tests in container
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
build_tests_for_coverage:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image
run: docker build -t micm -f Dockerfile.coverage .
- name: run tests in container
run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'
- name: copy coverage from container
run: docker cp test-container:build/coverage.info .
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info
build_tests_without_json:
runs-on: ubuntu-latest
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive

- name: Build Docker image
run: docker build -t micm -f ${{ matrix.dockerfile }} .

- name: Run tests in container
if: matrix.dockerfile != 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'

- name: Run coverage tests in container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker run --name test-container -t micm bash -c 'make coverage ARGS="--rerun-failed --output-on-failure -j8"'

- name: Copy coverage from container
if: matrix.dockerfile == 'Dockerfile.coverage'
run: docker cp test-container:build/coverage.info .

- name: Upload coverage report
if: matrix.dockerfile == 'Dockerfile.coverage'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.info

multiplatform:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
compiler:
- { cpp: g++, c: gcc}
- { cpp: clang++, c: clang}
- { cpp: cl, c: cl }
exclude:
- os: windows-latest
compiler: { cpp: clang++, c: clang }
- os: windows-latest
compiler: { cpp: g++, c: gcc }
- os: ubuntu-latest
compiler: { cpp: cl, c: cl }
- os: macos-latest
compiler: { cpp: cl, c: cl }
env:
CC: ${{ matrix.compiler.c }}
CXX: ${{ matrix.compiler.cpp }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: build Docker image
run: docker build -t micm -f Dockerfile.no_json .
- name: run tests in container
run: docker run --name test-container -t micm bash -c 'make test ARGS="--rerun-failed --output-on-failure -j8"'
- name: Checkout code
uses: actions/checkout@v2

- name: Install CMake
if: matrix.os == 'windows-latest'
run: choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System'

- name: Install CMake
if: matrix.os != 'windows-latest'
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
sudo apt-get update
sudo apt-get install -y cmake
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
brew install cmake
fi
- name: Configure and build
run: |
mkdir build
cd build
cmake ..
cmake --build .
- name: Run tests
run: |
cd build
ctest -C Debug --rerun-failed --output-on-failure . --verbose
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
**/CMakeFiles/
doc/html/
doc/latex/
.vscode
.vscode
xcode/
15 changes: 13 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.21)

project(
micm
VERSION 3.1.0
VERSION 3.2.0
LANGUAGES CXX
)

Expand Down Expand Up @@ -37,8 +37,19 @@ option(ENABLE_OPENMP "Enable OpenMP support" OFF)
option(ENABLE_COVERAGE "Enable code coverage output" OFF)
option(ENABLE_MEMCHECK "Enable memory checking in tests" OFF)
option(ENABLE_JSON "Enable json configureation file reading" ON)
option(ENABLE_REGRESSION_TESTS "Enable regression tests against the old pre-processed version of micm" ON)
option(BUILD_DOCS "Build the documentation" OFF)
option(ENABLE_CUDA "Build with Cuda support" OFF)
option(ENABLE_OPENACC "Build with OpenACC Support" OFF)
option(ENABLE_LLVM "Build with LLVM support for JIT-compiling" OFF)

include(CMakeDependentOption)
# Option to collect custom OpenACC flags
cmake_dependent_option(ENABLE_GPU_TYPE "Enable custom CUDA flags" OFF
"ENABLE_OPENACC OR ENABLE_CUDA" ON)

if(ENABLE_GPU_TYPE)
set(GPU_TYPE "" CACHE STRING "The GPU type being targeted")
endif()

################################################################################
# Dependencies
Expand Down
Loading

0 comments on commit 48d3ed1

Please sign in to comment.