Skip to content

Commit

Permalink
Merge branch 'main' into checkpointing
Browse files Browse the repository at this point in the history
  • Loading branch information
ampdes authored Aug 12, 2024
2 parents a3fe473 + 06e90b8 commit dd524c7
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 95 deletions.
89 changes: 47 additions & 42 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
name: Lint
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -60,7 +61,7 @@ jobs:
run: |
cd cpp
clang-format --version
find . -type f \( -name "*.cpp" -o -name "*.h" \) ! -name "loguru.cpp" | xargs clang-format --dry-run --Werror
find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs clang-format --dry-run --Werror
- name: clang-format Python binding checks (non-blocking)
continue-on-error: true
run: |
Expand All @@ -83,16 +84,20 @@ jobs:

name: Build and test
steps:
- uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install catch2 cmake g++ libboost-dev libboost-timer-dev libhdf5-mpi-dev libparmetis-dev libpugixml-dev libspdlog-dev mpi-default-dev ninja-build pkg-config
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Python build dependencies
run: pip install mpi4py nanobind scikit-build-core[pyproject] --upgrade
run: |
pip install --upgrade -r python/build-requirements.txt
- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
Expand All @@ -107,8 +112,6 @@ jobs:
pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }}
- uses: actions/checkout@v4

- name: Configure and install C++
run: |
cmake -G Ninja -DDOLFINX_ENABLE_PETSC=false -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/
Expand All @@ -128,12 +131,12 @@ jobs:
mpirun -n 3 ctest -V --output-on-failure -R unittests
- name: Build Python interface
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[test]'

- name: Install Python demo/test dependencies
run: pip install matplotlib pyamg pytest pytest-xdist scipy
- name: Run demos (Python, serial)
run: python -m pytest -n auto -m serial --durations=10 python/demo/test.py
run: |
pip install pytest-xdist
python -m pytest -n auto -m serial --durations=10 python/demo/test.py
- name: Run demos (Python, MPI (np=3))
run: python -m pytest -m mpi --num-proc=3 python/demo/test.py
- name: Run unit tests
Expand Down Expand Up @@ -164,9 +167,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install required Python packages (docs)
run: pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme

- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
run: |
Expand All @@ -187,14 +187,6 @@ jobs:
cmake --build build
cmake --install build
- name: Build C++ interface documentation
run: |
export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="`
echo $DOLFINX_VERSION
cd cpp/doc
doxygen Doxyfile
make html
- name: Build C++ unit tests
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/
Expand All @@ -215,26 +207,22 @@ jobs:
ctest -V -R demo -R serial
ctest -V -R demo -R mpi_2
- name: Install required Python (build Python interface)
run: pip install nanobind scikit-build-core[pyproject]
- name: Install Python build dependencies
run: pip install -r python/build-requirements.txt

- name: Build Python interface
run: |
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/
- name: Build Python interface documentation
run: |
cd python/doc
python -m sphinx -W -b html source/ build/html/
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[test]'
- name: Set default DOLFINx JIT options
run: |
mkdir -p ~/.config/dolfinx
echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json
- name: Install Python demo/test dependencies
run: pip install numba pyamg pytest pytest-xdist scipy
- name: Run demos (Python, serial)
run: python -m pytest -n auto -m serial --durations=10 python/demo/test.py
run: |
pip install pytest-xdist
python -m pytest -n auto -m serial --durations=10 python/demo/test.py
- name: Run demos (Python, MPI (np=3))
run: python -m pytest -m mpi --num-proc=3 python/demo/test.py

Expand All @@ -243,9 +231,7 @@ jobs:
- name: Run Python unit tests (MPI, np=3)
run: mpirun -np 3 python -m pytest -m "petsc4py or adios2" python/test/unit/

publish-docs:
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }}
needs: build-with-petsc
build-and-publish-docs:
runs-on: ubuntu-latest
container: "ghcr.io/fenics/test-env:current-openmpi"
env:
Expand All @@ -254,13 +240,10 @@ jobs:
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
PRTE_MCA_rmaps_default_mapping_policy: :oversubscribe

name: Publish docs
name: Build and publish docs
steps:
- uses: actions/checkout@v4

- name: Install required Python packages (docs)
run: pip install breathe jupytext matplotlib myst_parser sphinx sphinx_rtd_theme

- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
run: |
Expand All @@ -280,34 +263,55 @@ jobs:
cmake --build build
cmake --install build
- name: Build Python interface
run: |
pip install -r python/build-requirements.txt
pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" 'python/[docs]'
- name: Build C++ interface documentation
run: |
export DOLFINX_VERSION=`cmake -L build | grep DOXYGEN_DOLFINX_VERSION | cut -f2 -d "="`
echo $DOLFINX_VERSION
cd cpp/doc
doxygen Doxyfile
make html
- name: Install required Python (build Python interface)
run: pip install nanobind scikit-build-core[pyproject]

- name: Build Python interface
run: pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/
- name: Upload C++ Doxygen documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-cpp-doxygen
path: cpp/doc/html
retention-days: 2
- name: Upload C++ Sphinx documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-cpp-sphinx
path: cpp/doc/build/html
retention-days: 2

- name: Build Python interface documentation
run: |
cd python/doc
python -m sphinx -W -b html source/ build/html/
- name: Upload Python documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs-python
path: python/doc/build/html
retention-days: 2

- name: Checkout FEniCS/docs
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }}
uses: actions/checkout@v4
with:
repository: "FEniCS/docs"
path: "docs"
ssh-key: "${{ secrets.SSH_GITHUB_DOCS_PRIVATE_KEY }}"
- name: Set version name
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }}
run: |
echo "VERSION_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Copy documentation into repository
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }}
run: |
cd docs
git rm -r --ignore-unmatch dolfinx/${{ env.VERSION_NAME }}/cpp
Expand All @@ -319,6 +323,7 @@ jobs:
cp -r ../cpp/doc/html/* dolfinx/${{ env.VERSION_NAME }}/cpp/doxygen
cp -r ../python/doc/build/html/* dolfinx/${{ env.VERSION_NAME }}/python
- name: Commit and push documentation to FEniCS/docs
if: ${{ github.repository == 'FEniCS/dolfinx' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') ) }}
run: |
cd docs
git config --global user.email "[email protected]"
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ jobs:
brew install adios2 boost cmake hdf5-mpi make ninja open-mpi pkg-config pugixml spdlog # FEniCS
brew install bison flex gfortran # PETSc
- name: Install Python dependencies
- name: Install Python dependencies (petsc4py)
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install cffi cppimport cython numba numpy pytest pytest-xdist scipy
python -m pip install --no-build-isolation mpi4py
python -m pip install mpi4py numpy
python -m pip install cython setuptools wheel
- name: Install minimal PETSc and petsc4py
run: |
Expand Down Expand Up @@ -91,7 +90,7 @@ jobs:
working-directory: dolfinx
run: |
python -m pip install -r python/build-requirements.txt
python -m pip install --check-build-dependencies --no-build-isolation python/
python -m pip install --check-build-dependencies --no-build-isolation 'python/[test]'
- name: Basic test
run: |
Expand All @@ -100,7 +99,10 @@ jobs:
- name: Run Python unit tests (serial)
working-directory: dolfinx
run: python3 -m pytest -n=auto --durations=50 python/test/unit/
run: |
python -m pip install pytest-xdist
python3 -m pytest -n=auto --durations=50 python/test/unit/
- name: Run Python unit tests (MPI, np=3)
working-directory: dolfinx
run: mpirun -np 3 python3 -m pytest python/test/unit/
run: |
mpirun -np 3 python3 -m pytest python/test/unit/
18 changes: 10 additions & 8 deletions .github/workflows/pyvista.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:

- name: Install FEniCS Python components
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
pip install git+https://github.com/FEniCS/ufl.git
pip install git+https://github.com/FEniCS/basix.git
pip install git+https://github.com/FEniCS/ffcx.git
apt-get update
apt-get install -y --no-install-recommends libgl1-mesa-dev xvfb # pyvista
apt-get install -y --no-install-recommends libqt5gui5t64 libgl1 # pyvistaqt
python3 -m pip install pyvista==${PYVISTA_VERSION}
python3 -m pip install pyqt5 pyvistaqt==${PYVISTA_QT_VERSION}
python3 -m pip install matplotlib ipython nanobind scikit-build-core[pyproject] pytest pytest-xdist scipy numba
pip install pyvista==${PYVISTA_VERSION}
pip install pyqt5 pyvistaqt==${PYVISTA_QT_VERSION}
pip install --no-build-isolation -r python/build-requirements.txt
- name: Configure C++
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/
Expand All @@ -56,10 +56,12 @@ jobs:
cmake --install build
- name: Build Python interface
run: pip -v install --check-build-dependencies --config-settings=build-dir="build" --config-settings=cmake.build-type="Debug" --no-build-isolation python/
run: pip -v install --check-build-dependencies --config-settings=build-dir="build" --config-settings=cmake.build-type="Debug" --no-build-isolation 'python/[test]'

- name: Run pyvista demos (Python, serial)
run: python3 -m pytest -v -n 2 -m serial --durations=10 python/demo/test.py
run: |
pip install pytest-xdist
python3 -m pytest -v -n 2 -m serial --durations=10 python/demo/test.py
- name: Run pyvista demos (Python, MPI (np=2))
run: python3 -m pytest -v -m mpi --num-proc=2 python/demo/test.py
16 changes: 7 additions & 9 deletions .github/workflows/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Python dependencies
- name: Install Python build dependencies
run: |
python3 -m pip install mpi4py nanobind scikit-build-core[pyproject] --upgrade
python3 -m pip install --no-cache-dir --upgrade pip setuptools wheel
- name: Install FEniCS Python components
run: |
python3 -m pip install --no-cache-dir --upgrade pip setuptools
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
Expand Down Expand Up @@ -64,21 +63,20 @@ jobs:
- name: Install Python dependencies
run: |
python3 -m pip install cffi numba scikit-build-core[pyproject] pytest pytest-xdist scipy matplotlib
- name: Build Python interface (editable install)
run: |
python3 -m pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type=Debug --config-settings=build-dir="build" -e python/
python3 -m pip install --upgrade -r python/build-requirements.txt
python3 -m pip install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type=Debug --config-settings=build-dir="build" -e 'python/[test]'
- name: Set default DOLFINx JIT options
run: |
mkdir -p ~/.config/dolfinx
echo '{ "cffi_extra_compile_args": ["-g0", "-O0" ] }' > ~/.config/dolfinx/dolfinx_jit_options.json
- name: Install test Python dependencies
run: python3 -m pip install matplotlib numba pytest pytest-xdist scipy

- name: Run demos (Python, serial)
run: python3 -m pytest -n auto -m serial --durations=10 python/demo/test.py
run: |
python3 -m pip install pytest-xdist
python3 -m pytest -n auto -m serial --durations=10 python/demo/test.py
- name: Run demos (Python, MPI (np=2))
run: python3 -m pytest -m mpi --num-proc=2 python/demo/test.py

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ jobs:
echo "$HOME/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Install FEniCS Python components
run: |
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ufl.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/basix.git
python3 -m pip install --break-system-packages git+https://github.com/FEniCS/ffcx.git
python3 -m pip install git+https://github.com/FEniCS/ufl.git
python3 -m pip install git+https://github.com/FEniCS/basix.git
python3 -m pip install git+https://github.com/FEniCS/ffcx.git
- name: Run build-wrapper
run: |
mkdir build
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,13 @@ jobs:
- name: Install build dependencies (workaround)
run: |
python -m pip install scikit-build-core[pyproject] git+https://github.com/jhale/nanobind.git@jhale/msvc2022-workaround setuptools wheel
python -m pip install git+https://github.com/jhale/nanobind.git@jhale/msvc2022-workaround
python -m pip install scikit-build-core[pyproject] setuptools wheel
- name: Install Basix (Python)
working-directory: basix
run: |
cd python
python -m pip -v install --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix
python -m pip -v install --check-build-dependencies --no-build-isolation --no-cache-dir .[ci] --config-settings=cmake.args=-DBasix_DIR=D:/a/basix/install/lib/cmake/basix
cd ../
- name: Checkout FFCx
Expand Down Expand Up @@ -140,6 +141,7 @@ jobs:
- name: Run units tests (Python, serial)
working-directory: dolfinx
run: |
pip install pytest-xdist
python -m pytest -n auto -m "not petsc4py and not adios2" python/test/unit
- name: Run units tests (Python, MPI, np=3)
working-directory: dolfinx
Expand All @@ -149,7 +151,6 @@ jobs:
- name: Run Python demos (serial)
working-directory: dolfinx
run: |
pip install pyamg matplotlib numba scipy # TO REMOVE
cd python/demo
python3 -m pytest -n auto -m serial --durations=10 test.py
- name: Run Python demos (MPI, np=3)
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ else()
CACHE BOOL "Is KaHIP REQUIRED?"
)
endif()
option(DOLFINX_ENABLE_KAHIP "Compile with support for KaHIP." OFF)
option(DOLFINX_ENABLE_KAHIP "Compile with support for KaHIP." ON)
set_package_properties(
KaHIP PROPERTIES
TYPE OPTIONAL
Expand Down
Loading

0 comments on commit dd524c7

Please sign in to comment.