Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel spaces #319

Merged
merged 18 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: 📖
on:
push:
pull_request:
branches:
- main
branches: [main]
merge_group:

jobs:
Expand All @@ -20,10 +19,10 @@ jobs:
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "mpi,strict"
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "strict"

build-and-deploy-docs:
name: Build and deploy docs
Expand All @@ -44,15 +43,14 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "nightly"
components: rustfmt
- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- uses: actions/checkout@v4
- uses: actions/checkout@v3

- name: Build docs
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --features "mpi"
run: RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples

- name: Set file permissions
run: |
Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ jobs:
with:
toolchain: nightly
- run: rustup default nightly

- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- name: Install OpenBLAS, LAPACK, OpenSSL (yum)
run: yum -y install openblas-devel lapack-devel openssl-devel
if: matrix.platform.package-manager == 'yum'
Expand All @@ -49,37 +52,38 @@ jobs:
- name: Build wheel
run: ${{ matrix.platform.python }} -m maturin build --release --out dist -i ${{ matrix.platform.python }} --target ${{ matrix.platform.target }}


- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.wheel }}
path: dist

macos:
name: Build MacOS wheel
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: macos-14
target: aarch64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
rust-toolchain: nightly
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}
path: dist
# macos:
# name: Build MacOS wheel
# runs-on: ${{ matrix.platform.runner }}
# strategy:
# matrix:
# platform:
# - runner: macos-14
# target: aarch64
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.x
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# target: ${{ matrix.platform.target }}
# args: --release --out dist --find-interpreter
# sccache: 'true'
# rust-toolchain: nightly
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-macos-${{ matrix.platform.target }}
# path: dist

sdist:
name: Make sdist
Expand Down
100 changes: 39 additions & 61 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
strategy:
matrix:
rust-version: ["stable"]
mpi: ['mpich', 'openmpi']
feature-flags: ['--features "mpi,strict"']
mpi: ['openmpi']
feature-flags: ['--features "strict"']
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
Expand All @@ -25,8 +25,8 @@ jobs:
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Install cargo-mpirun
run: cargo install cargo-mpirun
# - name: Install cargo-mpirun
# run: cargo install cargo-mpirun
- uses: actions/checkout@v4
- name: Install LAPACK, OpenBLAS
run:
Expand All @@ -38,69 +38,47 @@ jobs:
run: cargo test --release ${{ matrix.feature-flags }}
- name: Run tests
run: cargo test --examples --release ${{ matrix.feature-flags }}
- name: Test benchmarks build
run: cargo bench --no-run --features "mpi,strict"
- name: Run examples
run: |
python3 find_examples.py
chmod +x examples.sh
./examples.sh

run-tests-python:
name: Run Python tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install uv
run: pip install uv "maturin>=1.7"
- name: Make virtual environment
run: |
uv venv .venv
uv pip install pip pytest

- name: Clone ndelement
uses: actions/checkout@v4
with:
path: ./ndelement
repository: bempp/ndelement
ref: main
- name: Install ndelement
run: |
source .venv/bin/activate
cd ndelement
maturin develop --release

- name: Clone ndgrid
uses: actions/checkout@v4
with:
path: ./ndgrid
repository: bempp/ndgrid
ref: main
- name: Install ndgrid
run: |
source .venv/bin/activate
cd ndgrid
maturin develop --release

- name: Install python package
run: |
source .venv/bin/activate
rustup run nightly maturin develop --release
- name: Run Python tests
run: |
source .venv/bin/activate
python -m pytest python/test
# run-tests-python:
# name: Run Python tests
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.12"]
# mpi: ['openmpi']
# steps:
# - name: Set up Rust
# uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# toolchain: nightly
# - name: Set up MPI
# uses: mpi4py/setup-mpi@v1
# with:
# mpi: ${{ matrix.mpi }}
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - uses: actions/checkout@v4
# - name: Install uv
# run: pip install uv "maturin>=1.7"
# - name: Make virtual environment
# run: |
# uv venv .venv
# uv pip install pip pytest
# - name: Install python package
# run: |
# source .venv/bin/activate
# rustup run nightly maturin develop --release
# - name: Run Python tests
# run: |
# source .venv/bin/activate
# python -m pytest python/test

check-dependencies:
name: Check dependencies
Expand Down
103 changes: 37 additions & 66 deletions .github/workflows/run-weekly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
strategy:
matrix:
rust-version: ["stable", "beta", "nightly"]
mpi: [ 'mpich', 'openmpi']
f_mpi: ["", "mpi,"]
mpi: [ 'openmpi']
f_strict: ["", "strict,"]
steps:
- name: Set up Rust
Expand All @@ -31,80 +30,52 @@ jobs:
sudo apt-get install -y libopenblas-dev liblapack-dev

- name: Build rust library
run: cargo build --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
run: cargo build --features "${{matrix.f_strict}}
- name: Build rust library in release mode
run: cargo build --release --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
run: cargo build --release --features "${{matrix.f_strict}}

- name: Run unit tests
run: cargo test --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
run: cargo test --features "${{matrix.f_strict}}
- name: Run unit tests in release mode
run: cargo test --release --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
run: cargo test --release --features "${{matrix.f_strict}}
- name: Run tests
run: cargo test --examples --release --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
- name: Test benchmarks build
run: cargo bench --no-run --features "${{matrix.f_mpi}}${{matrix.f_strict}}"
run: cargo test --examples --release --features "${{matrix.f_strict}}
- name: Run examples
run: |
python3 find_examples.py
chmod +x examples.sh
./examples.sh

- name: Build docs
run: cargo doc --features "${{matrix.f_mpi}}${{matrix.f_strict}}" --no-deps

run-tests-python:
name: Run Python tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/checkout@v4
- name: Install uv
run: pip install uv "maturin>=1.7"
- name: Make virtual environment
run: |
uv venv .venv
uv pip install pip pytest

- name: Clone ndelement
uses: actions/checkout@v4
with:
path: ./ndelement
repository: bempp/ndelement
ref: main
- name: Install ndelement
run: |
source .venv/bin/activate
cd ndelement
maturin develop --release

- name: Clone ndgrid
uses: actions/checkout@v4
with:
path: ./ndgrid
repository: bempp/ndgrid
ref: main
- name: Install ndgrid
run: |
source .venv/bin/activate
cd ndgrid
maturin develop --release

- name: Install python package
run: |
source .venv/bin/activate
rustup run nightly maturin develop --release
- name: Run Python tests
run: |
source .venv/bin/activate
python -m pytest python/test
run: cargo doc --features "${{matrix.f_strict}} --no-deps

# run-tests-python:
# name: Run Python tests
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.12"]
# steps:
# - name: Set up Rust
# uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# toolchain: nightly
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - uses: actions/checkout@v4
# - name: Install uv
# run: pip install uv "maturin>=1.7.2"
# - name: Make virtual environment
# run: |
# uv venv .venv
# uv pip install pip pytest
# - name: Install python package
# run: |
# source .venv/bin/activate
# rustup run nightly maturin develop --release
# - name: Run Python tests
# run: |
# source .venv/bin/activate
# python -m pytest python/test
Loading
Loading