Skip to content

Commit

Permalink
Merge branch 'next' into adios-io-next-rebase
Browse files Browse the repository at this point in the history
* next:
  Set oversubscribe flags for openmpi 5
  CI: Replace pip script with requirements.txt
  Add BOUT_HOST_DEVICE to accessor operators for GPU
  hypre3d: Replace finite() with std::isfinite()
  hypre3d: Remove reference to datafile
  Use latest python in CI
  Bump externalpackages/boutdata from `ab59ef9` to `908a4c2`
  Bump externalpackages/googletest from `2dd1c13` to `829c199`
  Bump externalpackages/fmt from `f0903ad` to `2ac6c5c`
  Bump externalpackages/mpark.variant from `3c7fc82` to `23cb94f`
  CI: run only once per week
  Increase shm size in container
  CI: Also build slepc from devel branch
  CI: Run on PETSc developement branch
  Fix test-laplace-petsc3d
  CI: user master branch for OCI workflow
  [RTD] specify tool
  [RTD] add os too read the docs config
  Bump ZedThree/clang-tidy-review from 0.13.1 to 0.14.0
  Bump stefanzweifel/git-auto-commit-action from 4 to 5
  Bump actions/setup-python from 1 to 4
  Increase MG levels for Petsc3DAMG test
  Don't include headers for petsc interface if we're not building it
  Apply clang-format changes
  Fix a whole bunch of clang-tidy issues in petsc interface/AMG solver
  Apply clang-format
  Add defaulted move ctor/assignment for `PetscMatrix::Element`
  Fix getting correct parallel slice for `getWeightsForYApproximation`
  Stop clang-tidy complaining about some short names
  Change some variable names to keep clang-tidy happy
  Apply clang-format changes
  Delete unneeded PetscVectorElement test
  Refactor setting boundary conditions in LaplacePetsc3dAmg
  Set LaplacePetsc3damg options in initialiser list
  Print error in laplace-petsc3d test
  Add a utility function for checking flags in bitsets
  Make sure guard cells in PetscVector buffer are -1
  Fix some clang-tidy issues, mostly multiple declarations on one line
  Replace direct calls to `VecSetValue` with buffered calls
  Make `Field2D::data` private
  Collect all test failures for petsc3d
  Add `size()` method to Fields to get total number of points
  Simplify getting parallel slice interpolation weights
  Use `BoutException` formatted message instead of `std::cout`
  Use default constructor for `Vec/Mat` deleters
  WIP convert petscvector
  Fix lots of clang-tidy issues in PETSc interface
  Docs: Note removal of `./configure` build system
  Remove all autoconf files
  Docs: Remove remaining references to `./configure` from docs
  Fix sphinx configuration
  Bump docker/build-push-action
  Ensure also lower case is accepted
  Bump externalpackages/googletest from `6092810` to `2dd1c13`
  Apply clang-format changes
  Cast reason to int for formatting
  Do not try to print KSPConvergedReason
  CI: Use more system packages
  CI: Reenable petsc
  Try disabeling PETSc
  Bump actions/cache from 2 to 3
  Bump docker/metadata-action
  Bump actions/checkout from 2 to 4
  Bump codecov/codecov-action from 1 to 3
  Bump externalpackages/boututils from `c2e97a2` to `433995f`
  Also give a backtrace if we are hitting a bus error
  Switch back to openmpi
  CI: switch to mpich to workaround openmpi issue
  Switch to fedora packes
  Default to current working directory
  Ensure submodules are present for local testing
  Change default to rawhide
  Prefer dnf5
  Bump required C++ standard to 17
  • Loading branch information
pnorbert committed Dec 5, 2023
2 parents ec60cd5 + b92c60e commit 259f138
Show file tree
Hide file tree
Showing 186 changed files with 584 additions and 4,355 deletions.
7 changes: 4 additions & 3 deletions .build_petsc_for_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
set -e

if test $BUILD_PETSC ; then
if [[ ! -d $HOME/local/petsc/include/petsc ]]; then
if [[ ! -d $HOME/local/petsc/include/petsc ]] || test $1 ; then
echo "****************************************"
echo "Building PETSc"
echo "****************************************"

git clone -b release https://gitlab.com/petsc/petsc.git petsc --depth=1
branch=${1:-release}
git clone -b $branch https://gitlab.com/petsc/petsc.git petsc --depth=1

unset PETSC_DIR
unset PETSC_ARCH
Expand All @@ -34,7 +35,7 @@ if test $BUILD_PETSC ; then
echo "Building SLEPc"
echo "****************************************"

git clone -b release https://gitlab.com/slepc/slepc.git slepc --depth=1
git clone -b $branch https://gitlab.com/slepc/slepc.git slepc --depth=1

pushd slepc
unset SLEPC_DIR
Expand Down
25 changes: 17 additions & 8 deletions .ci_fedora.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,19 @@ then
# 3. docker start -a mobydick <=> start to run the container (initialized with docker-cp)
if test $1 = podman ; then
cmd=podman
# For the use of testing
git submodule update --init # --recursive
else
cmd="sudo docker"
fi
test . != ".$2" && mpi="$2" || mpi=openmpi
test . != ".$3" && version="$3" || version=latest
test . != ".$3" && version="$3" || version=rawhide
time $cmd pull registry.fedoraproject.org/fedora:$version
time $cmd create --cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
--shm-size 256M \
--name mobydick registry.fedoraproject.org/fedora:$version \
/tmp/BOUT-dev/.ci_fedora.sh $mpi
time $cmd cp ${TRAVIS_BUILD_DIR} mobydick:/tmp
time $cmd cp ${TRAVIS_BUILD_DIR:-$(pwd)} mobydick:/tmp/BOUT-dev
time $cmd start -a mobydick
exit 0
fi
Expand All @@ -37,28 +40,34 @@ then
cat /etc/os-release
# Ignore weak depencies
echo "install_weak_deps=False" >> /etc/dnf/dnf.conf
time dnf -y install dnf5-plugins python3-pip cmake
time dnf -y install dnf5
time dnf5 -y install dnf5-plugins cmake python3-zoidberg python3-natsort
# Allow to override packages - see #2073
time dnf copr enable -y davidsch/fixes4bout || :
time dnf -y upgrade
time dnf -y builddep bout++
time dnf5 copr enable -y davidsch/fixes4bout || :
time dnf5 -y upgrade
time dnf5 -y builddep bout++
useradd test
cp -a /tmp/BOUT-dev /home/test/
chown -R test /home/test
chmod u+rwX /home/test -R
sudo -u test ${0/\/tmp/\/home\/test} $mpi
## If we are called as normal user, run test
else
pip install --user zoidberg natsort
. /etc/profile.d/modules.sh
module load mpi/${1}-x86_64
export OMPI_MCA_rmaps_base_oversubscribe=yes
export PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
export TRAVIS=true
export FLEXIBLAS=NETLIB
cd
cd BOUT-dev
echo "starting configure"
time cmake -S . -B build -DBOUT_USE_PETSC=ON
time cmake -S . -B build -DBOUT_USE_PETSC=ON \
-DBOUT_UPDATE_GIT_SUBMODULE=OFF \
-DBOUT_USE_SYSTEM_FMT=ON \
-DBOUT_USE_SYSTEM_MPARK_VARIANT=ON \
-DBOUT_USE_SUNDIALS=ON

time make -C build build-check -j 2
time make -C build check
fi
6 changes: 6 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -359,5 +359,11 @@ CheckOptions:
value: 'false'
- key: readability-simplify-subscript-expr.Types
value: '::std::basic_string;::std::basic_string_view;::std::vector;::std::array'
- key: readability-identifier-length.IgnoredVariableNames
value: '^n?[xyz]$'
- key: readability-identifier-length.IgnoredParameterNames
value: '^[ijkxyz][01]?$'
- key: readability-identifier-length.IgnoredLoopCounterNames
value: '^[ijkxyz_]$'
...

4 changes: 2 additions & 2 deletions .github/workflows/black-fix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand All @@ -41,6 +41,6 @@ jobs:
ls
$HOME/.local/bin/black tests/ tools/ $(grep -EIlr '^#!.*python.*$' bin/ tests/ tools/ src/ | grep -v _boutpp_build)
- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply black changes"
4 changes: 2 additions & 2 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout the pull request branch, also include all history
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
Expand All @@ -25,6 +25,6 @@ jobs:
run: git clang-format origin/${{ github.base_ref }}

- name: Commit to the PR branch
uses: stefanzweifel/git-auto-commit-action@v4
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Apply clang-format changes"
6 changes: 3 additions & 3 deletions .github/workflows/clang-tidy-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- name: Run clang-tidy
uses: ZedThree/clang-tidy-review@v0.13.1
uses: ZedThree/clang-tidy-review@v0.14.0
id: review
with:
build_dir: build
Expand All @@ -46,4 +46,4 @@ jobs:
-DBOUT_UPDATE_GIT_SUBMODULE=OFF
- name: Upload clang-tidy fixes
uses: ZedThree/clang-tidy-review/upload@v0.13.1
uses: ZedThree/clang-tidy-review/upload@v0.14.0
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
uses: docker/login-action@master
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
uses: docker/metadata-action@master
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
prefix=${{ matrix.mpi }}-${{matrix.metric3d.tag_prefix}}${{ matrix.config.tag_postfix }}-
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
uses: docker/build-push-action@master
with:
build-args: |
BASE=${{ matrix.mpi }}-${{ matrix.metric3d.base_prefix }}${{ matrix.config.base_postfix }}-main
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down Expand Up @@ -57,12 +57,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down Expand Up @@ -106,12 +106,12 @@ jobs:
if: always()

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
- name: Install dependencies
run: python -m pip install --upgrade pip &&
pip install --upgrade build &&
Expand Down
56 changes: 46 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Tests
on: [push, pull_request]
on:
push:
pull_request:
schedule:
# run sunday moring
- cron: '30 6 * * 0'

defaults:
run:
Expand All @@ -23,17 +28,37 @@ jobs:
OMP_NUM_THREADS: ${{ matrix.config.omp_num_threads }}
PYTHONPATH: ${{ github.workspace }}/tools/pylib
OMPI_MCA_rmaps_base_oversubscribe: yes
PRTE_MCA_rmaps_default_mapping_policy: ":oversubscribe"
MPIRUN: mpiexec -np
strategy:
fail-fast: true
matrix:
# Need this to be able to exclude the coverage job
is_master_or_next:
- ${{ github.ref == 'refs/heads/master' || github.ref == 'refs/heads/next' || github.base_ref == 'master' || github.base_ref == 'next' }}
is_cron:
- ${{ github.event_name == 'cron' }}
config:
- name: "CMake, PETSc unreleased"
os: ubuntu-20.04
cmake_options: "-DBUILD_SHARED_LIBS=ON
-DBOUT_ENABLE_METRIC_3D=ON
-DBOUT_ENABLE_OPENMP=ON
-DBOUT_USE_PETSC=ON
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"
build_petsc: -petsc-main
build_petsc_branch: main
on_cron: true

- name: "Default options, Ubuntu 20.04"
os: ubuntu-20.04
cmake_options: ""
on_cron: false

- name: "Optimised, static"
os: ubuntu-20.04
Expand All @@ -47,6 +72,7 @@ jobs:
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false

- name: "Debug, shared"
os: ubuntu-20.04
Expand All @@ -58,6 +84,7 @@ jobs:
-DBOUT_USE_SLEPC=ON
-DBOUT_USE_SUNDIALS=ON
-DSUNDIALS_ROOT=/home/runner/local"
on_cron: false

- name: "Shared, release, Ubuntu 20.04"
os: ubuntu-20.04
Expand All @@ -70,6 +97,7 @@ jobs:
-DBOUT_BUILD_DOCS=OFF
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false

- name: "Shared, OpenMP, 3D metrics"
os: ubuntu-latest
Expand All @@ -82,6 +110,7 @@ jobs:
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
omp_num_threads: 2
on_cron: false

- name: "CMake, new PETSc"
os: ubuntu-20.04
Expand All @@ -95,8 +124,8 @@ jobs:
-DSUNDIALS_ROOT=/home/runner/local
-DPETSC_DIR=/home/runner/local/petsc
-DSLEPC_DIR=/home/runner/local/slepc"

build_petsc: -petsc
on_cron: false

- name: "Coverage"
os: ubuntu-20.04
Expand All @@ -111,11 +140,15 @@ jobs:
-DBOUT_ENABLE_PYTHON=ON
-DSUNDIALS_ROOT=/home/runner/local"
unit_only: YES
on_cron: false
exclude:
# Don't run the coverage tests if the branch isn't master or next
- is_master_or_next: false
config:
name: "Coverage"
- is_cron: true
config:
on_cron: false

steps:
- name: Job information
Expand Down Expand Up @@ -143,18 +176,21 @@ jobs:
liblapack-dev
libparpack2-dev

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install pip packages
run: |
./.pip_install_for_ci.sh 'cython~=0.29' 'netcdf4~=1.5' 'sympy~=1.5' 'gcovr' 'cmake' zoidberg fastcov
# Add the pip install location to the runner's PATH
echo ~/.local/bin >> $GITHUB_PATH
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
- name: Cache SUNDIALS build
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: /home/runner/local
key: bout-sundials-${{ matrix.config.os }}${{ matrix.config.build_petsc }}
Expand All @@ -163,7 +199,7 @@ jobs:
run: ./.build_sundials_for_ci.sh

- name: Build PETSc
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh
run: BUILD_PETSC=${{ matrix.config.build_petsc }} ./.build_petsc_for_ci.sh ${{ matrix.config.build_petsc_branch }}

- name: Build BOUT++
run: UNIT_ONLY=${{ matrix.config.unit_only }} ./.ci_with_cmake.sh ${{ matrix.config.cmake_options }}
Expand All @@ -182,15 +218,15 @@ jobs:
- name: Upload coverage
if: ${{ matrix.config.name == 'Coverage' }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3

Fedora:
# This is its own job as it doesn't use most of the steps of the
# standard_tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Build Fedora rawhide
Expand Down
Loading

0 comments on commit 259f138

Please sign in to comment.