Skip to content

Commit

Permalink
Merge branch 'main' into dokken/document_refinement
Browse files Browse the repository at this point in the history
  • Loading branch information
jhale authored Apr 15, 2024
2 parents 6616eba + e2f55cf commit 25f4041
Show file tree
Hide file tree
Showing 238 changed files with 12,091 additions and 5,079 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ install-python-components: &install-python-components
pip3 install git+https://github.com/FEniCS/ffcx.git
ruff-isort-python-code: &ruff-isort-python-code
name: ruff and isort checks on Python code
name: ruff checks on Python code
command: |
cd python/
ruff check .
isort --check .
ruff format --check .
configure-cpp: &configure-cpp
name: Configure (C++)
Expand Down
3 changes: 0 additions & 3 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ body:
- type: textarea
id: code-block
attributes:
label: Suggestion user interface
label: Suggested user interface
description: Please create a minimal (Python) code that shows how you would like the feature to work.
render: python3
placeholder: No 3x``` encapsulation of code required
placeholder: No 3x``` encapsulation of code required
99 changes: 67 additions & 32 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,21 @@ on:
type: string

jobs:
build:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
lint:
runs-on: ubuntu-latest
container: ghcr.io/fenics/test-env:current-openmpi

env:
PETSC_ARCH: ${{ matrix.petsc_arch }}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1

strategy:
matrix:
petsc_arch: [linux-gnu-real32-32, linux-gnu-real64-32, linux-gnu-complex64-32, linux-gnu-complex128-32, linux-gnu-real64-64, linux-gnu-complex128-64]

name: Build and test (${{ matrix.petsc_arch }})

steps:
- uses: actions/checkout@v4

- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
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
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
python3 -m pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }}
- name: ruff and isort C++ .py file checks
- name: ruff .py files in C++ code
run: |
cd cpp/
ruff check .
python3 -m isort --check .
- name: ruff and isort Python interface checks
ruff format --check .
- name: ruff Python interface checks
run: |
cd python/
ruff check .
python3 -m isort --check .
ruff format --check .
- name: mypy checks
run: |
cd python/
Expand All @@ -93,6 +66,68 @@ jobs:
run: |
find . -type f \( -name "*.cmake" -o -name "*.cmake.in" -o -name "CMakeLists.txt" \) | xargs cmake-format --check
build:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
runs-on: ubuntu-latest
container: ghcr.io/fenics/test-env:current-openmpi
env:
SCOTCH_DIR: /usr/local/petsc/linux-gnu-real64-32

steps:
- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
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
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
python3 -m pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }}
- uses: actions/checkout@v4
- name: Configure C++
run: cmake -G Ninja -DDOLFINX_ENABLE_PETSC=false -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/
- name: Build and install C++ library
run: |
cmake --build build
cmake --install build
- name: Build Python interface
run: python3 -m pip -v install --check-build-dependencies --no-build-isolation --config-settings=cmake.build-type="Debug" python/
- name: Test Python import
run: python3 -c "import dolfinx; print(dolfinx.__version__)"

build-with-petsc:
if: "!(contains(github.event.head_commit.message, '[ci skip]') || contains(github.event.head_commit.message, '[skip ci]'))"
runs-on: ubuntu-latest
container: ghcr.io/fenics/test-env:current-openmpi
env:
PETSC_ARCH: ${{ matrix.petsc_arch }}
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
strategy:
matrix:
petsc_arch: [linux-gnu-real32-32, linux-gnu-real64-32, linux-gnu-complex64-32, linux-gnu-complex128-32, linux-gnu-real64-64, linux-gnu-complex128-64]

name: Build and test (${{ matrix.petsc_arch }})
steps:
- uses: actions/checkout@v4

- name: Install FEniCS Python components (default branches/tags)
if: github.event_name != 'workflow_dispatch'
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
- name: Install FEniCS Python components
if: github.event_name == 'workflow_dispatch'
run: |
python3 -m pip install git+https://github.com/FEniCS/ufl.git@${{ github.event.inputs.ufl_ref }}
python3 -m pip install git+https://github.com/FEniCS/basix.git@${{ github.event.inputs.basix_ref }}
python3 -m pip install git+https://github.com/FEniCS/ffcx.git@${{ github.event.inputs.ffcx_ref }}
- name: Configure C++
run: cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build -S cpp/

Expand Down
41 changes: 25 additions & 16 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Conda install and test
strategy:
matrix:
os: [ubuntu-22.04, macos-12, macos-13]
os: [ubuntu-22.04, macos-13, macos-14]
fail-fast: false
runs-on: ${{ matrix.os }}
timeout-minutes: 30
Expand All @@ -30,15 +30,6 @@ jobs:
run: |
conda update conda
- name: Install DOLFINx (py3-9)
run: |
conda create -n env3-9 -c conda-forge python=3.9 fenics-dolfinx mpich
conda env export -n env3-9
- name: Test (py3-9)
run: |
conda run -n env3-9 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-9 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-10)
run: |
conda create -n env3-10 -c conda-forge python=3.10 fenics-dolfinx mpich
Expand All @@ -48,11 +39,29 @@ jobs:
conda run -n env3-10 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-10 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-10, petsc-complex)
- name: Install DOLFINx (py3-11)
run: |
conda create -n env3-11 -c conda-forge python=3.11 fenics-dolfinx mpich
conda env export -n env3-11
- name: Test (py3-11)
run: |
conda run -n env3-11 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-11 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-12)
run: |
conda create -n env3-12 -c conda-forge python=3.12 fenics-dolfinx mpich
conda env export -n env3-12
- name: Test (py3-12)
run: |
conda run -n env3-12 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12 mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Install DOLFINx (py3-12, petsc-complex)
run: |
conda create -n env3-10-complex -c conda-forge python=3.10 fenics-dolfinx petsc=*=complex* mpich
conda env export -n env3-10-complex
- name: Test (py3-10-complex)
conda create -n env3-12-complex -c conda-forge python=3.12 fenics-dolfinx petsc=*=complex* mpich
conda env export -n env3-12-complex
- name: Test (py3-12-complex)
run: |
conda run -n env3-10-complex python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-10-complex mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12-complex python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
conda run -n env3-12-complex mpirun -np 2 python -c "from mpi4py import MPI; import dolfinx; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
58 changes: 42 additions & 16 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@ on:
jobs:
mac-os-build:
name: macOS Homebrew install and test
runs-on: macos-13
runs-on: macos-14
env:
PETSC_ARCH: arch-darwin-c-opt
PETSC_DIR: ${{ github.workspace }}/petsc

steps:
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Install Homebrew dependencies
run: |
# brew install adios2 boost cmake hdf5-mpi ninja open-mpi pkg-config pugixml python # FEniCS
brew install boost cmake hdf5-mpi make ninja open-mpi pkg-config pugixml # FEniCS
brew install adios2 boost cmake hdf5-mpi make ninja open-mpi pkg-config pugixml # FEniCS
brew install bison flex # PETSc
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install cython numpy mpi4py
python -m pip install cffi cppimport cython numba numpy pytest pytest-xdist scipy
python -m pip install --no-build-isolation mpi4py
- name: Install minimal PETSc and petsc4py
run: |
Expand All @@ -43,10 +43,13 @@ jobs:
--with-scalar-type=real \
--with-shared-libraries \
--with-scalar-type=real \
--download-ptscotch
--download-metis \
--download-parmetis \
--download-ptscotch \
--download-superlu_dist
make all
cd src/binding/petsc4py
PETSC_DIR=$GITHUB_WORKSPACE/petsc PETSC_ARCH=arch-darwin-c-opt arch -x86_64 python -m pip install --no-cache-dir -v .
arch -arm64 python -m pip install --no-build-isolation --no-cache-dir -v .
- name: Install FEniCSx dependencies
run: |
Expand All @@ -59,20 +62,43 @@ jobs:
path: dolfinx

- name: Build and install DOLFINx C++ library
working-directory: dolfinx
run: |
cmake -G Ninja -B build -S dolfinx/cpp/
cmake -G Ninja -B build -S cpp/
cmake --build build
cmake --install build
sudo cmake --install build
- name: Build C++ unit tests
working-directory: dolfinx
run: |
cmake -G Ninja -DCMAKE_BUILD_TYPE=Developer -B build/test/ -S cpp/test/
cmake --build build/test --parallel 3
- name: Run C++ unit tests (serial)
working-directory: dolfinx
run: |
cd build/test
ctest -V --output-on-failure -R unittests
- name: Run C++ unit tests (MPI)
working-directory: dolfinx
run: |
cd build/test
mpiexec -np 3 ctest -V --output-on-failure -R unittests
- name: Build and install DOLFINx Python interface
env:
PYTHONPATH: ${{ github.workspace }}/petsc/${{ env.PETSC_ARCH }}/lib:${{ env.PYTHONPATH }}
working-directory: dolfinx
run: |
python -m pip install -r dolfinx/python/build-requirements.txt
python -m pip install --check-build-dependencies --no-build-isolation dolfinx/python/
python -m pip install -r python/build-requirements.txt
python -m pip install --check-build-dependencies --no-build-isolation python/
- name: Basic test
env:
PYTHONPATH: ${{ github.workspace }}/petsc/${{ env.PETSC_ARCH }}/lib:${{ env.PYTHONPATH }}
run: |
python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
mpirun -np 2 python -c "import dolfinx; from mpi4py import MPI; dolfinx.mesh.create_rectangle(comm=MPI.COMM_WORLD, points=((0, 0), (2, 1)), n=(32, 16))"
- name: Run Python unit tests (serial)
working-directory: dolfinx
run: 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/
Loading

0 comments on commit 25f4041

Please sign in to comment.